PDA

View Full Version : python simple GUI making?



jimi_hendrix
July 28th, 2008, 05:42 PM
hi

so i've learned enough python to write a basic object oriented program and was looking at how to do GUI programming in it.

ive noticed that it is all text writing to make the window controls like buttons and text boxes

i was curious if there is a way to use the drag 'n drop method that is used with C# (or at least in the Microsoft IDE i use in my windows partition) or if i have to hand code it like in C++

also what GUI module thing (like wx or tkinter) would u recommend?

Kadrus
July 28th, 2008, 06:09 PM
PyGTK is good,so is WxPython(which is cross-platform),I personnaly don't like TK but you can use it.
PyGTK Tutorial (http://www.pygtk.org/pygtk2tutorial/index.html)
WxPython Tutorials
WxPython.org Tutorial (http://wxpython.org/tutorial.php)
ZetCode tutorial includes tetris game(example) (http://wiki.wxpython.org/AnotherTutorial]WxPython Linux Tutorial[/URL]
[URL="http://zetcode.com/wxpython/)
TK
Python TK Tutorial (http://www.pythonware.com/library/tkinter/introduction/)

jimi_hendrix
July 28th, 2008, 06:25 PM
ok thanks ill assume theres no simple drag n drop like in c# and PyGTK is linux only?

SidStudios
July 28th, 2008, 06:25 PM
I've actually got a quite excellent guide; it was made by one of my good friends who also joined my forums:
http://hacktalk.org/forum/showthread.php?t=83
Good luck, I think that post is rather well written and easy to understand ;)

Kadrus
July 28th, 2008, 06:27 PM
ok thanks ill assume theres no simple drag n drop like in c#?
I think there is Kdevelop for that(not sure though).Install Kdevelop from Synaptic and test it.

nvteighen
July 28th, 2008, 06:37 PM
PyGTK is the Python binding for GTK+ (The graphical toolkit used by the GNOME project), so it is cross-platform (e.g. Solaris, Mac, BSD, etc.), but don't know if it works in Windows... ;)

Anyway, GTK+ is a bit advanced.

jimi_hendrix
July 28th, 2008, 06:38 PM
ok i will when i log on over to my ubutnu partition and ill post the results of kdeveloper

Steveway
July 28th, 2008, 06:41 PM
If you use Python then you should check out Stani's Python Editor (SPE).
It even includes a graphical tool to click your own GUI together for wxpython. I think it was Boaconstructor that it uses, I'm not exactly sure.

Quikee
July 28th, 2008, 07:47 PM
PyGTK is the Python binding for GTK+ (The graphical toolkit used by the GNOME project), so it is cross-platform (e.g. Solaris, Mac, BSD, etc.), but don't know if it works in Windows... ;)


It also works in Windows.. but the look is not native (compared to WxPython).

nvteighen
July 28th, 2008, 07:54 PM
It also works in Windows.. but the look is not native (compared to WxPython).
I see, thank you!

LaRoza
July 28th, 2008, 11:22 PM
See the sticky on GUI toolkits and see my wiki. EasyGUI is the simplest (but least flexible)

jimi_hendrix
July 29th, 2008, 12:44 AM
ok thanks

imdano
July 29th, 2008, 01:49 AM
If you decide you want to use pygtk, you should check out glade (http://glade.gnome.org/), which allows you to create GTK GUIs with dragging/dropping (sort of, it's more like point and click).

jimi_hendrix
July 29th, 2008, 02:22 AM
glade looks nice...ill check all of this stuff out tomarrow and post back what i picked and why

LaRoza
July 29th, 2008, 02:34 AM
I would like to point out to everyone responding that the sticky contains a list of all the toolkits mentioned here, a link to their site, a link to their GUI designer (like glade) and more references.

Please read the sticky and contribute to the information.

days_of_ruin
July 29th, 2008, 02:34 AM
if you use glade be sure to read this great tutorial: http://www.micahcarrick.com/12-24-2007/gtk-glade-tutorial-part-1.html

slavik
July 29th, 2008, 05:30 AM
glade and libglade until gtk builder kicks in :)

dtmilano
July 29th, 2008, 12:59 PM
If you like glade approach, just take a look at autoglade (http://autoglade.sf.net), which is (I think) easier than EasyGUI and much more flexible.

billenbois
July 29th, 2008, 03:08 PM
glade and libglade until gtk builder kicks in :)

you can actually use gtk builder with glade:
juste make a project with glade-3 and convert the xml glade file.

i use it in C and its really nice (also doesnt need the extra glade lib anymore since its builtin gtk now :)


I would really recommend pygtk+gtkbuilder (via glade) as an easy and fast GUI making thing. (C+gtkbuilder via glade is equally easy, C or python is a matter of taste and speed here i guess)