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



Elijah Newren wrote:
On 7/15/06, Harm Hamberg <h hamberg dynamicc-welding biz> wrote:
Great! But how can I get the timestamp from a
Gtk::Button::signal_clicked()? Should I override the on_frame_event and save
the last timestamp?

gtk+ keeps track of events it is processing.  It has the notion of a
"current event" that it is processing (which may be NULL), and there
are methods to access this information.  When you're in a
signal_clicked handler, gtk's current event is the button press event
that caused that handler to be called.  Using gtk_get_current_event(),
you can get that event, and then just access its time member.  I tried
looking in the gtkmm documentation to see if that function was wrapped
and had a different name, but didn't find anything.

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.

Havoc




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