PDA

View Full Version : WYSIWYG designer for GUI toolkits



Volt9000
May 30th, 2009, 03:29 AM
I'm writing an application in Python with a GUI. I haven't decided on a GUI toolkit yet, but perhaps the answer to this question will help my decision:

Are there any GUI toolkits for which WYSIWYG visual editors exist? I mean kind of like how Visual Studio has its nice drag-and-drop form designer. I would much prefer to use one so I can quickly design a GUI without having to worry about hand-coding coordinates.

crdlb
May 30th, 2009, 03:47 AM
All the major contenders have a GUI designer: for gtk+ you can use glade, for Qt I believe it's called QtDesigner, and wx has something called wxGlade. (I've heard wxGlade is the weakest of the three)

Note that you shouldn't be positioning widgets by coordinates anyway, instead you should use boxes, tables, etc. so that the layout can scale.

EXCiD3
May 30th, 2009, 04:04 AM
wxGlade is terrible but if you are planning anything cross-platform wx is the best choice as it will use the native toolkits it has available on the current OS. I have used it a lot for developing Keryx (http://keryxproject.org).

Glade-3 is excellent and so is QtDesigner. If you are not going cross-platform, then one of these is good choice. I prefer Glade because I'm a gnomer but QtDesigner felt to be more complete.

Just my opinions on the subject. Take it with a grain of salt. :P

Volt9000
May 30th, 2009, 04:07 AM
Thanks for your suggestions.

I like the idea of wxGlade using the platform's native widgets, but what makes it so bad?

Simian Man
May 30th, 2009, 04:20 AM
I agree with crdlb - you should *never* use absolute positioning for your GUIs. Use of gui design tools can sometimes lead to this bad practice. I think you should go with wxWidgets. Very cross-platform and has great Python bindings.

lykwydchykyn
May 30th, 2009, 04:29 AM
Check out Eric with qtdesigner 4. They seem to make a good combination.

Though honestly, I just usually end up going back to hand-coding the GUI. Just meshes with my brain better.

EXCiD3
May 30th, 2009, 04:39 AM
wxGlade just is poor at generating the python code after you drag/drop the widgets. You can design it just fine but it sets some wacky default settings which I never intended and made the interface look funky. It also does not give you access to quite a few of the extra widgets that are available. Its really best to work by coding the interface by hand IMO. You get to know the toolkit a lot better that way.

The native widget part is excellent, nothing against that, just wxGlade.

Also, to just state the idea one more time so you realize how important it is. Absolute positioning (which is what Visual Studio does) is the dumbest thing ever invented. I may take you a little while to grasp the idea of using sizers and other containers to hold your widgets and keep track of their sizing for you but it makes much more sense to do it that way instead of th way you are used to with Visual Studio. I was in the same boat as you a while back and it took me a while to understand sizing widgets in these other toolkits, but VS is the odd man out when it comes to widget sizing because it's the only one that uses absolute positioning.

Volt9000
May 30th, 2009, 04:33 PM
wxGlade just is poor at generating the python code after you drag/drop the widgets. You can design it just fine but it sets some wacky default settings which I never intended and made the interface look funky. It also does not give you access to quite a few of the extra widgets that are available. Its really best to work by coding the interface by hand IMO. You get to know the toolkit a lot better that way.

The native widget part is excellent, nothing against that, just wxGlade.

Also, to just state the idea one more time so you realize how important it is. Absolute positioning (which is what Visual Studio does) is the dumbest thing ever invented. I may take you a little while to grasp the idea of using sizers and other containers to hold your widgets and keep track of their sizing for you but it makes much more sense to do it that way instead of th way you are used to with Visual Studio. I was in the same boat as you a while back and it took me a while to understand sizing widgets in these other toolkits, but VS is the odd man out when it comes to widget sizing because it's the only one that uses absolute positioning.

Ah I see, thanks for the explanation.
I'm just used to the absolute positioning/sizing thing because of my background in Windows GUIs.

However, in this particular case, this application will (most likely) run in a fixed, unsizable window, so in this case sizers would be pointless.

Majorix
May 30th, 2009, 05:24 PM
I once coded the GUI of a small application using wxGlade, editing/adding code on the output in the Python language.

There is no Visual-Studio-alike IDE for Python.

However, if you want an alternative, and have time to learn Java, I would really suggest Netbeans. In my thoughts, it is a really good environment that may well be compared to Visual Studio on Windows.

lykwydchykyn
May 30th, 2009, 05:51 PM
Qt designer will do absolute positioning if you don't use any layout objects.

happysmileman
May 30th, 2009, 07:15 PM
Glade-3 is excellent and so is QtDesigner. If you are not going cross-platform, then one of these is good choice. I prefer Glade because I'm a gnomer but QtDesigner felt to be more complete.

Both GTK and Qt are cross-platform.
Gimp and Pidgin among others are written using GTK and are available for many platforms.
And Opera, Skype, VLC and Adobe Photoshop Album (Though not Photoshop itself) all use Qt.

EXCiD3
May 31st, 2009, 07:37 PM
They are both cross-platform of course, but they require the toolkit to be installed instead of using the native widget system, which I much prefer.