A more elegant way to get labels from buttons???




I've probably managed to miss the pertinent data in testgtk.c or wherever, but 
I need to extract the character string from the label on a button in a 
callback.  What I've come up with (that works) is the following assignment:

void AlphaButtonCallback (GtkWidget *widget, gpointer data) {
   char *str = GTK_LABEL(GTK_BUTTON(widget)->child)->label;

but I dislike depending on knowledge of the internals of a data structure.  Is 
there an equivalent function call that I've missed?

RTFM's which list manual greatly appreciated.  Direct answers/comments 
appreciated.

TIA
   rickf

-- 
Rick Forrister                 <Richard.Forrister@jpl.nasa.gov>

Opera: Greek word meaning "death by music".
		--Anonymous




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