return value from expose event / draw signal of GtkDrawingArea

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

return value from expose event / draw signal of GtkDrawingArea

Gtk+ - Apps Dev mailing list
Hi, does anyone know what meaning has the return value from expose event
handler (for gtk2) and draw signal (for gtk3) of GtkDrawingArea?

When one should return TRUE, and when FALSE?

I can't find any information in the reference manual

Thank you!
Luca
_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Reply | Threaded
Open this post in threaded view
|

Re: return value from expose event / draw signal of GtkDrawingArea

Gtk+ - Apps Dev mailing list
Hi;

On Tue, 14 Aug 2018 at 17:30, Luca Bacci via gtk-app-devel-list <
[hidden email]> wrote:

> Hi, does anyone know what meaning has the return value from expose event
> handler (for gtk2) and draw signal (for gtk3) of GtkDrawingArea?
>
> When one should return TRUE, and when FALSE?
>
> I can't find any information in the reference manual
>

The "expose-event" signal in GTK+ 2.x comes from GtkWidget:


https://developer.gnome.org/gtk2/stable/GtkWidget.html#GtkWidget-expose-event

The "draw" signal in GTK+ 3.x comes from GtkWidget:

  https://developer.gnome.org/gtk3/stable/GtkWidget.html#GtkWidget-draw

They have similar semantics as other signals in GTK+, like the
input-related ones: returning TRUE means "I handled this signal emission,
so do not propagate it further to other signal handlers"; returning FALSE
means "I did not handle this signal emission, so propagate it further to
other signal handlers".

What "handling" means it depends on what you want to achieve.

When using GTK+ 3.x, you're strongly encouraged to use the symbolic
constants "GDK_EVENT_PROPAGATE" and "GDK_EVENT_STOP", instead, as they make
the code easier to read.

Ciao,
 Emmanuele.

--
https://www.bassi.io
[@] ebassi [@gmail.com]
_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Reply | Threaded
Open this post in threaded view
|

Re: return value from expose event / draw signal of GtkDrawingArea

Gtk+ - Apps Dev mailing list
All right, I missed that!
Thank you!
Luca

2018-08-14 18:56 GMT+02:00 Emmanuele Bassi <[hidden email]>:

> Hi;
>
> On Tue, 14 Aug 2018 at 17:30, Luca Bacci via gtk-app-devel-list <
> [hidden email]> wrote:
>
>> Hi, does anyone know what meaning has the return value from expose event
>> handler (for gtk2) and draw signal (for gtk3) of GtkDrawingArea?
>>
>> When one should return TRUE, and when FALSE?
>>
>> I can't find any information in the reference manual
>>
>
> The "expose-event" signal in GTK+ 2.x comes from GtkWidget:
>
>   https://developer.gnome.org/gtk2/stable/GtkWidget.html#
> GtkWidget-expose-event
>
> The "draw" signal in GTK+ 3.x comes from GtkWidget:
>
>   https://developer.gnome.org/gtk3/stable/GtkWidget.html#GtkWidget-draw
>
> They have similar semantics as other signals in GTK+, like the
> input-related ones: returning TRUE means "I handled this signal emission,
> so do not propagate it further to other signal handlers"; returning FALSE
> means "I did not handle this signal emission, so propagate it further to
> other signal handlers".
>
> What "handling" means it depends on what you want to achieve.
>
> When using GTK+ 3.x, you're strongly encouraged to use the symbolic
> constants "GDK_EVENT_PROPAGATE" and "GDK_EVENT_STOP", instead, as they make
> the code easier to read.
>
> Ciao,
>  Emmanuele.
>
> --
> https://www.bassi.io
> [@] ebassi [@gmail.com]
>
_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list