GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Oct 25, 2014 5:38 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: [GTK 2.x] Passing variables between functions?
PostPosted: Sat Jun 28, 2014 7:21 pm 
Offline

Joined: Sat Jun 28, 2014 1:19 pm
Posts: 1
I have a button call a function and create a variable like this:

Code:
void selectmod(GtkWidget *downloadbutton, GtkComboBox *modlist, gchar *data){
    gchar *mod = gtk_combo_box_get_active_text(modlist);
    printf("\n%s", mod);
}


How can I pass the *mod variable to another function that will be called by another button?


Top
 Profile  
 
 Post subject: Re: [GTK 2.x] Passing variables between functions?
PostPosted: Thu Jul 03, 2014 10:45 pm 
Offline
Familiar Face

Joined: Thu Aug 20, 2009 1:54 pm
Posts: 42
Location: Belgium
When writing a GTK+ application in C, developers generally write GObject classes, see this guide.

With a GObject class, you can put attributes in the Private struct, like you do with other object-oriented languages.


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: Yahoo [Bot] and 1 guest


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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group