Python
  Home arrow Python arrow Organization in wxPython
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
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? 
Google.com  
PYTHON

Organization in wxPython
By: Peyton McCullough
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 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:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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


    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

    - Tuples and Other Python Object Types
    - The Dictionary Python Object Type
    - String and List Python Object Types
    - Introducing Python Object Types
    - Mobile Programming using PyS60: Advanced UI ...
    - Nested Functions in Python
    - Python Parameters, Functions and Arguments
    - Python Statements and Functions
    - Statements and Iterators in Python
    - Sequences and Sets in Python
    - Python Expressions and Operators
    - Dictionaries, Variables and Statements in Py...
    - Data Types in Python
    - The Python Language
    - SSH with Twisted





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek