How to get started in GUI Programming?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jay.dow@gmail.com

    #16
    Re: How to get started in GUI Programming?

    did you search GUI in this group? I think the results will be helpful.
    some other GUI packages you might of missed are wxPython and pygame

    Comment

    • BartlebyScrivener

      #17
      Re: How to get started in GUI Programming?


      peter.mosley@ta lk21.com wrote:[color=blue]
      > I am trying to learn GUI programming in Python, but have to confess I
      > am finding it difficult.
      >
      > I am not an experienced programmer - just someone who from time to
      > time writes small programs for my use. Over the years I have moved
      > from GWBASIC to QBASIC to Visual Basic, and now trying to move across
      > to a Linux platform. Python seems to be the best compromise between
      > the limitations of command line basic programming and the total
      > incomprehensibi lity of C.
      >
      > Googling around it seems the best GUI is either Tkinter or PyGtk. I
      > found a book which recommended PyGtk, as it had a graphical design
      > option, Glade. Coming from a VB background I latched onto that and
      > bought the book (Beginning Python, Wrox), but it was a disappointment
      > (or more accurately a complete waste of money) - there was
      > insufficient detail in the text.
      >
      > I've found the tutorial and reference manual on the PyGtk web site,
      > but although I've made some progress, I keep reaching points where I
      > have insufficient background to understand them. Currently I'm stuck
      > on dialog boxes (the code seems immensely complex for the equivalent of
      > MsgBox("Do you really want to do this ",vbYesNo) and I haven't
      > got it to work properly yet) and loading graphical images in anything
      > other than their original size, but every new step brings another
      > struggle
      >
      > I've seen reference to a Tkinter book - something like 'Python
      > and Tkinter Programming' but it seems to be out of print and
      > unavailable.
      >
      > Can anyone offer any suggestions as to the least painful way forwards?
      >
      > (Email address was valid once but has long since been abandoned to
      > spam. Please rely via newsgroup)[/color]

      I responded twice to this but it didn't post. Weird. Anyway, search for
      PythonCard and wxPython in this group. And then, for more options,
      check this page:



      bs

      Comment

      • jmdeschamps@gmail.com

        #18
        Re: How to get started in GUI Programming?

        It all really depends on what you wish to achieve. Results are
        generally in proportion to the effort involved.
        I don't think a "Python for Nulls" exists !
        the following thread deals with documentation for beginners (and others
        as well)


        For Tkinter the basic document is Fredrik Lundh's 'Introduction to
        Tkinter' (you can google to easily find this)
        and also one from New Mexico Tech at


        If you're intent on doing image manipulation, I would advise that you
        consider the Python Imaging Library (known as PIL).

        Pain is a very personal concept - what can be a painful endeavor for
        some might be a enticing challenge for another ;-)

        Good luck.

        Comment

        • gsteff

          #19
          Re: How to get started in GUI Programming?

          I learned pygtk via the tutorial and reference manual, and found most
          things to be pleasantly simple to do. A message dialog, for example,
          can be done via

          dialog = gtk.MessageDial og(buttons=gtk. BUTTONS_OK_CANC EL,
          message_format= "Test message here.")
          response = dialog.run()

          All that can be found by looking up the MessageDialog class in the
          reference manual, noticing that there's not much there, and looking
          and the documentation for its parent "Dialog" class. That may be one
          source of confusion you may have experiened while reading the reference
          manual.

          In general, I've found pygtk to be remarkably pythonic (for an
          interface to a library that has been ported to many other languages as
          well). For example, when using tree views, you can access the tree
          model underlying it using the normal python list syntax, which I think
          is very cool. If you have other examples of things that are confusing,
          post them (here, or to the pygtk list).

          Greg

          Comment

          • Luis M. Gonzalez

            #20
            Re: How to get started in GUI Programming?

            IMHO, the easier alternative for building GUI apps with Python is
            PythonCard.
            It is based on wxWindows, and it lets you build gui apps by dragging
            and dropping widgets on a form, just like VB or Delphi. It is very high
            level and very easy to learn and use.

            python, programming, hypercard, gui, development


            Another alternative, also based in wxWindows, is Boa Constructor, but I
            wouldn't recomend it over Pythoncard.

            Good luck!
            Luis

            Comment

            • Godwin Burby

              #21
              Re: How to get started in GUI Programming?

              Try http://boa-constructor.sourceforge.net/

              Comment

              • Jonathan Gardner

                #22
                Re: How to get started in GUI Programming?

                I would argue with your assertion that either TKinter of PyGTK are the
                best. There are several other good alternatives, including wxPython and
                PyQt, which are very comparable, if not better.

                I would strongly suggest starting with PyQt. It's my personal favorite.
                I wrote a short tutorial on the Python Wiki.



                I find that the Qt API is a lot simpler than the alternatives. Plus, it
                has great documentation.

                Comment

                • Rembrant

                  #23
                  Re: How to get started in GUI Programming?

                  ok i'm begginer in programing but i found some online books so you'll
                  probably find in them what you need! Just send me a mail and i'll reply
                  with the address! hope this can be helpfull...

                  Comment

                  • Luis M. Gonzalez

                    #24
                    Re: How to get started in GUI Programming?

                    Try PythonCard (http://pythoncard.sf.net).
                    Like VB or Delphi (drag and drop widgets), but much simpler, easy and
                    fun.
                    It's based on wxWidgets, and it gives your apps a native look, no
                    matter your platform (much nicer than Tkinter, which looks uglier and
                    dated).

                    Comment

                    • Claudio Grondi

                      #25
                      Re: How to get started in GUI Programming?


                      <peter.mosley@t alk21.com> schrieb im Newsbeitrag
                      news:1132927360 .270239.64670@f 14g2000cwb.goog legroups.com...[color=blue]
                      > I am trying to learn GUI programming in Python, but have to confess I
                      > am finding it difficult.
                      >
                      > I am not an experienced programmer - just someone who from time to
                      > time writes small programs for my use. Over the years I have moved
                      > from GWBASIC to QBASIC to Visual Basic, and now trying to move across
                      > to a Linux platform. Python seems to be the best compromise between
                      > the limitations of command line basic programming and the total
                      > incomprehensibi lity of C.
                      >
                      > Googling around it seems the best GUI is either Tkinter or PyGtk. I
                      > found a book which recommended PyGtk, as it had a graphical design
                      > option, Glade. Coming from a VB background I latched onto that and
                      > bought the book (Beginning Python, Wrox), but it was a disappointment
                      > (or more accurately a complete waste of money) - there was
                      > insufficient detail in the text.
                      >
                      > I've found the tutorial and reference manual on the PyGtk web site,
                      > but although I've made some progress, I keep reaching points where I
                      > have insufficient background to understand them. Currently I'm stuck
                      > on dialog boxes (the code seems immensely complex for the equivalent of
                      > MsgBox("Do you really want to do this ",vbYesNo) and I haven't
                      > got it to work properly yet) and loading graphical images in anything
                      > other than their original size, but every new step brings another
                      > struggle
                      >
                      > I've seen reference to a Tkinter book - something like 'Python
                      > and Tkinter Programming' but it seems to be out of print and
                      > unavailable.
                      >
                      > Can anyone offer any suggestions as to the least painful way forwards?
                      >[/color]

                      From what you write I conclude, that it is maybe a very good idea to stay
                      with Visual Basic and use it to create the appropriate ActiveX components
                      you need in Python and then register them to use it from Python. This way
                      you can 'marry' what you have already created in Visual Basic easily with
                      Python.
                      From what I currently know, there is no 100% cross-platform solution for GUI
                      related tasks, because each platform has own specifics which usually are
                      very interesting for use in own programming and that kills as a consequence
                      the cross-platform usage.

                      # For example a Yes/No/Abort dialog box can be achieved using the WSHOM.OCX
                      available in Windows as follows:

                      import win32com.client
                      axWshShell = win32com.client .Dispatch("WScr ipt.Shell") # WSHOM.OCX

                      axWshShell_Popu p_Icon_Critical = 16
                      axWshShell_Popu p_Button_AbortR etryIgnore = 2
                      axWshShell_Popu p_NoAutoclose = 0

                      intRetVal = axWshShell.Popu p(
                      ### Raise a message box:
                      " The Popup() Text" + "\n" +
                      "",
                      axWshShell_Popu p_NoAutoclose,
                      " The Popup() Title:",
                      axWshShell_Popu p_Icon_Critical + axWshShell_Popu p_Button_AbortR etryIgnore
                      )

                      axWshShell_Popu p_Clicked_Abort = 3 # [Abort] button
                      axWshShell_Popu p_Clicked_Retry = 4 # [Retry] button
                      axWshShell_Popu p_Clicked_Ignor e = 5 # [Ignore] button

                      if(intRetVal == axWshShell_Popu p_Clicked_Abort ):
                      print 'Abort clicked, return value = %i'%(intRetVal, )

                      if(intRetVal == axWshShell_Popu p_Clicked_Retry ):
                      print 'Retry clicked, return value = %i'%(intRetVal, )

                      if(intRetVal == axWshShell_Popu p_Clicked_Ignor e):
                      print 'Ignore clicked, return value = %i'%(intRetVal, )

                      Hope this is what are you looking for, isn't it?

                      Claudio


                      Comment

                      • Kay Schluehr

                        #26
                        Re: How to get started in GUI Programming?


                        peter.mosley@ta lk21.com wrote:[color=blue]
                        > I am trying to learn GUI programming in Python, but have to confess I
                        > am finding it difficult.[/color]

                        Don't do it if you can prevent it.

                        GUI - toolkits are very complex beasts and at least to me a source of
                        pain far more as a joy. Python cannot help you making them
                        significantly simpler but on the contrary add just another level of
                        indirection. Python normally shines when you have to glue libraries
                        together or programming simply Python scripts for a broad range of
                        purposes but if the wrapped library publishes a huge interface with
                        hundreds of classes and thousands of methods and attributes the benfit
                        of Pythons abstraction converges to zero. Python does not offer a good
                        toolchain to take up with Swing, WinForms or Qt to name just a few
                        delivered with IDEs that are very helpfull in developing GUI apps. Not
                        to talk about documentation.. .

                        Conclusion: if you are already familiar with BASIC I would just
                        continue writing BASIC apps using VisualBasic dotNet, Windows Forms as
                        the underlying GUI toolktit and VisualStudio as IDE. Forget the
                        coolness factor of the language. Cool people never care a lot what
                        other people think. If you finally want to glue assemblys/controls
                        together in Python this is still possible with IronPython or
                        Python-dotNet ( which is a CPython binding to the CLR, available at
                        Zope.org ).

                        Comment

                        • paron

                          #27
                          Re: How to get started in GUI Programming?

                          I think the best route is through the browser. Good cross-platform, has
                          a reasonable toolkit, and it's familiar for users.

                          You could look at TurboGears.

                          Comment

                          • UrsusMaximus@gmail.com

                            #28
                            Re: How to get started in GUI Programming?

                            I agree with Paron, using HTML forms and such as a minimal GUI front
                            end meant to be run in a browser is often a good way to go.

                            But I just want to mention, again, Stephen Ferg's "Easygui" at
                            http://www.ferg.org/easygui/index.html which is a very easy way to go
                            for desktop GUI's. You know, I just had a thought: I wonder if Easygui
                            could be used on handhelds like Pocket PC's, Zaurus, Palm etc? If it
                            could just be imported as a module it might be an awfully simple way to
                            create GUI's for handhelds.


                            Ron Stephens


                            Comment

                            • forodejazz@gmail.com

                              #29
                              Re: How to get started in GUI Programming?

                              Have you tried Gambas?


                              It's a VB-like tool.
                              But the programming language is not Pyhton :-(

                              Comment

                              • peter.mosley@talk21.com

                                #30
                                Re: How to get started in GUI Programming?

                                A big thank you to all who responded. There are too many to reply
                                individually, but to summarise ...

                                Thomas Güttler gave a link to an example program, editMetadata.py
                                which uses yes no dialogs and scaled images. I've not yet tried to
                                learn from this, but looking at the code it seems to provide exactly
                                what I am looking for. It uses the gtkMessageDialo g class, which I
                                hadn't come across (the tutorial doesn't seem to mention it?)

                                Others recommended wxPython, PyQt and various derivatives. The trouble
                                is there's too much choice! But my experience is that under Linux
                                nothing ever works out of the box, and so I am reluctant to invite more
                                grief by installing fresh packages until I am sure those already
                                installed are not adequate.

                                Easygui had some supporters. I had already come across this, and while
                                I agree it is a delightfully simple tool to use, and ideal for i/o
                                operations, it is not sufficiently flexible for my needs.

                                One development is that my local public library has, to my surprise,
                                managed to locate a copy of 'Python and Tkinter Programming' by J.
                                Grayson. I've not read it yet, and an initial flick through
                                doesn't look too promising but maybe I am mistaken.. I acknowledge
                                that Tkinter is a bit dated, and may not have a native 'look and
                                feel', but for me this would be outweighed by an accessible textbook.

                                So currently the choice is between continuing with PyGtk, using the
                                editMetadata.py code as a model, or Tkinter using Grayson's book.
                                I'll try both and see which is more successful.

                                Once again thank you to all who responded.

                                Comment

                                Working...