PDA

View Full Version : [PyGtk] GtkEntry, how to use?



dodle
September 28th, 2008, 11:58 AM
I've been trying to build a basic calculator to practice programming in python. I'm using Glade as well. My problem (at the moment) is that I have only figured out how to use text in a GtkEntry.
# When button 1 pressed
gtk.entry.insert_text("1")For a calculator I need to use a digit don't I? Can I do this with a GtkEntry, or is there a different widget that I need to use?

meastp
September 28th, 2008, 06:23 PM
Look here:
http://www.pygtk.org/docs/pygtk/class-gtkentry.html

Of course you can use it as input for a calculator. Then you just have to convert the numbers to integers with int( '89079' ) afterwards.