Quantcast

Jump to content


Photo

Python GUI programming


  • Please log in to reply
27 replies to this topic

#26 Analog

Analog
  • 13 posts

Posted 27 June 2010 - 12:59 AM

Indeed, that was the problem :p. Congrats! Your first GUI program :D.


Feels quite glorious, seeing as this is not as common-sense oriented as the .NET suite.
A last question, I've been searching, but do you have a link that could show me some common tricks with the interface widgets? Such as using an entry field to obtain user-input and output that to a variable. I assume it's something like my_var = entry1.text, but am unsure of the exact syntax and how to even make it a declared widget like the button. Just need a very simplified guide to set me on my way now that I can get the GUI to function. :))

#27 Hydrogen

Hydrogen
  • Neocodex Co-Founder

  • 22213 posts


Users Awards

Posted 27 June 2010 - 11:58 AM

I'd check out the PyGTK reference: http://library.gnome.../pygtk/stable/. You can also check out the PyGObject reference: http://library.gnome...object/stable/.

These are not tutorials though... definitely go through the tutorials I linked above. As for getting the text from a textbox, here's some sample code:
b.get_object("textbox").get_buffer().set_text('Testing this thing')


#28 Analog

Analog
  • 13 posts

Posted 27 June 2010 - 12:21 PM

I'd check out the PyGTK reference: http://library.gnome.../pygtk/stable/. You can also check out the PyGObject reference: http://library.gnome...object/stable/.

These are not tutorials though... definitely go through the tutorials I linked above. As for getting the text from a textbox, here's some sample code:

b.get_object("textbox").get_buffer().set_text('Testing this thing')


That seems to set the textbox to a certain value, not returning the text in the box as a printable string. The links are very helpful, but do not explain the parts I have the most trouble with, getting the syntax of how to declare that the widgets exist, and since I declare in my init and the button def is out of that, I keep getting errors that entry1 is not declared. This seems to be a very strange way of coding. :p


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users