Re: GDK Button clicks and exposes
- From: Owen Taylor <otaylor redhat com>
- To: Adam T <simbacat blueyonder co uk>
- Cc: gtk-devel-list gnome org
- Subject: Re: GDK Button clicks and exposes
- Date: 11 Apr 2003 02:22:27 -0400
On Fri, 2003-04-11 at 07:30, Adam T wrote:
> Hi all, I am trying to decipher the inner workings of GDK and its
> backends, and I'm looking for a little help if possible!
> My current confusion is when to expose a window after a mouse click, so
> far my understanding is thus...
>
> The user clicks the mouse.
> The backend decides that this click is for the child window (where the
> button widget is).
> This generates a event of type GDK_BUTTON_PRESS.
> The backend then call's the GDK function _gdk_event_button_generate,
> which seems to only be concerned with double an triple clicks.
> The button press event then goes onto the gdk event queue and is
> processed somewhere within gdk and gtk :/
>
> My question is... does the processing of a button click within gdk
> generate an expose event, to show the button being depressed, or should
> the backend generate this expose event? Generally, how does the
> depressed button get displayed?
You have to separate out buttons and buttons.
When the *mouse* button is present, GDK sends a button_press_event
to libgtk which gets passed to the GtkButton widget. The GtkButton
widget decides that in response to the button_press_event, it should
draw itself as pressed, so it sets a flag and calls
gdk_window_invalidate_region()
[it actually calls gtk_widget_queue_redraw(), but the effect
of that is to call gdk_window_invalidate_region() ], which results
in an expose event being generated next time GTK+ goes idle.
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]