Re: Labels In Radio Buttons
- From: "darren adams" <scottish-lad freeuk com>
- To: "Ian Frawley" <ifrawley opaltelecom co uk>
- Cc: <gtk-app-devel-list gnome org>
- Subject: Re: Labels In Radio Buttons
- Date: Fri, 19 Oct 2001 12:27:44 +0100
Hello,
I've been inspired by the GTK+ tutorial (specifically,
http://www.gtk.org/tutorial/ch-widgetoverview.html#SEC-CASTING), and I think
I have an answer.
I think that because a GtkRadioButton is a descendant of GtkButton, you can
use casting to retrieve the label. This is better served in an example, so
have a look at the last line of this code example
Rather than:
GtkWidget *radio_button;
gchar *radio_button_label_text;
...
radio_button = gtk_radio_button_new_with_label(NULL, "This is my text");
/* This doesn't work: no label member in GtkRadioButton */
radio_button_label_text = GTK_TOGGLE_BUTTON(radio_button)->label;
/* This might work: there's a label member in GtkButton */
radio_button_label_text = GTK_BUTTON(radio_button)->label;
There's are a couple of guys in the office upstairs from mine that have
Linux installed, so I'll be hassling them to give this a try on their
machines at some point. Failing that, I'll find a solution when I get home
and away from these Windows machines, godammit! :-)
Good luck,
- darren
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]