Re: How to get or set the text of a textfield?



On Mon, 2011-07-11 at 03:44 +0000, John Gordon wrote:
In <mailman.877.1310350451.1164.python-list@xxxxxxxxxx> Anthony Papillion <papillion@xxxxxxxxx> writes:
So I've built a UI with Glade and have loaded it using the standard
Python code. In my UI, I have a textfield called txtUsername. How do I
get and set the text in this field from my Python code?

field.get_text()
field.set_text(value)

<http://pygtk.org/docs/pygtk/class-gtkentry.html#method-gtkentry--set-text>

and it will print a list of methods that are defined by that object.
Hopefully one of them will be called something helpful like set_text()
or set_property(). Once you know the method name, you might try a Google
search to determine the exact usage and arguments.

-1 -1 -1 Do not "google" [search the Internet] for solutions to pyGtk
problems. That is just a confusing waste of time. Use the *excellent*
and well-linked documentation:

<http://pygtk.org/docs/pygtk/>
<http://faq.pygtk.org/index.py?req=index>

The FAQ is extensive and really does cover a lot of the common
questions. Also there is a list specifically for pygtk questions:

<http://www.daa.com.au/mailman/listinfo/pygtk>

Google, or Bing, or even DuckDuckGo, are *not* your friends. They are
enormous and inefficient time-sinks. They are a *BAD* way to solve
problems. Use the documentation.

.



Relevant Pages

  • Re: how to stop google from messing Python code
    ... > i'm using groups-beta.google.com to post python code. ... > Is there a way to stop google from messing with my format? ... don't use google to post -- there is no real excuse for doing so. ...
    (comp.lang.python)
  • Re: Google and Python
    ... Also, at Google I'm specifically "Uber Tech Lead, Production ... to various software projects that are part of our "deep infrastructure", ... and our general philosophy there is "Python where we can, ... About what is the ratio of Python code to C++ ...
    (comp.lang.python)
  • Re: how to stop google from messing Python code
    ... > Is there a way to stop google from messing with my format? ... > have eaten the spaces in my python code. ...
    (comp.lang.python)
  • Re: Secure Python
    ... Python code, simply by loading it in a module with a modified version of ... code running from there shouldn't be able to do evil things. ... google for "sandbox" ...
    (comp.lang.python)