0

You can know if the event stack is empty calling the gtk.events_pending() method, but I want to manipulate the pending events and filter it before the next gtk loop cycle, this data must be stored somewhere, but where?

Thanks.

1 Answer 1

1

You can control the event loop yourself. Rather than calling gtk.main(), you can use gtk.main_iteration.

Your loop could then be:

while running:
    #filter events here
    gtk.main_iteration(true)

see here for more info.

Sign up to request clarification or add additional context in comments.

6 Comments

Without calling gtk.main() pygtk exits execution, does not wait for events, so should I open an endless while?
Works, a dirty solution but better than nothing. Thanks
I wouldn't necessarily call this a dirty solution. gtk.main internally just calls these methods. You replace gtk.main with your own loop.
I call it dirty solution because now I need to change a lot of nested GUI loops resulting of a lack of the obvious method gtk.get_event_stack() ... BTW in the endless loop gtk.get_current_event() is returning nothing, how should I filter them? Thanks for your time again.
Ah you probably can't quite filter them the way you want after I read the API docs again. What kind of filtering do you want to do? What kind of events are you hoping to filter
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.