Re: [gtk-list] How to invoke Xclient?



Hello,

   When you hook to the activate call, it will send 2 parameters to your
callback function. If you take a look at the system() man page, you will
see:	 int system (const char * string);  So, try doing this:

gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
   GTK_SIGNAL_FUNC(execCB), (gpointer) "kterm &");


void execCB(GtkWidget *widget, gpointer data) {
   /* You should check the return value from system */
   system((char *) data);
}

You should also read the man page for system also, as there are several
problems when using it.

Brian Masney


On Fri, 18 Dec 1998, Chowdhury Takdir Hossain wrote:

> 
> Hello
> 
> I am trying to launch a Xclient program from the menu item of my program but
> failing. The statement has the following shape.
> 
> gtk_signal_connect(GTK_OBJECT(menuitem),"activate",(GtkSignalFunc)system,(gpointer)"kterm &");
> 
> It can be compiled. But when I select the item and release it I get a message
> on my terminal saying that "sh::command not found"
> 
> Is there any way in gtk+ to launch a Xclient program? Am I missing something
> in my code? 
> 
> Could anyone please help me in this regard.
> 
> Regards,
> 
> --Takdir
> 
> -- 
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
> 



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