473,729 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to choose the right GUI toolkit ?

Hi all,
I'm a recent, belated convert from Perl. I work in a physics lab and
have been using Python to automate a lot of measurement equipment
lately. It works fabulously for this purpose. Recently I've wanted to
start writing GUIs for some of my programs, for data visualization and
to make the programs easier to use for some of my co-workers.

So far I've experimented with two Python GUI toolkits: Tkinter and
PyGTK. I've had some issues with each:

* PyGTK - not very "pythonic", in my opinion. Have to use get_ and
set_ methods rather than properties. Have to write ugly things like
textview.insert (textview.get_e nd_iter(), ...) to append text to a text
buffer. No useful doc strings, which makes experimenting with new
widgets in IPython a huge pain. The toolkit feels very "heavyweigh t".
I don't want to write an XML file and an "action group" just to make a
piddly little menubar with 10 items.

I'm an avid Gnome fan, and love the professionalnes s and completeness
of GTK, but PyGTK seems frustratingly C-like compared to the
wonderfully designed high-level abstractions I've come to love in
Python!

* TkInter - Seems easy to learn, and better for quick "lightweigh t"
GUIs. I wrote a complete working instrument GUI in less than a day of
figuring things out. Not very Pythonic in terms of creating and
modifying widgets. No factory functions to quickly create menu items.
My biggest problem with Tkinter is that it is very unreliable under
Cygwin: programs freeze and slow intermittently and the tkMessageDialog
stock dialog boxes show no visible text.

So, is there another toolkit I should be looking at? Having something
that can run easily on Cygwin and native Windows is a priority so that
I can quickly move programs to new measurement computers. I like GTK a
lot and Tk is growing on me too.. are there any higher-level "wrapper"
toolkits for GTK and Tk?

Thanks for any advice!

Dan Lenski
University of Maryland

Nov 8 '06
161 5438
Dan Lenski wrote:
My apologies! I'm glad to be corrected on this. There are Cygwin
packages for Qt as well, but I have heard about enough bugs to think I
should avoid Qt. I have used enough Gtk apps that run flawlessly under
Windows to have my hopes that it works well.
You normally use PyQt/Qt on Windows without Cygwin. There are very few bugs
and lots of professional companies base their products on Qt Windows.

--
Jeremy Sanders
http://www.jeremysanders.net/
Nov 10 '06 #41
On 2006-11-10, Dennis Lee Bieber <wl*****@ix.net com.comwrote:
On Thu, 09 Nov 2006 14:44:21 -0600, Tim Chase
<py*********@t im.thechases.co mdeclaimed the following in
comp.lang.pytho n:
>A few arbitrary warts per-dictum of BDFL are fine though...it
still looks much cleaner compared to PHP & Perl ;-)
Or line continuation in REXX... Where you get such oddities as:

call xyz(a, b, c, ,
d, e, f)

That is NOT a NULL argument between c and d... The first comma
is the argument separator, the second comma is the
to-be-continued marker
Eyiyi! That's yugly.

The colon's main purpose seems to be to allow one-liners:

Easy to parse: if a < b: a += 1
Hard to parse if a < b a += 1

--
Neil Cerutti
When you're in the public eye, it's wrong to cheat on someone, unless
you're very careful. If you're normal and no one's going to know, then
do it. --Paris Hilton
Nov 10 '06 #42

NeilThe colon's main purpose seems to be to allow one-liners:

NeilEasy to parse: if a < b: a += 1
NeilHard to parse if a < b a += 1

No, as the note from Tim Peters referenced by Robert Kern pointed out
earlier in this thread, the ABC language designers found that
indentation-based block structure by itself wasn't enough to clue new users
in about the code structure. Adding the colon at the end of the
if/while/for clause helped.

Skip

Nov 10 '06 #43
On 2006-11-09, Bjoern Schliessmann
<us************ **************@ spamgourmet.com wrote:
What about

if color == red or blue or green:
return 'primary'

:)
The Inform 6* programming language supports the serial 'or' (and
'and') and looks just like that. The disadvantage is that the
usual binary logical operators must exist and are spelled
differently. (It uses C's '||' and '&&'.)

if (color == red or blue or green && color.type == additive) {
return 'primary';
}

It also supports a switch statement syntax and semantics that
would fit nicely with Python.

switch (action) {
Eat:
print "Gulp! Delicious, but poisonous.";
deadflag = 1;
Taste:
print "You nibble at one of the corners. Yum!";
Attack:
print "What did that mushroom ever to to you?";
default:
print "You can't do that to a mushroom.";
}

There's no fall-through, and there's no syntax to enable it,
either.

In Python it would hypothetically be:

switch action:
Eat:
print "Gulp! Delicious, but poisonous."
deadflag = True
Taste:
print "You nibble at one of the corners. Yum!"
Attack:
print "What did the mushroom ever to to you?"
default:
print "You can't do that to a mushroom."

I've often wanted a "Pythonic" Inform to Inform translator, so I
can leave out all the unecessary (), {} and ;.

* Inform 6 is a language for implementing text adventures, not
to be confused with the unrelated language Inform 7.

--
Neil Cerutti
Nov 10 '06 #44

NeilThe colon's main purpose seems to be to allow one-liners:

NeilEasy to parse: if a < b: a += 1
NeilHard to parse if a < b a += 1

Skip... the ABC language designers found that indentation-based block
Skipstructure by itself wasn't enough to clue new users in about the
Skipcode structure. Adding the colon at the end of the if/while/for
Skipclause helped.

One final note. Just because the colon isn't technically required in many
situations doesn't mean it's superfluous. If all language designers cared
about was ease of parsing we'd probably all be programming in assembler,
sendmail, brainfuck. Or, as the Zen of Python says: "Readabilit y counts".

Skip

P.S. I felt I just had to tie this into the thread on profanity somehow.
But notice that I didn't mention nazis or Hitler. ;-)

S
Nov 10 '06 #45
Christophe <ch************ *@free.frwrote:
( and I must admit one of the reasons I avoid wx if possible, is because
I don't use Gnome under Linux and the look and feel of wx applications
is really horrible under KDE )
If you install the QT theme for GTK it all starts to look a lot nicer

Eg debian

ii gtk2-engines-gtk-qt 0.7-1 theme engine using Qt for GTK+ 2.x

You get a control panel for GTK apps in the KDE control center also.

--
Nick Craig-Wood <ni**@craig-wood.com-- http://www.craig-wood.com/nick
Nov 10 '06 #46
On 2006-11-10, sk**@pobox.com <sk**@pobox.com wrote:
>
NeilThe colon's main purpose seems to be to allow one-liners:

NeilEasy to parse: if a < b: a += 1
NeilHard to parse if a < b a += 1

No, as the note from Tim Peters referenced by Robert Kern
pointed out earlier in this thread, the ABC language designers
found that indentation-based block structure by itself wasn't
enough to clue new users in about the code structure. Adding
the colon at the end of the if/while/for clause helped.
Thanks. I worded that lousily.

--
Neil Cerutti
The Minutemen are not tall in terms of height. --Dan Bonner
Nov 10 '06 #47

Eric Brunel wrote:
On Thu, 09 Nov 2006 22:01:51 +0100, Dan Lenski <dl*****@gmail. comwrote:
Tk 8.4 appears to use native Win32 widgets under Cygwin and native
WinXP.

It seems to depend on the widget type, and on what you call native... For
example, tk menus are definitely the native ones; tk scrollbars are the
native ones, but with the Win2k look (no XP look available yet); tk
buttons do not seem to be the native ones, as they don't act like "normal"
Windows buttons.
So, basically, Tk is actually embedding the native Win2k menus, but it
isn't actually embedding the native Win2k scrollbars... it's just
emulating their look and feel?
But it definitely doesn't use GTK widgets under Ubuntu with
Gnome desktop.

You seem to imply that GTK is "native" on Linux. It isn't, as can be seen
with the echoes of the "holy war" between Gnome and KDE that we often see
around here. As an aside, I personnally work on Linux and don't even use
any of these environments (both are too much Windows-like to my taste...).
I didn't imply that GTK widgets are "native" on Linux. I implied that
GTK widgets native under Gnome ;-) I was basing my assumption on an
earlier poster who said that Tk 8.x can use native widgets on all
supported platforms... so I assumed that under Gnome it should use GTK
widgets.
Is there a way to get it to do so?

Not yet. But tcl/tk 8.5 will include the Tile extension including new
themable widgets. See here:
http://tktable.sourceforge.net/tile/...hots/unix.html
Good to know! I'm looking forward to 8.5.

Dan

Nov 10 '06 #48
I highly recommend wxPython. It's very mature, full-featured, and
portable, and fairly easy to learn as well.
I am also a Python beginner thinking about what GUI toolkit to use, and
the availability of a free video screencast series on installing and
using wxpython at showmedo.com is making me want to go that way. I
viewed their introduction to Python resources and wished I had found it
first.

The wxpython series is at http://tinyurl.com/yggean

Vincent

Nov 10 '06 #49
Neil Cerutti wrote:
On 2006-11-09, Bjoern Schliessmann
>if color == red or blue or green:
return 'primary'

:)
The Inform 6* programming language supports the serial 'or' (and
'and') and looks just like that.
Python also supports it.
The disadvantage is that the usual binary logical operators must
exist and are spelled differently. (It uses C's '||' and '&&'.)
Do they have to be spelled differently? In Python, they don't have
to.

Regards,
Björn

--
BOFH excuse #115:

your keyboard's space bar is generating spurious keycodes.

Nov 10 '06 #50

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
10839
by: Greg Scharlemann | last post by:
I am attempting to upload a picture to a webserver and create a thumbnail from the picture uploaded. The problem comes in when I attempt to create an Image object from the File object (which is the location of the uploaded picture)...I get the following error: java.lang.NoClassDefFoundError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:130) at java.awt.Toolkit$2.run(Toolkit.java:712) at...
6
6175
by: Martin Bless | last post by:
The good news: Along with Python-2.4 comes really good news to Windows users. Yes, you now CAN build extension modules yourself using the SAME C++ compiler and linker Python is built with itself. Everything you need is available at no costs (except download hassle and installation time). Once your system is set up properly its just a matter of running 'python setup.py build'. No longer waiting for someone else to build binaries and a...
0
1660
by: Chive Software | last post by:
Chive Software are pleased to announce a new version of its Apoc PDF Toolkit, part a of its Apoc suite of products. Apoc PDF Toolkit is a high quality software component that developers can add to their applications in order to manipulate existing PDF documents and create new PDF documents. Developed using Microsoft's ..NET environment, this 100% managed code toolkit is compatible with any .NET application such as ASP.NET applications,...
2
2953
by: Ney André de Mello Zunino | last post by:
Hello. I gladly learned yesterday that Microsoft was making the Visual C++ Toolkit 2003 available for free. Today, I downloaded and installed it and went on to try building some simple applications. I quickly found out that the toolkit does not come with the multi-threaded versions of the runtime, such as the one I needed to build a bare-bone SDL sample. Does anyone know why they have chosen to not include them and if there is anything...
4
1899
by: Alex | last post by:
Hi there I'm switching from VC++ 6.0 to VC++ .NET 2003. Since there is no stand-alone version of VC++ .NET 2003 Pro, I went and purchased the Standard version, which does not have an optimizing compiler. I have been made aware of the existence of the VC++ Toolkit 2003: http://msdn.microsoft.com/visualc/vctoolkit2003/
10
2043
by: miffy900 | last post by:
Will there be a Visual C++ Toolkit 2005? I really appreciated that there was the Visual C++ 2003 Optimising Compiler distributed for free in the 2003 Toolkit. Will Microsoft continue with this toolkit? Or will it be mainly focused on the 'Express' edition of Visual C++?
6
1986
by: Rental | last post by:
I'm having the sam problem as described below with the Localization toolkit. Does anyone know if there is a solution to this problem. --->When attempting to generate resource dlls with --->LocalizationManagement.exe, I get an exception: --->Unable to generate loose file resources
2
1494
by: krishnakant Mane | last post by:
hello all. after finishing a project in record time using python we have taken up one more project. this time however, we need to do a gui based project which will run on windows xp and 2000. now My question is which gui toolkit should I choose? I had initially raised some doubt about accessibility (which is very important for me ), and with the answers and all the pointers given, I know that wxpython is quite out of question. now my...
34
3690
by: Anthony Irwin | last post by:
Hi All, I am currently trying to decide between using python or java and have a few quick questions about python that you may be able to help with. #1 Does python have something like javas .jar packages. A jar file contains all the program files and you can execute the program with java -jar program.jar I am sort of hoping python has something like this because I feel it
0
9426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9281
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9200
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2680
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2163
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.