Custom EventHandler, custom events, and threads

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
koderpat
Experienced Solver
Experienced Solver
Posts: 62
Joined: Tue Apr 05, 2005 5:04 am
Contact:

Custom EventHandler, custom events, and threads

Post by koderpat » Mon Apr 11, 2005 12:56 pm

I have a threaded application, and I was hoping to use a custom evthandler for IPC between my threads. I can get events generated by a window, but when I try to generate events from my code, (non-wxwidget class), they don't make it to the window.


I am using AddPendingEvent on my custom evthandler, how would I have to ::Connect() or ::SetNextHandler() in order to get my custom evthandler to send the message to the approperiate window?

Cursor
Earned some good credits
Earned some good credits
Posts: 120
Joined: Sun Aug 29, 2004 3:09 pm
Location: Grenoble, France
Contact:

Post by Cursor » Mon Apr 11, 2005 2:22 pm

Have you test with wxMutexGuiEnter and wxMutexGuiLeave [1] arround your ProcessEvent call ?

[1] : http://www.wxwidgets.org/manuals/2.5.4/ ... exguienter
What is little and green, witch go up and down ??
Yoda playing with the force.

koderpat
Experienced Solver
Experienced Solver
Posts: 62
Joined: Tue Apr 05, 2005 5:04 am
Contact:

Post by koderpat » Mon Apr 11, 2005 8:43 pm

Strange, it appers that by adding that statement, the main gui thread deadlocks.

Although it does make sense to have.

Question, When I am pushing my custom eventhandler into the main_window::wxwindow, this will cause events generated at my custom eventhandler to follow through to the main window eventhandler yes?

or is that the events generated from the main window are being sent to my custom event handler?

Post Reply