Robin Dunn wrote:
> Hi Karsten et al
>
> Here is a revised version of datectrl_1.4 - I have found
and fixed a few
> more bugs.
>
> I have another question for Robin regarding the customised
bitmap button.
> The following relates to gkt2 only.
>
> Karsten has already reported that, once the button is selected, its
> appearance stays 'selected' after moving off it. I have
confirmed that the
> demo shows the same behaviour.I've been able to reproduce it in your sample on XP too. It
looks to me
like it is simply that showing the dialog is preventing the ComboCtrl
from seeing the EVT_LEFT_UP or something so it doesn't know
that it is
supposed to redraw the button in the unclicked state. The ComboCtrl
should probably do something like capturing the mouse on
left-down and
handling the EVT_CAPTURE_LOST/_CHANGED events as if it was a left-up.You can probably work around this by not showing the dialog in
OnButtonClick, and capturing the mouse and waiting for either
capture-lost or the left-up event and doing it there instead if the
mouse is still within the bounds of the button.>
> I have now noticed another oddity. If you hover the mouse
over the button,
> it turns a tasteful shade of blue. I am using the default
theme installed by
> Fedora 10. Other themes may behave differently.
>
> With the demo, if the mouse leaves the button, the
background colour reverts
> to the original. In my program, I have a tooltip that is
displayed if the
> mouse stays over the button for> 0.5 sec. If you move the
mouse over the
> button and then off within 0.5 sec, it behaves the same -
it changes to blue
> and then reverts. However, if you leave it there long
enough for the tooltip
> to be displayed, then when moving off, the tooltip
disappears, but the
> background stays blue!I'm also able to see it in your sample on XP, so it's not
strictly a GTK
issue either. When the tip window is shown it becomes the
active window
(and I think it captures the mouse) so it causes a EVT_LEAVE_WINDOW
event for the combo button, and so it is redrawn without the
mouse-over
state even though the cursor happens to still be within its
bounds. You
could probably do something in your on_mouse_leave such that
it does not
call Skip in this case, but then you may need to force it
somehow when
the tip window is dismissed.
Thanks for the input, Robin.
I spent a couple of hours experimenting with your suggestions, but I could
not get it working properly. As it is a minor issue, I decided to leave it
alone for now.
I have uploaded the latest version to the wiki -
http://wiki.wxpython.org/DateEditorAndPicker#preview
I included a note and a link to this discussion, so if anyone feels like
following it up they will be very welcome
Frank
···
On 9/12/10 2:06 AM, Frank Millman wrote: