GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Wed Jul 30, 2014 11:08 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Execute another program on a button click
PostPosted: Sun Mar 09, 2008 11:14 pm 
Offline

Joined: Sun Mar 09, 2008 4:40 pm
Posts: 2
Hi

I'm new to GTK+ and is trying to execute another when a button is clicked. Using Linux(new to me too :oops: ). Can it be done using C and how?

Code:
void on_button1_clicked (GtkButton *button,
gpointer user_data)

{

//What code should be here to run another application?
//system() ?
}

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 09, 2008 11:39 pm 
Offline
Familiar Face

Joined: Sun Mar 09, 2008 2:16 pm
Posts: 14
Hello!

This should work:

Code:
void on_button1_clicked (GtkButton *button,
gpointer user_data)
{
    /* Execute firefox */
    system ("firefox&");
}


You can also execute programs depending on gpointer user_data.

Have fun,
Zarg


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group