Re: gui in fonction



I think that you need to make create_window() return a GtkWidget* instead of 
void.

The way your code is currently written the value of window passed to 
gtk_window_show() is unitialized.

Padraig


> hi
> I have a problem with fonction.
> basically, i d like to use fonction to build my gui, so here is the function I 
d like to use
> 
> void create_window(GtkWidget *window)
> 	{
> 	window=gtk_window_new (GTK_WINDOW_TOPLEVEL);
> 	gtk_widget_set_size_request(GTK_WIDGET(window),500,250);
> 	}
> 
> I call it in main() as following :
> 
> GtkWidget *window;
> create_window(window);
> gtk_widget_show(window);
> 
> 
> the problem is that my program segfault.
> No problem when I use gtk_window_new et set_size in the main().
> 
> So is it possible to build a gui in an external function ?  Where is my error 
?
> 
> Thanks in advance
> _______________________________________________
> 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]