Python
  Home arrow Python arrow Page 4 - Organization Methods Beyond Sizers
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PYTHON

Organization Methods Beyond Sizers
By: Peyton McCullough
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 5
    2005-08-15

    Table of Contents:
  • Organization Methods Beyond Sizers
  • Using Tabs for Navigation
  • Using a List for Navigation
  • Using a Drop-Down List for Navigation
  • Boxing in Controls

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Organization Methods Beyond Sizers - Using a Drop-Down List for Navigation


    (Page 4 of 5 )

    In case you don't want to organize things with tabs or a list, you have the option of using a drop-down list to allow users to switch between virtual pages. The wxChoicebook widget makes this possible. As with the previous widget, the wxChoicebook widget is very similar to the wxNotebook widget in creation:

    from wxPython.wx import *

    # Create the main window

    class Window ( wxFrame ):

       def __init__ ( self ):

          wxFrame.__init__ ( self, None, -1, 'Frame title.' )

          # Create a wxChoicebook

          self.choicebook = wxChoicebook ( self, -1 )

          self.Show ( True )

    # Create a panel

    class Panel1 ( wxPanel ):

       def __init__ ( self, parent ):

          wxPanel.__init__ ( self, parent, -1 )

          # Put a label in the panel

          self.label = wxStaticText ( self, -1, 'This is the first panel.', pos = ( 25, 25 ) )

    # Create another panel

    class Panel2 ( wxPanel ):

       def __init__ ( self, parent ):

          wxPanel.__init__ ( self, parent, -1 )

          # Add a few buttons

          self.button1 = wxButton ( self, -1, 'This is a button.', pos = ( 5, 5 ) )

          self.button2 = wxButton ( self, -1, 'So is this.', pos = ( 30, 30 ) )

          self.button3 = wxButton ( self, -1, 'And this.', pos = ( 25, 60 ) )

    # Create yet another panel

    class Panel3 ( wxPanel ):

       def __init__ ( self, parent ):

          wxPanel.__init__ ( self, parent, -1 )

          # Add a few text boxes

          self.text1 = wxTextCtrl ( self, -1, pos = ( 5, 5 ) )

          self.text2 = wxTextCtrl ( self, -1, pos = ( 5, 50 ), style = wxTE_MULTILINE )

          self.text3 = wxTextCtrl ( self, -1, pos = ( 30, 25 ), style = wxTE_PASSWORD )

    application = wxPySimpleApp()

    frame = Window()

    # Create the panels

    instance1 = Panel1 ( frame.choicebook )

    instance2 = Panel2 ( frame.choicebook )

    instance3 = Panel3 ( frame.choicebook )

    # Add the panels

    frame.choicebook.AddPage ( instance1, 'Panel One' )

    frame.choicebook.AddPage ( instance2, 'Panel Two' )

    frame.choicebook.AddPage ( instance3, 'Panel Three' )

    application.MainLoop()

    More Python Articles
    More By Peyton McCullough


       · Hello. I wrote this article to explore more techniques of organization. In my...
     

       

    PYTHON ARTICLES

    - SSH with Twisted
    - Mobile Programming in Python using PyS60: UI...
    - Python: Count on It
    - Python Strings: Spinning Yarns
    - Python: More Fun with Strings
    - Python: Stringing You Along
    - Python Operators
    - Bluetooth Programming in Python: Network Pro...
    - Python Sets
    - Python Conditionals, Lists, Dictionaries, an...
    - Python: Input and Variables
    - Introduction to Python Programming
    - Mobile Programming in Python using PyS60: Ge...
    - Bluetooth Programming using Python
    - Finishing the PyMailGUI Client: User Help To...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway