GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
FAQ
Search
Memberlist
Usergroups
Register
Profile
Log in to check your private messages
Log in
Execute another program on a button click
GTK+ Forums Forum Index
->
GTK+ Programming
Author
Message
forward83
Joined: 09 Mar 2008
Posts: 2
Posted: Sun Mar 09, 2008 11:14 pm
Post subject: Execute another program on a button click
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:
(C)
1
2
3
4
5
6
7
8
void
on_button1_clicked (GtkButton *button,
gpointer
user_data)
{
//What code should be here to run another application?
//system() ?
}
Thanks.
Back to top
Zarg
Familiar Face
Joined: 09 Mar 2008
Posts: 10
Posted: Sun Mar 09, 2008 11:39 pm
Post subject:
Hello!
This should work:
Code:
(Plaintext)
1
2
3
4
5
6
7
8
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
Back to top
Display posts from previous:
All Posts
1 Day
7 Days
2 Weeks
1 Month
3 Months
6 Months
1 Year
Oldest First
Newest First
GTK+ Forums Forum Index
->
GTK+ Programming
All times are GMT
Page
1
of
1
Powered by
phpBB
© 2001, 2005 phpBB Group
CodeBB
1.0 Beta 2
Protected by
Anti-Spam ACP