Re: [gtk-list] gtk_entry



On Mon, Feb 23, 1998 at 01:11:29PM -0600, Ed Schreder wrote:
>  I'm just learning gtk and need some help. I need to pass the contents of 
> three entry boxes to a button signal callback. How would I do this?
> Is there a way to access a widget which is on another widget which is 
> on yet another widget?  such as WindowWidget->hbox->entry to access the 
> entry widget on the hbox on the window? or is this a stupid thing to wanna
> do?   
> 
> -- 
If I understand your question correctly, you could 
pass a structure containing your three entry boxes.

(untested code, of course..)
struct foo {
	GtkWidget *entry[3];
};

void button_callback( GtkWidget *widget, struct foo *data )
{
	/* do stuff */
}

void main_code()
{
	struct foo bar;
	...

	gtk_signal_connect( GTK_OBJECT(mybutton), "clicked",
		GTK_SIGNAL_FUNC(changer_callback), &bar );
	...
}

Hope this helps.

-- 
-Tim
timg@means.net | http://flow.ml.org/



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