[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 at 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."
                                          
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20100924/7b5c3848/attachment.html 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]