Home arrow Python arrow Page 2 - Dialogs in wxPython

wxScrolledMessageDialog - Python

You are probably already familiar with a few dialogs that can be used in your wxPython applications. Of course, wxPython contains many more dialogs, ranging in complexity from very simple to pretty advanced and covering a variety of topics, from text selection to color selection. In this article, we'll take a look at more of wxPython's dialogs what they are for and how they are placed in an application.

TABLE OF CONTENTS:
  1. Dialogs in wxPython
  2. wxScrolledMessageDialog
  3. wxProgressDialog
  4. ImageDialog
  5. wxDirDialog
  6. wxFileDialog
By: Peyton McCullough
Rating: starstarstarstarstar / 18
August 01, 2005

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Suppose you need to display a long message, such as the terms of use for your application. A good way to display this would be to use a wxScrolledMessageDialog. It features a read-only multi-line text box, and it's very easy to put into your applications:

from wxPython.wx import *

application = wxPySimpleApp()

# Set up the text

text = """Once upon a time, there lived a knight named Sir Esthimus.

Sir Esthimus decided to marry the princess one day. So, he went to the king

and asked if he could marry his lovely daughter. The king said that he had to

defeat the strongest goblin in the kingdom's dungeons. The knight agreed to

fight the goblin, and the next day, the king summoned both the beast and the

knight to the town square. A sturdy iron fence had been erected overnight to

keep the two fighters inside. The king waved his hand -- the signal for the match

to begin. The knight pulled out his sword, and goblin pulled out his spear. The goblin

then pierced the knight's sword arm, so the knight lost the fight and did not get to marry

the princess.

Notice the scrollbar to the right. It enables you to

write

large

amounts

of

text

to

the

dialog and have it organized neatly."""

# Create the dialog

dialog = wxScrolledMessageDialog ( self, text, 'Fairy Tale' )

# Show the dialog

dialog.ShowModal()



 
 
>>> More Python Articles          >>> More By Peyton McCullough
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PYTHON ARTICLES

- Python Big Data Company Gets DARPA Funding
- Python 32 Now Available
- Final Alpha for Python 3.2 is Released
- Python 3.1: String Formatting
- Python 3.1: Strings and Quotes
- Python 3.1: Programming Basics and Strings
- 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

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: