wxPython : getting started

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

    wxPython : getting started

    Hi !

    I've looked all over (internet, books, etc.) and I haven't found a very
    good ressource to get started with wxPython (yes, I've been through
    their tutorial).

    What I would basically like to do for starters is to be able to define
    the main panel being displayed. For example :
    1. wxFrame contains a wxPanel (call it mainPanel).
    2. mainPanel contains another panel (childPanelA)
    3. another panel has been defined (childPanelB) but is not displayed
    (the user can only see childPanelA inside mainPanel)
    4. by clicking on a menu entry (for example), the displayed panel is now
    childPanelA (which is inside mainPanel)

    So how do I do this ? I realize it's a very basic question, but it's
    been driving me mad...

    Also, is there any good open source wxPython program that I could study ?

    Thanks for any help...
  • Colin J. Williams

    #2
    Re: wxPython : getting started

    David Sulc wrote:[color=blue]
    > Hi !
    >
    > I've looked all over (internet, books, etc.) and I haven't found a very
    > good ressource to get started with wxPython (yes, I've been through
    > their tutorial).
    >
    > What I would basically like to do for starters is to be able to define
    > the main panel being displayed. For example :
    > 1. wxFrame contains a wxPanel (call it mainPanel).
    > 2. mainPanel contains another panel (childPanelA)
    > 3. another panel has been defined (childPanelB) but is not displayed
    > (the user can only see childPanelA inside mainPanel)
    > 4. by clicking on a menu entry (for example), the displayed panel is now
    > childPanelA (which is inside mainPanel)
    >
    > So how do I do this ? I realize it's a very basic question, but it's
    > been driving me mad...
    >
    > Also, is there any good open source wxPython program that I could study ?
    >
    > Thanks for any help...[/color]
    David,

    I'm dodging your question but you might find this soon to be released
    book helpful:
    wxPython in Action is a complete guide to the wxPython toolkit, containing a tutorial for getting started, a guide to best practices, and a reference to wxPython's extensive widget set. After an easy introduction to wxPython concepts and programming practices, the book takes an in-depth tour of when and how to use the bountiful collection of widgets offered by wxPython. All features are illustrated with useful code examples and reference tables are included for handy lookup of an object's properties, methods, and events. The book enables developers to learn wxPython quickly and remains a valuable resource for future work.


    Also Boa Constructor is a helpful tool.

    Colin W.

    Comment

    • Tony Nelson

      #3
      Re: wxPython : getting started

      In article <438c8dc4$1@epf lnews.epfl.ch>,
      David Sulc <davidsulc@oley res.ch> wrote:
      [color=blue]
      > Hi !
      >
      > I've looked all over (internet, books, etc.) and I haven't found a very
      > good ressource to get started with wxPython (yes, I've been through
      > their tutorial).
      >
      > What I would basically like to do for starters is to be able to define
      > the main panel being displayed. For example :
      > 1. wxFrame contains a wxPanel (call it mainPanel).
      > 2. mainPanel contains another panel (childPanelA)
      > 3. another panel has been defined (childPanelB) but is not displayed
      > (the user can only see childPanelA inside mainPanel)
      > 4. by clicking on a menu entry (for example), the displayed panel is now
      > childPanelA (which is inside mainPanel)
      >
      > So how do I do this ? I realize it's a very basic question, but it's
      > been driving me mad...[/color]
      ...

      I don't know or use wxWidgets, and I've just learned GTK, but I think
      one good answer is the same as with GTK: use a wxNotebook. You may be
      able to hide the tabs, or you may just decide they're a good thing to
      have.

      To do what you asked, see the wxWindow method Show(), which you would
      call for each or A and B etc. in response to the command.
      _______________ _______________ _______________ _______________ ____________
      TonyN.:' *firstname*nlsn ews@georgea*las tname*.com
      ' <http://www.georgeanels on.com/>

      Comment

      • hrh1818

        #4
        Re: wxPython : getting started

        One possible source of help is the book "Python Programming on Win 32".
        It has a 20 page introducrtion on using wxPython.

        Howard


        David Sulc wrote:[color=blue]
        > Hi !
        >
        > I've looked all over (internet, books, etc.) and I haven't found a very
        > good ressource to get started with wxPython (yes, I've been through
        > their tutorial).
        >
        > What I would basically like to do for starters is to be able to define
        > the main panel being displayed. For example :
        > 1. wxFrame contains a wxPanel (call it mainPanel).
        > 2. mainPanel contains another panel (childPanelA)
        > 3. another panel has been defined (childPanelB) but is not displayed
        > (the user can only see childPanelA inside mainPanel)
        > 4. by clicking on a menu entry (for example), the displayed panel is now
        > childPanelA (which is inside mainPanel)
        >
        > So how do I do this ? I realize it's a very basic question, but it's
        > been driving me mad...
        >
        > Also, is there any good open source wxPython program that I could study ?
        >
        > Thanks for any help...[/color]

        Comment

        • Peter Milliken

          #5
          Re: wxPython : getting started

          The book that Colin points out looks good - but not available until Jan
          2006. When it comes out I might buy it - just out of curiosity :-)

          Personally I "bounced" when I attempted to learn wxPython - I found it much
          easier to learn and use Tkinter combined with Pmw.

          I really tried on the wxPython as well - it wasn't just a 1/2hr exercise :-)
          I must have spent between 4 - 6 weeks attempting to get my head around it
          before giving up. The Pmw/TkInter combination was much easier to get up and
          going with. Pmw is incredibly powerful once you get the ghist of its core
          i.e. the MegaWidget, MegaArchetype etc.

          Having said that, I still have my printer utility (Win32) written using
          wxPython - I never could work out how to get that working with Pmw/TkInter.
          I just used sockets to transfer the text to be printed between the wxPython
          print utility and my TkInter/Pmw based application :-)

          Peter

          "David Sulc" <davidsulc@oley res.ch> wrote in message
          news:438c8dc4$1 @epflnews.epfl. ch...[color=blue]
          > Hi !
          >
          > I've looked all over (internet, books, etc.) and I haven't found a very
          > good ressource to get started with wxPython (yes, I've been through
          > their tutorial).
          >
          > What I would basically like to do for starters is to be able to define
          > the main panel being displayed. For example :
          > 1. wxFrame contains a wxPanel (call it mainPanel).
          > 2. mainPanel contains another panel (childPanelA)
          > 3. another panel has been defined (childPanelB) but is not displayed
          > (the user can only see childPanelA inside mainPanel)
          > 4. by clicking on a menu entry (for example), the displayed panel is now
          > childPanelA (which is inside mainPanel)
          >
          > So how do I do this ? I realize it's a very basic question, but it's
          > been driving me mad...
          >
          > Also, is there any good open source wxPython program that I could study ?
          >
          > Thanks for any help...[/color]


          Comment

          • Magnus Lycka

            #6
            Re: wxPython : getting started

            hrh1818 wrote:[color=blue]
            > One possible source of help is the book "Python Programming on Win 32".
            > It has a 20 page introducrtion on using wxPython.[/color]

            I think that's pretty much out of date though, unless there is a
            2nd edition that I missed. I can't say that I remember that chapter,
            but wxPython changed quite a bit since that book was written. It's
            still a good book though!

            Comment

            • Magnus Lycka

              #7
              Re: wxPython : getting started

              Peter Milliken wrote:[color=blue]
              > Personally I "bounced" when I attempted to learn wxPython - I found it much
              > easier to learn and use Tkinter combined with Pmw.[/color]

              It's my impression that Pmw isn't really maintained. AFAIK, the last
              release (as well as the last CVS commit) is more than two years old.

              Comment

              • Peter Milliken

                #8
                Re: wxPython : getting started

                Magnus,

                Not sure what gave you that idea - there is a Pmw mailing list and very,
                very occasionally email activity on it - I believe the product is
                maintained, it is most likely considered "complete" in and of itself.
                Certainly if there is some object that is not present in the collection then
                you can easily create one to your specifications/requirements using the
                MegaWidget and MegaArchetype base classes.

                Even elements that are not in the Pmw collection - such as elements found in
                the BLT are catered for with the Pmw - BLT interface and the "A Users Guide
                to Pmw.Blt".

                Perhaps the authors should create a new "release" every 6 months or so just
                so people don't get this (mistaken) impression - I am just not sure what
                they should put into each new "release" :-)

                Regards,
                Peter


                "Magnus Lycka" <lycka@carmen.s e> wrote in message
                news:dn1u6t$usv $1@wake.carmen. se...[color=blue]
                > Peter Milliken wrote:[color=green]
                > > Personally I "bounced" when I attempted to learn wxPython - I found it[/color][/color]
                much[color=blue][color=green]
                > > easier to learn and use Tkinter combined with Pmw.[/color]
                >
                > It's my impression that Pmw isn't really maintained. AFAIK, the last
                > release (as well as the last CVS commit) is more than two years old.[/color]


                Comment

                • Fredrik Lundh

                  #9
                  Re: wxPython : getting started

                  Peter Milliken wrote:
                  [color=blue]
                  > Perhaps the authors should create a new "release" every 6 months or so just
                  > so people don't get this (mistaken) impression - I am just not sure what they
                  > should put into each new "release" :-)[/color]

                  just bump the version number slightly, and add a "tested with <latest
                  minor python release>" to the README file.

                  </F>



                  Comment

                  • Steve Holden

                    #10
                    Re: wxPython : getting started

                    David Sulc wrote:[color=blue]
                    > Hi !
                    >
                    > I've looked all over (internet, books, etc.) and I haven't found a very
                    > good ressource to get started with wxPython (yes, I've been through
                    > their tutorial).
                    >
                    > What I would basically like to do for starters is to be able to define
                    > the main panel being displayed. For example :
                    > 1. wxFrame contains a wxPanel (call it mainPanel).
                    > 2. mainPanel contains another panel (childPanelA)
                    > 3. another panel has been defined (childPanelB) but is not displayed
                    > (the user can only see childPanelA inside mainPanel)
                    > 4. by clicking on a menu entry (for example), the displayed panel is now
                    > childPanelA (which is inside mainPanel)
                    >
                    > So how do I do this ? I realize it's a very basic question, but it's
                    > been driving me mad...
                    >
                    > Also, is there any good open source wxPython program that I could study ?
                    >
                    > Thanks for any help...[/color]

                    Without wishing to hijack this thread, I have just been encouraged by
                    the PyCon organisers to publicise one of the tutorials I'll be giving
                    the day before PyCon proper starts. Yes, it's a programmer's
                    introduction to wxPython. See:




                    regards
                    Steve
                    --
                    Steve Holden +44 150 684 7255 +1 800 494 3119
                    Holden Web LLC www.holdenweb.com
                    PyCon TX 2006 www.python.org/pycon/

                    Comment

                    Working...