Question about GTK+ and global variables
Hi people, I have a user interface with several text entries (though the data entered will be numeric) and a button. When that button is pressed, I need to get all the data that the user has entered and perform calculations with it. Obviously, if I decare those pointers in main(), they'll be local to that function and I won't be able to use them in my button's callback function. The only way I can see to get round this is to declare those pointers with global scope and then do the calculations and stuff in the callback function. Is that the only way to do what I need, or is there a better way?
Thanks.
|