|
Help with passing parameteres to a callback routine (newbie): msg#00169gnome.gtk+.python
Hi All I am a newbie to Python and Pygtk, so please bear with me if this is the millionth time you have been asked this. I have written my first program with Radio buttons and need to understand how do I pass AND use a a parameter by reference (list called Company), rather than by value. Is it possible? Basic aim is that the action effected in the callback routine should be reflected AFTER it returns which it does not do, the value of Company appears to stay at what I initially set it to. Thanks Peter The relevent parts of the code are as follows Callback routine def callback(win, widget, Company, data): if (widget.get_active() == True): Company.insert(0,data) Creation and connect routines Company = ['Argent',] button = GtkRadioButton(None, "Argent") button.connect("toggled", callback, button, Company, "Argent") box2.pack_start(button, TRUE, TRUE, 0) button.set_active(TRUE) button.show() button = GtkRadioButton(button, "Ashlyn") button.connect("toggled", callback, button, Company, "Ashlyn") box2.pack_start(button, TRUE, TRUE, 0) button.show() button = GtkRadioButton(button, "Clearance IT") button.connect("toggled", callback, button, Company, "Clearance IT") box2.pack_start(button, TRUE, TRUE, 0) button.show() _______________________________________________ pygtk mailing list pygtk@xxxxxxxxxx http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/ |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | example - fetching icon from gnome theme: 00169, Don Allingham |
|---|---|
| Next by Date: | Re: Help with passing parameteres to a callback routine (newbie): 00169, David M. Cook |
| Previous by Thread: | example - fetching icon from gnome themei: 00169, Don Allingham |
| Next by Thread: | Re: Help with passing parameteres to a callback routine (newbie): 00169, David M. Cook |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |