Getting values from Multiple Text Entry using Pygtk and Python
On a click of a button named "Add Textbox" it calls a function which creates a single textbox using (gtk.Entry) function. So each time i click that button it creates a textbox.
I have a submit button which should fetches all the values of the text boxes(say 10 textboxes) generated with the name of "entry". It works for one textbox but not for multiple. In php we can create dynamix textboxes mentioning as an array name=entry[]. Do we have similar functionality in pyth开发者_JAVA百科on ?Enviroment : FC10 , Glade 3 , Python 2.5 , GTK.
You could be a bit clearer, it's not obvious what you do with your GtkEntry after creating it. The easiest thing would be to just add it to a Python list, so you can iterate over all created GtkEntry widgets later.
Or, you could "tag" the widgets with something to make them identifiable, and iterate over the containing widgets (assuming you really do add the widget to a window or something).
精彩评论