On Fri, 2006-11-24 at 10:26 +0800, sunzysjzri wrote:
> >sunzy writes:
> > > how to run a new application in a button's callback function??
> >
> >system() ?
> >
> >--tml
> >
> would you like to write it clearly? 
> e.g.
> my button callback function:
> void leftbutton_clicked(GtkWidget *widget, gpointer my_data)
> {
> }
> and I want run "/usr/games/same-gnome" for example, how to do it?

This is done the same way as spawning any process from another program.
How you do it is highly dependent on the operating system.  Fortunately
there are routines in glib that should help you:

http://developer.gnome.org/doc/API/2.0/glib/glib-Spawning-Processes.html

This is probably the most portable mechanism for running processes.

> 
> thank you 
> 
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to