[wxPython] wxpython: event.Skip() not working with EVT_LEFT_DCLICK

Is there something intrinisically different about skipping a double
click event as appossed to a tree select event ??

Events types derived from wxCommandEvent are passed up to the parent if not
handled (or if Skip()'d) All other events (wxMouseEvent being one of them)
are not passed up. I don't remember the exact rational for this but in
general, a window should take care of its own size, mouse, key, etc. events
and parent windows are not usually interested in them.

Is it possible to do what I want with a double click event ???

In the child window's mouse event handler:

    self.GetParent().GetEventHandler().ProcessEvent(event)

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

Hi.

The fun with multithreaded network programming and wxPython continues.
Currently, to capture incoming events, I'm using a derivation of the async-threaded-wxPython server that was posted last week .

For sending events, I was originally using modal dialogs w/ blocking sockets, and life was good but clunky. But now, I've moved to using threads so that multiple 'send' dialogs can be invoked at the same time and concurrent incoming events will still show up as icons in the main gui.

what this means in terms of pseudo-code is something like this:

Main class (the main interface):
    Send(self)
        send_dialog = wxDialog(yadda, yadda)
        thread_instance = Net_Thread(Function, argument = send_dialog)
        thread_instance.start()

    Function(self, send_dialog)
        val = send_dialog.ShowModal()
        if val == wxID_OK:
            send the message()
        else:
            pass

Send() basically instantiates a thread, and applies the function to the arguments provided.
What I end up getting is a dialog box that is blank and impossible to destroy without killing the app, and the following error messages:

Xlib: unexpected async reply (sequence *some val*)
Xlib: sequence lost (0x10000) > 0x3b18) in

So far, my searches on the web as to "what the hell does that mean" have turned up the following bit of info:
        
???

I get this message every once and then... It means that you are making two X
calls (or gtk calls) at the same time, without protecting your stuff... Your
program should start by calling:
g_thread_init(NULL);

Your gtk_main() should be:
gdk_thread_enver();
gtk_main();
gdk_thread_leave();

and you should also protect all gtk calls that aren't in the main thread with
the gdk_thread_enter/gdk_thread_leave calls.

???

suggestions? (other than moving to using processes :wink: )

-Steve

what this means in terms of pseudo-code is something like this:

Main class (the main interface):
    Send(self)
        send_dialog = wxDialog(yadda, yadda)
        thread_instance = Net_Thread(Function, argument = send_dialog)
        thread_instance.start()

    Function(self, send_dialog)
        val = send_dialog.ShowModal()
        if val == wxID_OK:
            send the message()
        else:
            pass

Send() basically instantiates a thread, and applies the function to the

arguments provided.

What I end up getting is a dialog box that is blank and impossible to

destroy without killing the app, and the following error messages:

Xlib: unexpected async reply (sequence *some val*)
Xlib: sequence lost (0x10000) > 0x3b18) in

...snip...

suggestions? (other than moving to using processes :wink: )

You can't make GUI method calls from more than one thread. You need to
organize your app such that the GUI runs in the main thread and events/data
are transfered to/from worker threads in some thread safe manner.

This has been discussed a few times in the past so you can try searching the
archive for more info, but in a nutshell wxPostEvent can be used to send
events from worker threads to event handlers (windows, etc.) in the main
thread. You can also use a Queue (see queue.py in the python library) to
easily pass objects between threads.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!