RAD with Python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David M. Cook

    #16
    Re: RAD with Python

    In article <87znh89ufv.fsf @pobox.com>, John J. Lee wrote:
    [color=blue]
    > You can certainly get good-looking Windows GUIs out of GTk
    > (eg. http://www.workrave.org/), but people complain that it's hard to
    > do (in fact, people frequently complain that GTk is in general
    > difficult to work with when compared with the other popular toolkits
    > -- partly due to the lack of documentation).[/color]

    Aside from win32 issues, (which don't really worry me all that much at the
    end of the day, YMMV) I'd say the *only* major problem with Gtk is
    incomplete documentation. Otherwise it is an excellent, rationally designed
    toolkit. It's reasonably lightweight, very responsive, has an excellent set
    of controls, and is easy to bind to other languages. It's my preferred
    toolkit. However, it is a UI TOOLKIT, not an app framework, and if you're
    expecting an app framework you are likely to be disappointed.

    There are app frameworks built on top of gtk like kiwi (still using gtk1,
    but they're working on a gtk2 port.)


    [color=blue]
    > I've never seen anybody give a convincing reason why GTk is a good
    > choice for *anything* except writing GNOME apps.[/color]

    Change GNOME to unix and I'd agree. One can write very good Gtk apps
    without ever touching the GNOME libraries.

    Dave Cook

    Comment

    • David M. Cook

      #17
      Re: RAD with Python

      In article <17d520f6.03091 30704.7944c876@ posting.google. com>, Ubaidullah
      Nubar wrote:
      [color=blue]
      > Don't they all (PyGTK, wxPython, etc.) use the underlying GUIs (e.g.
      > Windows API/KDE/Gnome, etc.)? So where does the better looking part
      > come from? Or do some of them recreate the whole GUI layer?[/color]

      Gtk does not use the native win32 controls. There's a theme that apparently
      does use the native controls, but I've heard that it's slow. So it's not
      the toolkit to choose right now if native look and feel is an overriding
      concern.
      [color=blue]
      > Reading some other threads on this ng, there are posts that mention
      > that gtk has issues running under Win32. Are these concerns still
      > valid or have they been resolved with the latest version?[/color]

      The latest version fixes some bugs, but the win32 port is still not very
      mature, and does not have as large a community of testers as the unix
      version.

      Dave Cook

      Comment

      • JanC

        #18
        Re: RAD with Python

        ubaidullahnubar @hotmail.com (Ubaidullah Nubar) schreef:
        [color=blue]
        > Don't they all (PyGTK, wxPython, etc.) use the underlying GUIs (e.g.
        > Windows API/KDE/Gnome, etc.)? So where does the better looking part
        > come from? Or do some of them recreate the whole GUI layer?[/color]

        On X (*nix/Linux) there isn't something like "the underlying GUI", and
        there are several concurrent GUI toolkits (Tk, GTK/Gnome & Qt/KDE are
        probably the best known). There exist Tk, GTK & Qt ports to Windows, but
        they indeed (re)create all or most GUI elements (just like they do on X).

        wxWindows is a cross-platform layer that can use a native GUI (and does so
        by default). So, on Win32 it uses & looks like the Win32 GUI, on Linux it
        uses GTK, on MacOS X it uses the standard Mac interface, etc.


        (Recent versions of) GTK and Qt can emulate (or even use?) the Windows GUI,
        but I'm told this is slow compared to using the native GUI or wxWindows.

        --
        JanC

        "Be strict when sending and tolerant when receiving."
        RFC 1958 - Architectural Principles of the Internet - section 3.9

        Comment

        • Jamey Cribbs

          #19
          Re: RAD with Python

          Ubaidullah Nubar wrote:[color=blue]
          >
          > Don't they all (PyGTK, wxPython, etc.) use the underlying GUIs (e.g.
          > Windows API/KDE/Gnome, etc.)? So where does the better looking part
          > come from? Or do some of them recreate the whole GUI layer?
          >[/color]
          I'm pretty sure GTK draws it's own widgets and does not use the
          underlying Windows API.
          [color=blue]
          > Reading some other threads on this ng, there are posts that mention
          > that gtk has issues running under Win32. Are these concerns still
          > valid or have they been resolved with the latest version?[/color]

          Although none of my pygtk apps have been super-complex, I have had
          little to no problems running them under Windows. They perform well.
          Getting them to look good is usually a matter of choosing a good looking
          theme engine (I use the bluecurve engine under windows) and tweaking
          your Gtk rc file (for example, picking Tahoma 8pt as the font).

          Comment

          • Steve Lamb

            #20
            Re: RAD with Python

            On 2003-09-13, John J. Lee <jjl@pobox.co m> wrote:[color=blue]
            > I've never seen anybody give a convincing reason why GTk is a good
            > choice for *anything* except writing GNOME apps.[/color]

            I run several GTK apps that don't touch Gnome:
            Sylpheed-Claws
            Pan
            XChat

            GTK != GNOME.

            --
            Steve C. Lamb | I'm your priest, I'm your shrink, I'm your
            PGP Key: 8B6E99C5 | main connection to the switchboard of souls.
            -------------------------------+---------------------------------------------

            Comment

            • Steve Lamb

              #21
              Re: RAD with Python

              On 2003-09-14, David M. Cook <davecook@nowhe re.net> wrote:[color=blue]
              > Gtk does not use the native win32 controls. There's a theme that apparently
              > does use the native controls, but I've heard that it's slow. So it's not
              > the toolkit to choose right now if native look and feel is an overriding
              > concern.[/color]

              However wxWindows (and by extension wxPython) does use Windows
              native on Windows and GTK Unix.

              --
              Steve C. Lamb | I'm your priest, I'm your shrink, I'm your
              PGP Key: 8B6E99C5 | main connection to the switchboard of souls.
              -------------------------------+---------------------------------------------

              Comment

              • John J. Lee

                #22
                Re: RAD with Python

                "David M. Cook" <davecook@nowhe re.net> writes:
                [color=blue]
                > In article <87znh89ufv.fsf @pobox.com>, John J. Lee wrote:
                >[color=green]
                > > You can certainly get good-looking Windows GUIs out of GTk
                > > (eg. http://www.workrave.org/), but people complain that it's hard to
                > > do (in fact, people frequently complain that GTk is in general
                > > difficult to work with when compared with the other popular toolkits
                > > -- partly due to the lack of documentation).[/color]
                >
                > Aside from win32 issues, (which don't really worry me all that much at the
                > end of the day, YMMV) I'd say the *only* major problem with Gtk is
                > incomplete documentation. Otherwise it is an excellent, rationally designed
                > toolkit. It's reasonably lightweight, very responsive, has an excellent set
                > of controls, and is easy to bind to other languages. It's my preferred
                > toolkit. However, it is a UI TOOLKIT, not an app framework, and if you're
                > expecting an app framework you are likely to be disappointed.[/color]

                Not sure what design features you're referring to by "framework" .
                Perhaps Qt's signal/slot system? I think that works particularly well
                as an integrated part of the GUI system, although it's certainly
                possible to graft something very similar on top of GTk (as Bernhard
                Herzog did in sketch; kiwi looks broader and heavier, at a glance).
                None of that seems inappropriate in a GUI toolkit (not referring to
                kiwi here, just Herzog's publisher/subscriber stuff). What does seem
                like bloat to a Python user are Qt's XML, SQL and threading libraries
                -- at least you don't have to import them or know about them.

                [color=blue]
                > There are app frameworks built on top of gtk like kiwi (still using gtk1,
                > but they're working on a gtk2 port.)
                >
                > http://www.async.com.br/projects/kiwi/
                >[color=green]
                > > I've never seen anybody give a convincing reason why GTk is a good
                > > choice for *anything* except writing GNOME apps.[/color]
                >
                > Change GNOME to unix and I'd agree. One can write very good Gtk apps
                > without ever touching the GNOME libraries.[/color]

                It's not whether it can be done, it's how painful it is. There seems
                to be a constant procession of people who have trouble using GTk, but
                not for wx. I certainly had trouble with GTk, just due to lack of
                docs. If you already know GTk, I guess, that's not a problem. And
                maybe I'll discover more reasons for using GTk when I try wx...


                John

                Comment

                • John J. Lee

                  #23
                  Re: RAD with Python

                  "David M. Cook" <davecook@nowhe re.net> writes:
                  [color=blue]
                  > In article <17d520f6.03091 30704.7944c876@ posting.google. com>, Ubaidullah
                  > Nubar wrote:
                  >[color=green]
                  > > Don't they all (PyGTK, wxPython, etc.) use the underlying GUIs (e.g.
                  > > Windows API/KDE/Gnome, etc.)? So where does the better looking part
                  > > come from? Or do some of them recreate the whole GUI layer?[/color]
                  >
                  > Gtk does not use the native win32 controls. There's a theme that apparently[/color]

                  I guess this is because X toolkits work at a lower level than the
                  win32 windowing API?

                  Having looked at some of the Xfree code and documentation, I'm glad
                  that I know next to nothing about X.


                  John

                  Comment

                  • John J. Lee

                    #24
                    Re: RAD with Python

                    JanC <usenet_spam@ja nc.invalid> writes:
                    [color=blue]
                    > ubaidullahnubar @hotmail.com (Ubaidullah Nubar) schreef:
                    >[color=green]
                    > > Don't they all (PyGTK, wxPython, etc.) use the underlying GUIs (e.g.
                    > > Windows API/KDE/Gnome, etc.)? So where does the better looking part
                    > > come from? Or do some of them recreate the whole GUI layer?[/color]
                    >
                    > On X (*nix/Linux) there isn't something like "the underlying GUI", and
                    > there are several concurrent GUI toolkits (Tk, GTK/Gnome & Qt/KDE are
                    > probably the best known). There exist Tk, GTK & Qt ports to Windows, but
                    > they indeed (re)create all or most GUI elements (just like they do on X).
                    >
                    > wxWindows is a cross-platform layer that can use a native GUI (and does so
                    > by default). So, on Win32 it uses & looks like the Win32 GUI, on Linux it
                    > uses GTK, on MacOS X it uses the standard Mac interface, etc.[/color]

                    Well, I suppose I really don't know whether or not Qt uses, say, the
                    native Windows tree control. In the end, that's the point of
                    interest: both Qt and wx were designed from the ground up to be
                    cross-platform (unlike Tk -- I presume -- and certainly unlike GTk).
                    Without reading the source code, you'd be hard pushed to figure out
                    which things Qt reimplements, and which it reuses.

                    [color=blue]
                    > (Recent versions of) GTK and Qt can emulate (or even use?) the Windows GUI,
                    > but I'm told this is slow compared to using the native GUI or wxWindows.[/color]

                    Qt has never been slow or looked bad on Windows (or unix).


                    John

                    Comment

                    • Ted Holden

                      #25
                      Re: RAD with Python

                      John J. Lee wrote:

                      [color=blue]
                      > I've never seen anybody give a convincing reason why GTk is a good
                      > choice for *anything* except writing GNOME apps.[/color]


                      I've just been putting myself through a sort of a crash course in pygtk,
                      basically a text indexing and retrieval application which already existed
                      in several Windows and KDE versions as well as a Tcl/Tk version which
                      nobody had used in several years. The idea is to have some sort of a
                      version of the thing which integraters could work with, i.e. written mainly
                      in a scripting language, and python appears to be several levels of
                      advancement above Tcl.

                      Tk appears to be more functional at this point, nonetheless there was no way
                      to avoid having Tk code twisted and wound in and around app code in the Tcl
                      version of the thing whereas the glade/gtk version of the thing produces a
                      gui in an XML file and an absolute minimum of anything related to guis in
                      my own code. The difference between the two is about 400 lines of very
                      readable code versus about 2500 lines of code which was marginally
                      readable. I'd MUCH rather deal with pygtk, and assume anything I might
                      miss from Tk will be there in a year.

                      The LINUX community appears to have developed a sort of a magical nexus of
                      things including gcc, swig, python, pygtk, glade, and zope which, taken
                      together, amounts to a new sort of programming paradigm. The really big
                      piece of magic in the picture is swig. This says that you you can write
                      library code in c++ and call it from a python program with a gui produced
                      by glade sitting there in an XML file, and all you'd ever need to
                      distribute to customers would be the .so file which swig produced, one or
                      two .py files, and the xml file. That also says that if a customer wasn't
                      totally happy with some aspect of the interface, he could screw around with
                      it until he was.

                      I don't see an easy way to beat all of that.


                      Comment

                      • John J. Lee

                        #26
                        Re: RAD with Python

                        Steve Lamb <grey@despair.d miyu.org> writes:
                        [color=blue]
                        > On 2003-09-13, John J. Lee <jjl@pobox.co m> wrote:[color=green]
                        > > I've never seen anybody give a convincing reason why GTk is a good
                        > > choice for *anything* except writing GNOME apps.[/color]
                        >
                        > I run several GTK apps that don't touch Gnome:
                        > Sylpheed-Claws
                        > Pan
                        > XChat
                        >
                        > GTK != GNOME.[/color]
                        [...]

                        Yep: that's exactly what I don't understand! *Why* did you do that?


                        John

                        Comment

                        • John J. Lee

                          #27
                          Re: RAD with Python

                          Ted Holden <medved@fcc.net > writes:
                          [color=blue]
                          > John J. Lee wrote:
                          >
                          >[color=green]
                          > > I've never seen anybody give a convincing reason why GTk is a good
                          > > choice for *anything* except writing GNOME apps.[/color][/color]
                          [...][color=blue]
                          > in a scripting language, and python appears to be several levels of
                          > advancement above Tcl.[/color]

                          Tcl, maybe, but what about wx and Qt?

                          [color=blue]
                          > Tk appears to be more functional at this point, nonetheless there was no way
                          > to avoid having Tk code twisted and wound in and around app code in the Tcl
                          > version of the thing whereas the glade/gtk version of the thing produces a[/color]

                          (A side issue given the point below, but I certainly dispute that.
                          Even if you don't have a "GUI painter", you can separate GUI interface
                          from "business logic" implementation) .

                          [color=blue]
                          > gui in an XML file and an absolute minimum of anything related to guis in
                          > my own code. The difference between the two is about 400 lines of very
                          > readable code versus about 2500 lines of code which was marginally
                          > readable. I'd MUCH rather deal with pygtk, and assume anything I might
                          > miss from Tk will be there in a year.[/color]

                          Certainly a big reduction in code size like this is very worthwhile.
                          wx and Qt both have equivalent functionality, though, so the mere
                          existence of such a tool seems an irrelevance in comparing GTk, wx and
                          Qt.

                          [color=blue]
                          > The LINUX community appears to have developed a sort of a magical nexus of
                          > things including gcc, swig, python, pygtk, glade, and zope which, taken
                          > together, amounts to a new sort of programming paradigm. The really big[/color]

                          What does this have to do with the comparison between GTk, wx and Qt,
                          all of which are all GPLed?


                          [...][color=blue]
                          > I don't see an easy way to beat all of that.[/color]

                          Sorry for my repetitiveness, but: wx or Qt!


                          John

                          Comment

                          • Harry George

                            #28
                            Re: RAD with Python

                            jjl@pobox.com (John J. Lee) writes:
                            [color=blue]
                            > Steve Lamb <grey@despair.d miyu.org> writes:
                            >[color=green]
                            > > On 2003-09-13, John J. Lee <jjl@pobox.co m> wrote:[color=darkred]
                            > > > I've never seen anybody give a convincing reason why GTk is a good
                            > > > choice for *anything* except writing GNOME apps.[/color]
                            > >
                            > > I run several GTK apps that don't touch Gnome:
                            > > Sylpheed-Claws
                            > > Pan
                            > > XChat
                            > >
                            > > GTK != GNOME.[/color]
                            > [...]
                            >
                            > Yep: that's exactly what I don't understand! *Why* did you do that?
                            >
                            >
                            > John[/color]

                            Don't know about others, but I do it (run gtk-not-gnome apps) because
                            GTK...

                            a) Is easy to install on a variety of commercial *NIX systems, and
                            getting better on MS Win** (contrast to gnome).

                            b) Is fast loading (contrast to wx).

                            c) Is GPL on all platforms (contrast to QT/KDE).

                            d) Is rich enough/attractive enough (contrast to tcl).

                            e) Is less painful to bring up than a gnome or kde app if you happen
                            to be starting from somewhere else (e.g., fvwm2).

                            So while I run pretty much everything on my trusty Linux boxes, I tend
                            to focus on gtk for multi-platform.


                            --
                            harry.g.george@ boeing.com
                            6-6M31 Knowledge Management
                            Phone: (425) 342-5601

                            Comment

                            • Steve Lamb

                              #29
                              Re: RAD with Python

                              On 2003-09-15, John J. Lee <jjl@pobox.co m> wrote:[color=blue]
                              > Steve Lamb <grey@despair.d miyu.org> writes:[color=green]
                              >> I run several GTK apps that don't touch Gnome:
                              >> Sylpheed-Claws
                              >> Pan
                              >> XChat[/color][/color]
                              [color=blue][color=green]
                              >> GTK != GNOME.[/color]
                              > [...][/color]
                              [color=blue]
                              > Yep: that's exactly what I don't understand! *Why* did you do that?[/color]

                              What, run GTK apps that don't touch Gnome? Simple reason: Gnome
                              sucks. I run KDE. I wouldn't want to load the full gamut of gnome libs
                              but the GTK libs are ok.

                              --
                              Steve C. Lamb | I'm your priest, I'm your shrink, I'm your
                              PGP Key: 8B6E99C5 | main connection to the switchboard of souls.
                              -------------------------------+---------------------------------------------

                              Comment

                              • Peter Herndon

                                #30
                                Re: RAD with Python

                                ubaidullahnubar @hotmail.com (Ubaidullah Nubar) wrote in message news:<17d520f6. 0309130701.222d 09fe@posting.go ogle.com>...
                                [color=blue]
                                > I will appreciate some more clarification regarding the GUI framework.
                                > From the wxPython web site, it looks very good but the two tools
                                > mentioned here
                                > for easing the development of GUI apps (mojoview and kiwi) are both
                                > based on GTK.
                                >
                                > Are they fundamentally different or just a matter of style.[/color]

                                Well, pyGTK and wxPython are Python-language wrappers or bindings
                                around two separate GUI toolkits, GTK+ and wxWindows. As such, the
                                code details will wind up being different. I suspect, though I have
                                no experience with pyGTK, that differences will be mostly syntactic
                                and that overall coding thought processes will be mostly similar. Can
                                anyone else confirm/deny?[color=blue]
                                >
                                > How easy to switch from one framework to another?
                                >[/color]

                                See above answer.
                                [color=blue]
                                > Which framework supports internationaliz ation better? Do they support
                                > Right-to-left layouts?[/color]

                                I know that wxPython relies on wxWindow's internationaliz ation
                                capabilities, which seem to be centered around gettext and friends. I
                                do not see anything in the documentation that suggests support for
                                bidirectional font support. Seeing as how gettext and GTK+ are both
                                GNU apps, it should come as no surprise that GTK+ also uses gettext.
                                [color=blue]
                                > Is there any site that lists the differences/capabilities of each
                                > framework?[/color]

                                There is a comparison of wxWindows, Qt, GTK+, FOX and fltk at:
                                Free, secure and fast downloads from the largest Open Source applications and software directory - SourceForge.net

                                which provides an overview of the differences between the various
                                toolkits. I know there is a comparison on the wxPython site between
                                itself and Tk, though you can guess the conclusion from the source. I
                                don't know of any comparisons between the Python bindings for the
                                above toolkits.
                                [color=blue]
                                > Also, a comparison between Boa Constructor and Glade-2. I haven't seen
                                > either so am not sure if they are even comparable.[/color]

                                Boa-Constructor is a fully-fledged IDE that includes a code editor,
                                debugging, and a GUI designer tool. Boa is based around wxPython, and
                                also includes substantial support for development for the Zope
                                application server. Boa-Constructor is not yet fully mature, but
                                shows much promise.

                                Glade is a GUI designer only, that generates XML resource files used
                                by GTK+ to generate the GUI interface. As such, it is not directly
                                comparable with Boa. PyGTK has support for working with such resource
                                files.

                                Interestingly enough, wxGlade is a more-or-less copy of Glade, but for
                                use with wxPython rather than GTK+, and it generates "cleaner" code
                                than Boa-Constructor.
                                [color=blue][color=green][color=darkred]
                                > > > How well is Python suited for developing database based applications?[/color][/color][/color]

                                Very well suited. Python has a standard database interface module
                                available which makes it easy to connect to just about any database.
                                Typically there are multiple drivers available for any given database
                                from which to choose. Python itself is extremely easy to write, and
                                Python wrappers for many different GUI toolkits are available.
                                [color=blue][color=green][color=darkred]
                                > > > 2. There seem to be a number of GUI frameworks available? Which one is
                                > > > good for use on Windows and Linux?[/color][/color][/color]

                                I've found that wxPython works well cross-platform, and is easy to
                                use. I've heard good things about pyGTK and pyQT, but have no
                                experience with them.
                                [color=blue][color=green][color=darkred]
                                > > > 4. What types of applications are not suitable to be written in
                                > > > Python?[/color][/color][/color]

                                CPU-intensive applications -- maybe. Python is not as efficient as C,
                                so you would be better off writing the application in Python,
                                profiling it to determine the areas that make the application slower
                                than is acceptable, and rewriting those modules as C libraries and
                                calling them from Python. For what it is worth, I'm currently writing
                                an application in Python using wxPython that retrieves simple data
                                from a Sybase Adaptive Server Anywhere database over ODBC, and formats
                                the data into a report page in generated HTML. By many orders of
                                magnitude, the slowest part of the application is the connection to
                                the database -- the ODBC connection itself. The Python and wxPython
                                parts are whiz-bang fast.

                                Comment

                                Working...