Re: [glade--]Rearragement of code (dialog's widgets as members)
triendl klaus <[email protected]>
| Newsgroups | gmane.comp.gnome.glademm |
|---|---|
| Message-ID | <[email protected]> |
glademm is already able to do this task - just set a widget in glade to protected or even public. but what would be great is if glademm would allow creating normal members - not only pointers. what do you think? -- triendl klaus ----- Original von: Mark Jones <[email protected]>: > I have thought about this before, but now I'll ask what others think. The way glademm currently writes code, all of your widgets for a dialog are limited in scope to the myDialog_glade constructor. To do anything with your dialog becomes a task of rearranging where widgets are at in scope. Usually this (at least so far for me) means inside the myDialog_glade constructor, changing this: Gtk::RadioButton *myRB = manage(new class Gtk::RadioButton(_RadioBGroup_myRB, "_One Radio Button", true)); To: myRB = manage(new class Gtk::RadioButton(_RadioBGroup_myRB, "_One Radio Button", true)); Of course, you first have to make "Gtk::RadioButton *myRB" a class member before doing the above. By doing this you will have access to it in your derived class (myDialog), and can work with it in your signal handling functions (maybe on your OK button on your dialog, you want the signal handler to read parts of the dialog, maybe some text fields or something like that). How many others are doing it this way? If there is a lot, perhaps glademm should start declaring widgets in a dialog as class members, and then inside the _glade constructor for the dialog, just assign to them (as shown above) rather than declaring them and therefore limiting their scope only to the constructor. Is there a much simpler way to work with the current code format that I am just not seeing? -- Mark Jones <[email protected]> _______________________________________________ glademm-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/glademm-list ------------------------------------------- Versendet durch AonWebmail (www.jet2mail.at)