Re: radio button label



I'm not Darin or Jeff, but hopefully can help....

gtk_label_get() wants to store the beginning of
the string (i.e. a pointer to the first character of the
text in the label) in a variable you give it.  Your old
code told it to store this information at memory location
NULL (a sure segfault), while the new code says to
store the information in your radio_button_label variable.

It is a char ** because you are giving it the address of (i.e.
a pointer to) a (local) char * variable.....

Did I explain that well enough?  Hope so,
Donna
----- Original Message -----
From: Dugas, Alan <alan dugas analog com>
To: Darin Fisher <dfisher jagger me berkeley edu>
Cc: <gtk-list gtk org>
Sent: Thursday, October 19, 2000 4:02 PM
Subject: RE: radio button label


> BINGO!!!  Nice work Darin!  ...and thanks also to Jeff!  I don't
understand why
> the changes in Darin's code work however.  The online documentation
declares
> gtk_label_get() as follows;
>
> void gtk_label_get(GtkLabel *label, gchar **str);
>
> not
>
> void gtk_label_get(GtkLabel *label, gchar *str);
>
> Could either of you enlighten me?  Thanks in advance.
>
> > ----------
> > From: Darin Fisher[SMTP:dfisher jagger me berkeley edu]
> > Sent: Thursday, October 19, 2000 5:48 PM
> > Cc: gtk-list gtk org
> > Subject: Re: radio button label
> >
> >
> >
> >
> >
> >
> > 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);
> >
> > ^^^^^ This is the source of the seg fault.  Try this instead:
> >
> > gchar *radio_button_label = 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()?
> >
> > GTK_LABEL() does execute first.
> >
> > >
> > >
> > > -- 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
> >
> >
> > _______________________________________________
> > 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
>





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]