Re: strange focus behaviour



Domsodi Gergely said:
When I start my app, before the main Gtk2 I do a $entry1->grab_focus
call, but somehow when the window shows up, the focus is on entry2.

have you tried something like

Glib::Idle->add (sub {
    $entry1->grab_focus
    0 # remove the idle so that it will only get called once.
});

Gtk2->main;

my first, un-educated, guess would be that a widget can't grab focus until a
focus can exist once a main loop is going, i don't know that's the case, just
what i would guess.

-rm




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