Re: Gtk::window.present() doesn't always present

On 7/15/06, Havoc Pennington <hp redhat com> wrote:
There's also a get_current_time() or something like that, so it's even
easier. The get_current_time() should support a key press that activated
the button, as well.

It's gtk_get_current_event_time() and I advise against its use, unless
you either understand gtk+ event handling thoroughly enough to know
when it'll return a valid timestamp and when it won't OR you go to the
extra trouble of always checking the return value (in the latter case,
of course, you've lost all the keystroke savings you would have gained
in the switch from gtk_get_current_event() to
gtk_get_current_event_time()).  Of course, this is mostly selfish
advice: I'm just kind of sick of debugging apps that have misused it.
;-)  By going the gtk_get_current_event() route and then looking at
the time field of the returned event, you'll immediately know that
you've used it in the wrong place if you get NULL back for the current
event.  gtk_get_current_event_time() kind of hides whether there is a
valid current event or not and people who use it tend to ignore
whether they have a valid timestamp or a bogus one (GDK_CURRENT_TIME),
and just use what it returns regardless.

Just my $0.02,

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