1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2018 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. module:: wx.lib.stattext
.. currentmodule:: wx.lib.stattext
.. highlight:: python
.. _wx.lib.stattext:
==========================================================================================================================================
|phoenix_title| **wx.lib.stattext**
==========================================================================================================================================
:class:`GenStaticText` is a generic implementation of :class:`wx.StaticText`.
Description
===========
:class:`GenStaticText` is a generic implementation of :class:`wx.StaticText`.
Some of the platforms supported by wxPython (most notably GTK), do not
consider :class:`wx.StaticText` as a separate widget; instead, the label is
just drawn directly on its parent window. This essentially bars the use of
almost all mouse events (such as detection of mouse motions, mouse clicks and
so on) on that widget.
Moreover, these platforms do not allow the developer to change the widget's
background colour.
Using :class:`GenStaticText` will overcome all the problems described above,
as it is a generic widget and a real window on its own.
Usage
=====
Sample usage::
import wx
import wx.lib.stattext as ST
app = wx.App(0)
frame = wx.Frame(None, -1, "wx.lib.stattext Test")
panel = wx.Panel(frame)
st1 = ST.GenStaticText(panel, -1, "This is an example of static text", (20, 10))
st2 = ST.GenStaticText(panel, -1, "Is this yellow?", (20, 70), (120, -1))
st2.SetBackgroundColour('Yellow')
ST.GenStaticText(panel, -1, "align center", (160, 70), (120, -1), wx.ALIGN_CENTER)
ST.GenStaticText(panel, -1, "align right", (300, 70), (120, -1), wx.ALIGN_RIGHT)
frame.Show()
app.MainLoop()
|class_summary| Classes Summary
===============================
================================================================================ ================================================================================
:ref:`~wx.lib.stattext.GenStaticText` :class:`GenStaticText` is a generic implementation of :class:`wx.StaticText`.
================================================================================ ================================================================================
|
.. toctree::
:maxdepth: 1
:hidden:
wx.lib.stattext.GenStaticText
|