[Glade-users] blocking some input in entry field
Arthur Shats
ashats at hotmail.com
Fri Sep 24 15:12:58 EDT 2010
Yes, the link you sent me with the use of emit_stop_by_name does work. Thanks John.
However, I had to remove insert_text handler from Glade and added my own (from the example) manually with connect call as well.
Don't understand why adding the handler in Glade gives me run time error (there is no problems with other handlers that I added in Glade, like on_myField_activate handler). I am afraid I may be doing something wrong and it would come back to bite me later.
If anybody have an explanation on what the trace "TypeError: <lambda>() takes at most 2 arguments (4 given)" mean and how to get rid of it, please let me know.
Thanks again,
Arthur.
From: ashats at hotmail.com
To: johndelaney at gmail.com
Date: Fri, 24 Sep 2010 17:27:44 +0000
CC: glade-users at lists.ximian.com
Subject: Re: [Glade-users] blocking some input in entry field
Thanks John.
Using GtkSpinButton is not going to work for me (my field takes in IP address, not just plain numbers), but I'll try the link that you mentioned.
I am doing the code in Python and use GladeX to generate python code from Glade xml, so my _insert_handler looks like this:
def on_myField_insert_text(widget, data, wtree) :
print "in insert_text"
pass
But when I execute, I get error:
TypeError: <lambda>() takes at most 2 arguments (4 given)
Maybe GladeX has a bug and it generated the function incorrectly, so do you know what kind of arguments _insert_text should have?
Thanks.
> Date: Fri, 24 Sep 2010 17:11:43 +0100
> Subject: Re: [Glade-users] blocking some input in entry field
> From: johndelaney at gmail.com
> To: ashats at hotmail.com
> CC: glade-users at lists.ximian.com
>
> On Fri, Sep 24, 2010 at 4:01 PM, Arthur Shats <ashats at hotmail.com> wrote:
> > This works in C. How can I get this in Python? I am new to Python, so would
> > be greatfull for your help.
>
> You mean like this? Use Google :)
>
> http://www.mail-archive.com/pygtk@daa.com.au/msg03362.html
>
> The GTK+ docs recommend the use of GtkSpinButton for getting an
> integer or float from the user:
>
> "A GtkSpinButton is an ideal way to allow the user to set the value of
> some attribute. Rather than having to directly type a number into a
> GtkEntry, GtkSpinButton allows the user to click on one of two arrows
> to increment or decrement the displayed value. A value can still be
> typed in, with the bonus that it can be checked to ensure it is in a
> given range."
_______________________________________________ Glade-users maillist - Glade-users at lists.ximian.com http://lists.ximian.com/mailman/listinfo/glade-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20100924/be397a11/attachment.html
More information about the Glade-users
mailing list