Python
  Home arrow Python arrow Organization in wxPython
Dev Shed Forums 
Administration  
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 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
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 in wxPython
By: Peyton McCullough
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 13
    2005-06-29

    Table of Contents:
  • Organization in wxPython
  • Box Sizers
  • Box Sizers Continued
  • Grid Bag Sizers

  • 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
     
     
    The Best Selling PC Migration Utility.
     
    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 in wxPython
    (Page 1 of 4 )

    While absolute positioning of controls may work in some odd cases, absolute positioning isn't convenient or pretty. This article will explain methods that can be used to better oganize controls in your wxPython aplications.

    You probably already know how to create basic wxPython applications and position controls in them. If you don't, then this article is not for you. Take a look at A Look at wxPython.

    A Few More Controls

    Before we work on organizing controls, let's learn about a few more controls. Right not, we only know how to place buttons and text fields in our applications. It's difficult to make anything special with just these two controls, a menu and a few dialogs. First, let's take a look at a wxChoice control. It gives you a drop-down list of choices, which are taken from a Python list. Here's how you would make a basic wxChoice control:

    wxChoice ( self, -1, choices = [ 'A', 'B', 'C', 'D' ] )

    Note that I passed -1 as the control's id. This is the same as passing wxID_ANY, except, of course, that it's a bit shorter.

    It's not important that we stick it in an application to test it out immediately. We'll save that for a few minutes. Our next control, wxComboBox, combines wxTextCtrl with wxChoice. It allows the user to either select an item from the list or specify his or her own text. It works similar to wxChoice:

    wxComboBox ( self, -1, 'Default Text', choices = [ 'A', 'B', 'C', 'D' ] )

    Next up is wxListBox. This works similar to wxChoice, except it's already expanded. Again, it works similar to wxChoice:

    wxListBox ( self, -1, choices = [ 'A', 'B', 'C', 'D' ] )

    Last, but not least, comes wxStaticText. Like the name suggests, it allows you to place text in your applications.

    WxStaticText ( self, -1, 'A bit of text.' )

    More Python Articles
    More By Peyton McCullough


     

       

    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...

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




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