How to prevent the need for click twice on a button when application doesn't have focus ?

hello,

if the wx application doesn't have focus,
clicking on a tree, the tree change event works directly.

But when clicking on a button (while the wx application doesn't have focus),
the first click doesn't generate an wx.EVT_BUTTON.
Is there a way to prevent that or
is there another event that acts directly ?

thanks,
Stef Mientki

As far as I know that behavior (click pass-through to non-active windows) is totally dependent on the platform, although I think there is some low-level stuff that could be done on Windows to change the from the default behavior for a specific window. Not in wx though.

···

On 11/13/10 11:34 AM, Stef Mientki wrote:

hello,

if the wx application doesn't have focus,
clicking on a tree, the tree change event works directly.

But when clicking on a button (while the wx application doesn't have focus),
the first click doesn't generate an wx.EVT_BUTTON.
Is there a way to prevent that or
is there another event that acts directly ?

--
Robin Dunn
Software Craftsman

thanks Robin,

Having the same problem in PyJamas a few weeks ago,
I just remembered the solution there: don't use click events (which are highly pre-processed, but
just use mouse-down).
So I did some experiments and found that this solution also works in wxPython,
instead if binding the buttons to an EVT_BUTTON,
binding them to EVT_LEFT_DOWN seems to todo the trick.

cheers,
Stef

···

On 14-11-2010 07:44, Robin Dunn wrote:

On 11/13/10 11:34 AM, Stef Mientki wrote:

hello,

if the wx application doesn't have focus,
clicking on a tree, the tree change event works directly.

But when clicking on a button (while the wx application doesn't have focus),
the first click doesn't generate an wx.EVT_BUTTON.
Is there a way to prevent that or
is there another event that acts directly ?

As far as I know that behavior (click pass-through to non-active windows) is totally dependent on
the platform, although I think there is some low-level stuff that could be done on Windows to
change the from the default behavior for a specific window. Not in wx though.

instead if binding the buttons to an EVT_BUTTON,

binding them to EVT_LEFT_DOWN seems to todo the trick.
Yes, but then (in my experience) the button does not press down.

···

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en


Hi, I will kill all ads in google gmail.

They will all be dead and gone for all my emails to you. HA HA bye bye ads I just massacred you!!!