in reply to Re: Gtk2-Perl: Waiting for particular event
in thread Gtk2-Perl: Waiting for particular event

Hi moritz,

> Somehow "looping and waiting" makes me uneasy, because you

> are already in an event loop that is responsible for

> looping and waiting.

I was aware of the main loop issue, but I thought that this would be "healed" with the call to the Gtk->events_pending function. Isn't it like that?

Not using the "waiting for event" approach would, at least, have the consequence not having a "closed" _save_work method any more, which does all the stuff, but several independent functions which would conceal the application's logic, i.e., this would make it harder to understand the code.

So, I would like to stick to the "wait" approach if ever possible.

Cheers

Bloehdian

  • Comment on Re^2: Gtk2-Perl: Waiting for particular event

Replies are listed 'Best First'.
Re^3: Gtk2-Perl: Waiting for particular event
by moritz (Cardinal) on Mar 23, 2013 at 21:32 UTC
    Not using the "waiting for event" approach would, at least, have the consequence not having a "closed" _save_work method any more, which does all the stuff, but several independent functions which would conceal the application's logic, i.e., this would make it harder to understand the code.

    There's a reason one usually doesn't have one function which does "all the work". Afaict _save_work should just, well, save the work, not do UI teardown and other stuff. Doing one thing per function usually increases readability, not decreases it.