nintyfan
nintyfan

Reputation: 444

GTK+/GLIB event loop and emit signal to event loop

I have one problem. I'm creating interface generation library, called libgreattao. It is able to using many backends to rendering GUI, while running in GUI mode. The problem is in GTK+2.0 backend. I must run main loop and on some event exits from it to destroy window in next step. On window's destroy event I will exit from main loop again - and do only this. Why I call main loop again? Because I must handle events created, while destroying window(window must destroy all it's control and hide). The problem is: callback for destroy signal is called once gtk_widget_destroy is called. I must ensure callback pass by application are called in main loop to allow exit from it, so I define custom signal for class GTKWIDGET. Of course, I can use workarounds, like destroying window in first signal type(the signal which ends main loop), but my library should works in any cases.

Upvotes: 0

Views: 662

Answers (1)

nintyfan
nintyfan

Reputation: 444

I have found solution, but not very good. I must add timeout event, which will emit my signal. I didn't find better solution yet.

Upvotes: 1

Related Questions