[Tutor] Checking if a GtkEntry is empty

Anthony Papillion papillion at gmail.com
Sat Feb 25 01:17:52 CET 2012

On Fri, Feb 24, 2012 at 6:07 PM, Alan Gauld <alan.gauld at btinternet.com> wrote:
> Add a trace to see if the method ever gets called

The method is definitely getting called. If I remove the attempt to
get the widgets text and replace it with

print "btnSearch has been clicked"

The method is called and the message is printed to the console as expected.

> Where are you looking for the printout?
> How are you running it?

I'm looking for the printout on the console screen. I'm running it by
typing 'python trial.py' in the console.

> If the message I added doesn't print you need to look at how you are
> associating the method with the widget event.
> You don't show us enough code for us to tell.
> In fact you still don't show us enough to answer the original question about
> how to reference btnSearch. we would need to see where btnSearch is created.

The entire GUI is created using Glade. In Glade, I've clicked on the
button widget and then the Signals tab. I'm associating the
btnSearch's click event with the on_btnSearch.clicked method. As I
said above, the method is being called, I'm just not able to actually
get the widgets text.

Does that make it clearer?


More information about the Tutor mailing list