Re: Query on controlling tree selections




On Nov 10, 2006, at 8:32 AM, Ashwin Ramachandran wrote:

I understand that since I am calling signal handlers, the status is returned directly from 'callback_for_set_select_function' and not based on the Yes/No button 'clicked'. How do I overcome this? Or am I missing something here?

If you just create the dialog and set up its signal handlers, you return immediately, and control returns (eventually) to the main loop. It sounds like what you want is to block in that function, and not return from your select function until the user answers the dialog. To do this, you need to do something like

    $response = $dialog->run;
    $dialog->destroy;
    return $response eq 'yes';

Gtk2::Dialog::run() starts another main loop, and will stop that main loop when the user activates a response.

Whether it is actually a good idea to block on a modal dialog in a tree selection handler is another question entirely.







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]