# function to which I wanna pass the value as augument.
result = ''
for i in range(1, 1 + 100*x):
self.window = gtk.Window()
# the entry box to which user will enter the value.
self.entry = gtk.Entry()
self.entry.get_text() # How to pass the value of "get_text()"?
Re: How to pass the value to a function? (gtk.entry)
On 04/25/2014 07:18 AM, bakabonpapa wrote:
> Right now, I'm building a gui program using pygtk.
> And there is an entry box using "gtk.Entry" and its "get_text".
> I'v been trying to pass its parameter to a function as a parameter,
> but strugling for long hours without succsess.
Please describe what you actually want to accomplish. There is little
use in calling get_text() on a newly created gtk.Entry, since the entry
will certainly be empty.
Passing "its parameter to a function as a parameter" doesn't make much
sense, either - maybe you mean passing its return value? For example,
functionA(self.entry.get_text()). But that should likely be done when
the entry is changed or activated, again depending on what you want the
program to do.