Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'languages,': 0.03; 'own.': 0.03; 'python.': 0.04; '(python': 0.05; 'subject:Python': 0.06; 'c++,': 0.07; 'framework.': 0.07; 'happily': 0.07; 'mess': 0.07; 'python': 0.08; '(general': 0.09; 'canvas': 0.09; 'counting': 0.09; 'etc...': 0.09; 'frameworks.': 0.09; 'garbage': 0.09; 'c++': 0.12; 'gui': 0.13; 'wrote:': 0.15; 'library': 0.15; 'bindings': 0.16; 'from:addr:awilliam': 0.16; 'from:addr:whitemice.org': 0.16; 'from:name:adam tauno williams': 0.16; 'gil.': 0.16; 'gobject': 0.16; 'hierarchy': 0.16; 'java.': 0.16; 'jython).': 0.16; 'message-id:@linux-yu4c.site': 0.16; 'received:72.14.190': 0.16; 'received:72.14.190.87': 0.16; 'received:mail.wmmi.net': 0.16; 'received:wmmi.net': 0.16; 'reply-to:addr:awilliam': 0.16; 'reply- to:addr:whitemice.org': 0.16; 'subject:GUI': 0.16; 'threading': 0.16; 'why.': 0.16; 'written': 0.17; 'seems': 0.20; 'memory': 0.21; 'extension': 0.22; 'loop': 0.22; 'maybe': 0.22; 'header:In- Reply-To:1': 0.22; 'stuff': 0.22; 'builds': 0.23; 'happen.': 0.23; 'referring': 0.23; 'smart': 0.23; 'tue,': 0.23; 'code': 0.24; 'ago': 0.25; 'received:72.14': 0.26; 'up.': 0.26; 'objects': 0.28; 'sorry,': 0.29; 'toolkit': 0.30; 'widget': 0.30; 'version': 0.30; 'developers': 0.32; 'references': 0.32; 'does': 0.32; 'it.': 0.33; 'reference': 0.33; "i've": 0.33; 'to:addr:python-list': 0.34; 'etc.)': 0.34; 'things': 0.34; 'be,': 0.35; 'ownership': 0.35; 'pretty': 0.35; 'idea': 0.36; 'questions.': 0.36; 'thread': 0.37; 'model': 0.37; 'but': 0.37; 'subject:: ': 0.38; 'think': 0.38; 'else': 0.38; 'went': 0.39; 'processing': 0.39; 'header:Mime- Version:1': 0.39; 'subject:with': 0.39; 'event': 0.39; 'to:addr:python.org': 0.39; 'might': 0.39; 'needed.': 0.40; 'registration': 0.40; 'sense': 0.40; "i'd": 0.40; 'your': 0.60; 'die': 0.61; 'projects': 0.62; 'released': 0.62; 'apps': 0.63; 'designed': 0.63; 'perfect': 0.63; 'alive': 0.67; 'header:Reply- To:1': 0.71; 'reply-to:no real name:2**0': 0.72; 'binding.': 0.84; 'management:': 0.84; 'momentum': 0.84; 'interest,': 0.91; 'lean': 0.91; 'swing': 0.91 Subject: Re: I am fed up with Python GUI toolkits... From: Adam Tauno Williams To: python-list@python.org Date: Wed, 20 Jul 2011 07:04:25 -0400 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.0.2 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: awilliam@whitemice.org List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 75 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1311160054 news.xs4all.nl 23934 [2001:888:2000:d::a6]:48078 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9958 On Tue, 2011-07-19 at 19:12 -0700, sturlamolden wrote: > What is wrong with them > 1. Designed for other languages, particularly C++, tcl and Java. > 2. Bloatware. Qt and wxWidgets are C++ application frameworks. (Python > has a standard library!) I've no idea what this means. I happily use pygtk. As for "application frameworks" maybe you are referring to their having their own event-loop, etc... They don't have any choice. A UI toolkit has to have an event-loop and related pluming. Gtk builds on top of glib; which has its own event-loop etc... This makes perfect sense to me. > 3. Unpythonic memory management: Python references to deleted C++ > objects (PyQt). Manual dialog destruction (wxPython). Parent-child > ownership might be smart in C++, but in Python we have a garbage > collector. Widget registration / hierarchy != memory management. > 4. They might look bad (Tkinter, Swing with Jython). Sorry, I think Gtk apps are very nice looking. > 5. All projects to write a Python GUI toolkit die before they are > finished. (General lack of interest, bindings for Qt or wxWidgets > bloatware are mature, momentum for web development etc.) PyGTK just released version 3 with GObject introspection. etk.docking went beta a few months ago [a pygtk docking solution]. All seems pretty alive to me. And the developers respond to questions. > How I would prefer the GUI library to be, if based on "native" > widgets > 1. Lean and mean -- do nothing but GUI. No database API, networking > API, threading API, etc. Sounds like PyGtk to me. All that other stuff and you are on your own. Although I'd like to have data-model binding. > 2. Do as much processing in Python as possible. No more native code > (C, C++, Cython) than needed. Unreasonable. > 3. Instances of extension types can clean themselves up on > deallocation. No parent-child ownership model to mess things up. No > manual clean-up. Python does all the reference counting we need. NEVER GOING TO HAPPEN. UI's don't work that way. They are inherently hierarchical. Just get over it. > 4. No artist framework. Use OpenGL, Cairo, AGG or whatever else is > suitable Gtk supports multiple canvas modes. > 5. No particular GUI thread synchronization is needed -- Python has a > GIL. Wrong. > 6. Expose the event loop to Python. It is. > 8. Written for Python in Python -- not bindings for a C++ or tcl > toolkit. Why. Pointless. That is just re-implementation.