Re: Howto make a gtkbutton send a "changed" signal?
- From: Dov Grobgeld <dov grobgeld gmail com>
- To: Till Harbaum <lists harbaum org>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Howto make a gtkbutton send a "changed" signal?
- Date: Tue, 1 Dec 2009 11:19:46 +0200
I don't really understand what you mean with emiting a changed event. You
mean that someone is doing something like:
gtk_label_set_text(GTK_LABEL(gtk_container_get_child(GTK_CONTAINER(my_button)),
"new text")
or something simar (e.g. changing the image shown on the image)?
One way of doing it would be to do the following:
- Derive a new widget inheriting from GtkButton.
- Add a new signal "changed" to it.
- Add a new accessor function to the widget that changes the contents and
emits the new signal.
- Change the calls for changing button contents so that it uses the new
function.
- Connect to the new signal.
Regards,
Dov
You can get the effect that you want by deriving a new widget
On Tue, Dec 1, 2009 at 10:59, Till Harbaum <lists harbaum org> wrote:
Hi,
i am changing the UI of an existing app for mobile usage in a way that i
replace
some gtkentry's with some gtkbuttons which the use some alternate input
method.
I want to keep as much of the application as it is and one of the things
the app expects
is that this particular widget emits a "changed" event whenever its
contents changes.
So i'd like to enable my gtkbutton to emit a "changed" event, but i don't
find any examples
on how to achieve that. How do i "attach" a new signal to an existing
widget type?
Thanks,
Till
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]