Re: radio button label
- From: Jeff Shipman <shippy cs nmt edu>
- To: "Dugas, Alan" <alan dugas analog com>, gtk-list gtk org
- Subject: Re: radio button label
- Date: Thu, 19 Oct 2000 15:49:54 -0600
Using the following code, I was able to get it to work.
How do you have the 'label' variable defined? Do you
have it defined as GTK_BIN(radiobutton)->child?
Anyway, here's the code I added to the radiobutton example
in the GTK tutorial to get it to work:
-- BEGIN --
gchar *label;
gtk_label_get(GTK_LABEL(GTK_BIN(button)->child), &label);
printf("label = %s\n", label);
-- END --
Is it also possible that when you try to print out the
label or use it, you're using label instead of *label
(because you're defining it as a gchar **). Oh yeah, and
if I set *label to NULL initially it still works, but
setting **label to NULL causes it to segfault.
Hope that helps!
Dugas, Alan wrote:
It segfaulted when I tried that :-( Does anyone know if that approach works
(i.e. successfully used it)? It would help determine if it's my code or
not. I do the following;
gchar **radio_button_label = (gchar **) NULL;
gtk_label_get(GTK_LABEL(label), radio_button_label);
so I would expect GTK_LABEL() to produce an error if label were not pointing
to a gtklabel. Does anyone know if GTK_LABEL() would execute before
gtk_label_get()?
-- Stupid Genius
> ----------
> From: Jeff Shipman[SMTP:shippy cs nmt edu]
> Sent: Thursday, October 19, 2000 5:12 PM
> To: gtk-list gtk org
> Subject: Re: radio button label
>
> Well, GtkRadioButton is derived from GtkBin and I know you can
> get the label widget from a button using GTK_BIN(button)->child,
> so perhaps you could use the same method to grab the label from
> a GtkRadioButton?
>
> Dugas, Alan wrote:
>
> > How do you get a label from a gtkradiobutton?
> >
> >
> >
> > -- Stupid Genius
> >
> > _______________________________________________
> > gtk-list mailing list
> > gtk-list gnome org
> > http://mail.gnome.org/mailman/listinfo/gtk-list
>
>
> --
> Jeff "Shippy" Shipman E-Mail: shippy cs nmt edu
> CS Major / EE Minor ICQ: 1786493
> New Mexico Institute of Mining and Technology
> Homepage: http://www.nmt.edu/~shippy
>
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>
_______________________________________________
gtk-list mailing list
gtk-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-list
--
Jeff "Shippy" Shipman E-Mail: shippy cs nmt edu
CS Major / EE Minor ICQ: 1786493
New Mexico Institute of Mining and Technology
Homepage: http://www.nmt.edu/~shippy
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]