1 # Name:      LearnSizers1.py
   2 # Purpose:   A demo app to learn sizers
   3 # Author:    Jean-Michel Fauth, Switzerland
   4 # Copyright: (c) 2005 Jean-Michel Fauth
   5 # Licence:   GPL
   6 
   7 # os dev:    windows 98
   8 # py dev:    Python 2.4.1
   9 # wx dev:    wxPython 2.6.1
  10 # Revision:  27 June 2005
  11 
  12 # Contributor and minor fixes: Marcelo Barbero, Argentina
  13 # Revision: 03 August 2005
  14 
  15 # LearnSizer*.py is a small application aimed to learn the sizers and
  16 # their usage.
  17 # This application is a collection of panels. Each panel contains
  18 # a few widgets laid out with sizers. The panels are numbered
  19 # MyPanel_0 to MyPanel_n. The panel 0 is the simpliest case. The
  20 # order of the panels follows an increasing complexity in the
  21 # layout. It is warmly recommended to start with MyPanel_0.
  22 #
  23 # Do not forget:
  24 # - the wxPython doc
  25 # - the wiki page http://wiki.wxpython.org/index.cgi/UsingSizers
  26 # - dir(<instance of a sizer>) for a list of methods
  27 # - print sizer.method.__doc__
  28 #
  29 
  30 
  31 import os
  32 import sys
  33 import wx
  34 
  35 class ColWin(wx.Window):
  36     """- A wx.Window with a coloured background
  37     - pos and size == (-1, -1) since sizers are used"""
  38 
  39     def __init__(self, parent, id, BackColour):
  40         wx.Window.__init__(self, parent, id, (-1, -1), (-1, -1), wx.SIMPLE_BORDER)
  41         self.SetBackgroundColour(BackColour)
  42 
  43 
  44 class MyPanel_0(wx.Panel):
  45     """- The simpliest sizer, a ColWin
  46     - use of named arguments"""
  47 
  48     def __init__(self, parent):
  49         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
  50 
  51         wgreen = ColWin(self, wx.NewId(), wx.GREEN)
  52 
  53         b = 20
  54         vsizer1 = wx.BoxSizer(orient=wx.VERTICAL)
  55         # or
  56         # vsizer1 = wx.BoxSizer(orient=wx.HORIZONTAL)
  57         vsizer1.Add(item=wgreen, proportion=1, flag=wx.EXPAND | wx.ALL, border=b)
  58         self.SetSizer(vsizer1)
  59 
  60 
  61 class MyPanel_1(wx.Panel):
  62     """- Two ColWins, vertically"""
  63 
  64     def __init__(self, parent):
  65         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
  66 
  67         wred = ColWin(self, wx.NewId(), wx.RED)
  68         wblue = ColWin(self, wx.NewId(), wx.BLUE)
  69 
  70         b = 5
  71         vsizer1 = wx.BoxSizer(wx.VERTICAL)
  72         vsizer1.Add(wred, 1, wx.EXPAND | wx.ALL, b)
  73         vsizer1.Add(wblue, 1, wx.EXPAND | wx.ALL, b)
  74         self.SetSizer(vsizer1)
  75 
  76 
  77 class MyPanel_2(wx.Panel):
  78     """- Three ColWins, horizontally """
  79 
  80     def __init__(self, parent):
  81         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
  82 
  83         wred = ColWin(self, wx.NewId(), wx.RED)
  84         wblue = ColWin(self, wx.NewId(), wx.BLUE)
  85         wgreen = ColWin(self, wx.NewId(), wx.GREEN)
  86 
  87         b = 5
  88         hsizer1 = wx.BoxSizer(wx.HORIZONTAL)
  89         hsizer1.Add(wred, 1, wx.EXPAND | wx.ALL, b)
  90         hsizer1.Add(wblue, 1, wx.EXPAND | wx.ALL, b)
  91         hsizer1.Add(wgreen, 1, wx.EXPAND | wx.ALL, b)
  92         self.SetSizer(hsizer1)
  93 
  94 
  95 class MyPanel_3(wx.Panel):
  96     """- Three ColWins, horizontally, height ratio 1:2:3"""
  97 
  98     def __init__(self, parent):
  99         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
 100 
 101         wred = ColWin(self, wx.NewId(), wx.RED)
 102         wblue = ColWin(self, wx.NewId(), wx.BLUE)
 103         wgreen = ColWin(self, wx.NewId(), wx.GREEN)
 104 
 105         b = 5
 106         hsizer1 = wx.BoxSizer(wx.HORIZONTAL)
 107         hsizer1.Add(wred, 1, wx.EXPAND | wx.ALL, b)
 108         hsizer1.Add(wblue, 2, wx.EXPAND | wx.ALL, b)
 109         hsizer1.Add(wgreen, 3, wx.EXPAND | wx.ALL, b)
 110         self.SetSizer(hsizer1)
 111 
 112 
 113 class MyPanel_4(wx.Panel):
 114     """- Two ColWins, vertically, a fixed width of 50 pixels between
 115     the two items"""
 116 
 117     def __init__(self, parent):
 118         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
 119 
 120         wred = ColWin(self, wx.NewId(), wx.RED)
 121         wblue = ColWin(self, wx.NewId(), wx.BLUE)
 122 
 123         b = 5
 124         vsizer1 = wx.BoxSizer(wx.VERTICAL)
 125         vsizer1.Add(wred, 1, wx.EXPAND | wx.ALL, b)
 126         vsizer1.Add((-1, 50), 0,  wx.ALL, b)
 127         vsizer1.Add(wblue, 1, wx.EXPAND | wx.ALL, b)
 128         self.SetSizer(vsizer1)
 129 
 130 
 131 class MyPanel_5(wx.Panel):
 132     """- Two items: a ColWin and a Button, vertically
 133     - the Button is either left/right aligned or centered
 134     - comment / uncomment for testing the Button alignment
 135     - wx.ALIGN_LEFT is the default value"""
 136 
 137     def __init__(self, parent):
 138         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
 139 
 140         wred = ColWin(self, wx.NewId(), wx.RED)
 141         b1 = wx.Button(self, wx.NewId(), 'button1', (-1, -1), wx.DefaultSize)
 142 
 143         b = 5
 144         vsizer1 = wx.BoxSizer(wx.VERTICAL)
 145         vsizer1.Add(wred, 1, wx.EXPAND | wx.ALL, b)
 146 
 147         #~ vsizer1.Add(b1, 0, wx.ALIGN_LEFT | wx.ALL, b)
 148         #~ vsizer1.Add(b1, 0, wx.ALIGN_RIGHT | wx.ALL, b)
 149         vsizer1.Add(b1, 0, wx.ALIGN_CENTER | wx.ALL, b)
 150         self.SetSizer(vsizer1)
 151 
 152 
 153 class MyPanel_6(wx.Panel):
 154     """- Three items: a ColWin and two Buttons
 155     - the Buttons are either left/right aligned or centered"""
 156 
 157     def __init__(self, parent):
 158         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
 159 
 160         wred = ColWin(self, wx.NewId(), wx.RED)
 161         b1 = wx.Button(self, wx.NewId(), '&OK', (-1, -1), wx.DefaultSize)
 162         b2 = wx.Button(self, wx.NewId(), '&Cancel', (-1, -1), wx.DefaultSize)
 163 
 164         b = 10
 165         hsizer1 = wx.BoxSizer(wx.HORIZONTAL)
 166         hsizer1.Add(b1, 0)
 167         hsizer1.Add(b2, 0, wx.LEFT, b)
 168 
 169         b = 5
 170         vsizer1 = wx.BoxSizer(wx.VERTICAL)
 171         vsizer1.Add(wred, 1, wx.EXPAND | wx.ALL, b)
 172         vsizer1.Add(hsizer1, 0, wx.ALIGN_RIGHT | wx.ALL, b)
 173         #~ vsizer1.Add(hsizer1, 0, wx.ALIGN_CENTER | wx.ALL, b)
 174         #~ vsizer1.Add(hsizer1, 0, wx.ALIGN_LEFT | wx.ALL, b)
 175         self.SetSizer(vsizer1)
 176 
 177 
 178 class MyPanel_7(wx.Panel):
 179     """- Four items: a ColWin, two Buttons, and a StaticLine
 180     - the Buttons are either left/right aligned or centered
 181     - the height of the static line == 2, the wx.GROW flag specifies an
 182       horizontal expansion, since the StaticLine is in a vertical sizer"""
 183 
 184     def __init__(self, parent):
 185         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
 186 
 187         wred = ColWin(self, wx.NewId(), wx.RED)
 188         b1 = wx.Button(self, wx.NewId(), '&OK', (-1, -1), wx.DefaultSize)
 189         b2 = wx.Button(self, wx.NewId(), '&Cancel', (-1, -1), wx.DefaultSize)
 190         staline = wx.StaticLine(self, wx.NewId(), (-1, -1), (-1, 2), wx.LI_HORIZONTAL)
 191 
 192         b = 5
 193         hsizer1 = wx.BoxSizer(wx.HORIZONTAL)
 194         hsizer1.Add(b1, 0)
 195         hsizer1.Add(b2, 0, wx.LEFT, b)
 196 
 197         vsizer1 = wx.BoxSizer(wx.VERTICAL)
 198         vsizer1.Add(wred, 1, wx.EXPAND | wx.ALL, b)
 199         vsizer1.Add(staline, 0, wx.GROW | wx.ALL, b)
 200         vsizer1.Add(hsizer1, 0, wx.ALIGN_RIGHT | wx.ALL, b)
 201         self.SetSizer(vsizer1)
 202 
 203 
 204 class MyPanel_8(wx.Panel):
 205     """- 7 items: 2 ColWins and 5 Buttons
 206     - ColWins: one is sizable, the other not
 207     - Buttons at the right of the frame
 208     - something like a toolbar at the right"""
 209 
 210     def __init__(self, parent):
 211         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
 212 
 213         wred = ColWin(self, wx.NewId(), wx.RED)
 214         wwhite = ColWin(self, wx.NewId(), wx.WHITE)
 215 
 216         b1 = wx.Button(self, wx.NewId(), '1', (-1, -1), wx.DefaultSize)
 217         b2 = wx.Button(self, wx.NewId(), '2', (-1, -1), wx.DefaultSize)
 218         b3 = wx.Button(self, wx.NewId(), '3', (-1, -1), wx.DefaultSize)
 219         b4 = wx.Button(self, wx.NewId(), '4', (-1, -1), wx.DefaultSize)
 220         b5 = wx.Button(self, wx.NewId(), '5', (-1, -1), wx.DefaultSize)
 221 
 222         vsizer1 = wx.BoxSizer(wx.VERTICAL)
 223         b = 3
 224         vsizer1.Add(wred, 1, wx.EXPAND | wx.BOTTOM, b)
 225         vsizer1.Add(wwhite, 0, wx.EXPAND, b)
 226 
 227         vsizer2 = wx.BoxSizer(wx.VERTICAL)
 228         b = 5
 229         vsizer2.Add(b1, 0, wx.BOTTOM, b)
 230         vsizer2.Add(b2, 0, wx.BOTTOM, b)
 231         vsizer2.Add(b3, 0, wx.BOTTOM, b)
 232         vsizer2.Add(b4, 0, wx.BOTTOM, b)
 233         vsizer2.Add(b5, 0, wx.BOTTOM, b)
 234 
 235         hsizer1 = wx.BoxSizer(wx.HORIZONTAL)
 236         b = 10
 237         hsizer1.Add(vsizer1, 1, wx.EXPAND | wx.LEFT | wx.TOP | wx.BOTTOM, b)
 238         hsizer1.Add(vsizer2, 0, wx.EXPAND| wx.ALL, b)
 239 
 240         self.SetSizer(hsizer1)
 241 
 242 
 243 class MyPanel_9(wx.Panel):
 244     """- 7 items: 2 ColWins and 5 Buttons
 245     - the ColWins are sizable
 246     - the Buttons have a fixed height and a default width
 247     - something like a toolbar at the top"""
 248 
 249     def __init__(self, parent):
 250         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
 251 
 252         wred = ColWin(self, wx.NewId(), wx.RED)
 253         wwhite = ColWin(self, wx.NewId(), wx.WHITE)
 254 
 255         h = 40
 256         b1 = wx.Button(self, wx.NewId(), '1', (-1, -1), (-1, h))
 257         b2 = wx.Button(self, wx.NewId(), '2', (-1, -1), (-1, h))
 258         b3 = wx.Button(self, wx.NewId(), '3', (-1, -1), (-1, h))
 259         b4 = wx.Button(self, wx.NewId(), '4', (-1, -1), (-1, h))
 260         b5 = wx.Button(self, wx.NewId(), '5', (-1, -1), (-1, h))
 261 
 262         hsizer1 = wx.BoxSizer(wx.HORIZONTAL)
 263         hsizer1.Add(b1, 0)
 264         hsizer1.Add(b2, 0)
 265         hsizer1.Add(b3, 0)
 266         hsizer1.Add(b4, 0)
 267         hsizer1.Add(b5, 0)
 268 
 269         b = 2
 270         hsizer2 = wx.BoxSizer(wx.HORIZONTAL)
 271         hsizer2.Add(wred, 1, wx.EXPAND | wx.RIGHT, b)
 272         hsizer2.Add(wwhite, 1, wx.EXPAND | wx.LEFT, b)
 273 
 274         b = 5
 275         vsizer1 = wx.BoxSizer(wx.VERTICAL)
 276         vsizer1.Add(hsizer1, 0, wx.EXPAND, b)
 277         vsizer1.Add(hsizer2, 1, wx.ALL | wx.EXPAND, b)
 278 
 279         self.SetSizer(vsizer1)
 280 
 281 
 282 class MyPanel_10(wx.Panel):
 283     """- Three ColWins in a StaticBoxSizer, vertically"""
 284 
 285     def __init__(self, parent):
 286         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
 287 
 288         wred = ColWin(self, wx.NewId(), wx.RED)
 289         wblue = ColWin(self, wx.NewId(), wx.BLUE)
 290         wgreen = ColWin(self, wx.NewId(), wx.GREEN)
 291 
 292         b = 10  #inside the staticbox
 293         vsbsizer1 = wx.StaticBoxSizer(wx.StaticBox(self, wx.NewId(), 'StaticboxSizer with a caption'), wx.VERTICAL)
 294         vsbsizer1.Add(wred, 1, wx.EXPAND | wx.ALL, b)
 295         vsbsizer1.Add(wblue, 1, wx.EXPAND | wx.ALL, b)
 296         vsbsizer1.Add(wgreen, 1, wx.EXPAND | wx.ALL, b)
 297         self.SetSizer(vsbsizer1)
 298 
 299 
 300 class MyPanel_11(wx.Panel):
 301     """- Three ColWins in a StaticBoxSizer, vertically
 302     - the StaticBoxSizer is in a sizer to enable a border"""
 303 
 304     def __init__(self, parent):
 305         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
 306 
 307         wred = ColWin(self, wx.NewId(), wx.RED)
 308         wblue = ColWin(self, wx.NewId(), wx.BLUE)
 309         wgreen = ColWin(self, wx.NewId(), wx.GREEN)
 310 
 311         b = 10  #inside the staticbox
 312         vsbsizer1 = wx.StaticBoxSizer(wx.StaticBox(self, wx.NewId(), 'StaticboxSizer with a caption'), wx.VERTICAL)
 313         vsbsizer1.Add(wred, 1, wx.EXPAND | wx.ALL, b)
 314         vsbsizer1.Add(wblue, 1, wx.EXPAND | wx.ALL, b)
 315         vsbsizer1.Add(wgreen, 1, wx.EXPAND | wx.ALL, b)
 316 
 317         b = 20
 318         hsizer1 = wx.BoxSizer(wx.HORIZONTAL)
 319         hsizer1.Add(vsbsizer1, 1, wx.EXPAND | wx.ALL, b)
 320 
 321         self.SetSizer(hsizer1)
 322 
 323 
 324 class MyPanel_12(wx.Panel):
 325     """- 5 ColWins, vertically
 326     - ColWins 2 and 4 are in StaticBoxSizer"""
 327 
 328     def __init__(self, parent):
 329         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
 330 
 331         wred = ColWin(self, wx.NewId(), wx.RED)
 332         wblue = ColWin(self, wx.NewId(), wx.BLUE)
 333         wgreen = ColWin(self, wx.NewId(), wx.GREEN)
 334         wwhite = ColWin(self, wx.NewId(), wx.WHITE)
 335         wyellow = ColWin(self, wx.NewId(), wx.NamedColour('yellow'))
 336 
 337         b = 10
 338         vsbsizer1 = wx.StaticBoxSizer(wx.StaticBox(self, wx.NewId(), 'blue'), wx.VERTICAL)
 339         vsbsizer1.Add(wblue, 1, wx.EXPAND | wx.ALL, b)
 340 
 341         vsbsizer2 = wx.StaticBoxSizer(wx.StaticBox(self, wx.NewId(), 'white'), wx.VERTICAL)
 342         vsbsizer2.Add(wwhite, 1, wx.EXPAND | wx.ALL, b)
 343 
 344         b = 5
 345         vsizer1 = wx.BoxSizer(wx.VERTICAL)
 346         vsizer1.Add(wred, 1, wx.EXPAND | wx.ALL, b)
 347         vsizer1.Add(vsbsizer1, 1, wx.EXPAND | wx.ALL, b)
 348         vsizer1.Add(wgreen, 1, wx.EXPAND | wx.ALL, b)
 349         vsizer1.Add(vsbsizer2, 1, wx.EXPAND | wx.ALL, b)
 350         vsizer1.Add(wyellow, 1, wx.EXPAND | wx.ALL, b)
 351 
 352         self.SetSizer(vsizer1)
 353 
 354 
 355 class MyPanel_13(wx.Panel):
 356     """- 3 StaticBoxSizers with a ColWin in each
 357     - the StaticBoxSizers are arranged vertically"""
 358 
 359     def __init__(self, parent):
 360         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
 361 
 362         wred = ColWin(self, wx.NewId(), wx.NamedColour('red'))
 363         wgreen = ColWin(self, wx.NewId(), wx.NamedColour('green'))
 364         wblue = ColWin(self, wx.NewId(), wx.NamedColour('blue'))
 365 
 366         b = 10
 367         sizer1 = wx.StaticBoxSizer(wx.StaticBox(self, wx.NewId(), 'Staticbox'), wx.VERTICAL)
 368         sizer1.Add(wred, 1, wx.EXPAND | wx.ALL, b)
 369 
 370         sizer2 = wx.StaticBoxSizer(wx.StaticBox(self, wx.NewId(), 'Staticbox'), wx.VERTICAL)
 371         sizer2.Add(wgreen, 1, wx.EXPAND | wx.ALL, b)
 372 
 373         sizer4 = wx.StaticBoxSizer(wx.StaticBox(self, wx.NewId(), 'Staticbox'), wx.VERTICAL)
 374         sizer4.Add(wblue, 1, wx.EXPAND | wx.ALL, b)
 375 
 376         #tricky: the 2nd and 3rd staticbox sizer are shifted one pixel to the
 377         #left, try with b2 = 0
 378         b1, b2 = 0, -1
 379         sizer3 = wx.BoxSizer(wx.HORIZONTAL)
 380         sizer3.Add(sizer1, 1, wx.EXPAND, b1)
 381         sizer3.Add(sizer2, 1, wx.EXPAND | wx.LEFT, b2)
 382         sizer3.Add(sizer4, 1, wx.EXPAND | wx.LEFT, b2)
 383 
 384         self.SetSizer(sizer3)
 385 
 386 
 387 class MyPanel_14(wx.Panel):
 388     """- 3 ColWins, horizontally, 2 spacers with a fixed height"""
 389 
 390     def __init__(self, parent):
 391         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
 392 
 393         wred = ColWin(self, wx.NewId(), wx.RED)
 394         wblue = ColWin(self, wx.NewId(), wx.BLUE)
 395         wgreen = ColWin(self, wx.NewId(), wx.GREEN)
 396 
 397         b = 0
 398         h = 20
 399         hsizer1 = wx.BoxSizer(wx.VERTICAL)
 400         hsizer1.Add(wred, 1, wx.EXPAND | wx.ALL, b)
 401         hsizer1.Add((-1, h))
 402         hsizer1.Add(wblue, 1, wx.EXPAND | wx.ALL, b)
 403         hsizer1.Add((-1, h))
 404         hsizer1.Add(wgreen, 1, wx.EXPAND | wx.ALL, b)
 405         self.SetSizer(hsizer1)
 406 
 407 
 408 class MyPanel_15(wx.Panel):
 409     """- 4 items: a ColWin and 3 Buttons
 410     - Buttons 1 and 3 are left/right aligned, Button 2 is centered
 411     - use of spacers to set a gap between the Buttons.
 412     - better way?"""
 413 
 414     def __init__(self, parent):
 415         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
 416 
 417         wgreen = ColWin(self, wx.NewId(), wx.NamedColour('green'))
 418         b1 = wx.Button(self, wx.NewId(), 'button1', (-1, -1), wx.DefaultSize)
 419         b2 = wx.Button(self, wx.NewId(), 'button2', (-1, -1), wx.DefaultSize)
 420         b3 = wx.Button(self, wx.NewId(), 'button3', (-1, -1), wx.DefaultSize)
 421 
 422         b = 0
 423         hsizer1 = wx.BoxSizer(wx.HORIZONTAL)
 424         hsizer1.Add(b1, 0, wx.ALL, b)
 425         hsizer1.Add((-1, -1), 1)
 426         hsizer1.Add(b2, 0, wx.ALL, b)
 427         hsizer1.Add((-1, -1), 1)
 428         hsizer1.Add(b3, 0, wx.ALL, b)
 429 
 430         #tip: this does not work
 431         #~ b = 0
 432         #~ hsizer1 = wx.BoxSizer(wx.HORIZONTAL)
 433         #~ hsizer1.Add(b1, 0, wx.ALIGN_LEFT, b)
 434         #~ hsizer1.Add(b2, 0, wx.ALIGN_CENTER, b)
 435         #~ hsizer1.Add(b3, 0, wx.ALIGN_RIGHT, b)
 436 
 437         b = 5
 438         vsizer2 = wx.BoxSizer(wx.VERTICAL)
 439         vsizer2.Add(wgreen, 1, wx.EXPAND | wx.ALL, b)
 440         vsizer2.Add(hsizer1, 0, wx.EXPAND | wx.ALL, b)
 441         self.SetSizer(vsizer2)
 442 
 443 
 444 class MyPanel_16(wx.Panel):
 445     """- 4 items: a ColWin, 3 Buttons
 446     - Buttons 1 and 3 are top/bottom aligned, Button 2 is centered
 447     - use of spacers to set a gap between the Buttons
 448     - better way?"""
 449 
 450     def __init__(self, parent):
 451         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
 452 
 453         wgreen = ColWin(self, wx.NewId(), wx.NamedColour('green'))
 454         b1 = wx.Button(self, wx.NewId(), 'button1', (-1, -1), wx.DefaultSize)
 455         b2 = wx.Button(self, wx.NewId(), 'button2', (-1, -1), wx.DefaultSize)
 456         b3 = wx.Button(self, wx.NewId(), 'button3', (-1, -1), wx.DefaultSize)
 457 
 458         b = 0
 459         vsizer1 = wx.BoxSizer(wx.VERTICAL)
 460         vsizer1.Add(b1, 0, wx.ALL, b)
 461         vsizer1.Add((-1, -1), 1)
 462         vsizer1.Add(b2, 0, wx.ALL, b)
 463         vsizer1.Add((-1, -1), 1)
 464         vsizer1.Add(b3, 0, wx.ALL, b)
 465 
 466         b = 5
 467         hsizer2 = wx.BoxSizer(wx.HORIZONTAL)
 468         hsizer2.Add(vsizer1, 0, wx.EXPAND | wx.ALL, b)
 469         hsizer2.Add(wgreen, 1, wx.EXPAND | wx.ALL, b)
 470         self.SetSizer(hsizer2)
 471 
 472 
 473 class MyPanel_17(wx.Panel):
 474     """- An input box"""
 475     def __init__(self, parent):
 476         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
 477         self.parent = parent
 478 
 479         s = 'abc' + os.linesep + 'def' + os.linesep + 'ghi'
 480         statxt = wx.StaticText(self, -1, s, (-1, -1), (-1, -1))
 481         txt = wx.TextCtrl(self, wx.NewId(), 'input', (-1, -1), (-1, -1))
 482         staline = wx.StaticLine(self, -1, (-1, -1), (-1, -1), wx.LI_HORIZONTAL)
 483 
 484         b1 = wx.Button(self, wx.NewId(), "&OK", (-1, -1), wx.DefaultSize)
 485         b2 = wx.Button(self, wx.NewId(), "&Cancel", (-1, -1), wx.DefaultSize)
 486 
 487         b = 10
 488         hsizer1 = wx.BoxSizer(wx.HORIZONTAL)
 489         hsizer1.Add(b1, 0)
 490         hsizer1.Add(b2, 0, wx.LEFT, b)
 491 
 492         b = 5
 493         vsizer1 = wx.BoxSizer(wx.VERTICAL)
 494         vsizer1.Add(statxt, 0, wx.GROW | wx.ALL, b)
 495         vsizer1.Add(txt, 0, wx.GROW | wx.ALL, b)
 496         vsizer1.Add(staline, 0, wx.GROW | wx.ALL, b)
 497         vsizer1.Add(hsizer1, 0, wx.ALIGN_RIGHT | wx.ALL, b)
 498         vsizer1.SetMinSize((300, -1))
 499         self.SetSizerAndFit(vsizer1)
 500 
 501         #the items are not sizable, once set, pass the fitted size to
 502         #the parent
 503         self.parent.SetClientSize(vsizer1.GetSize())
 504 
 505 
 506 class MyPanel_18(wx.Panel):
 507     """- A message box"""
 508 
 509     def __init__(self, parent):
 510         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
 511         self.parent = parent
 512 
 513         s = 'This is a rather long message with.'
 514         s += (os.linesep + 'a lot of lines...')*20
 515 
 516         statxt = wx.StaticText(self, -1, s, (-1, -1), (-1, -1))
 517         staline = wx.StaticLine(self, -1, (-1, -1), (-1, -1), wx.LI_HORIZONTAL)
 518         b1 = wx.Button(self, wx.NewId(), "&OK", (-1, -1), wx.DefaultSize)
 519 
 520         b = 5
 521         vsizer1 = wx.BoxSizer(wx.VERTICAL)
 522         vsizer1.Add(statxt, 1, wx.EXPAND | wx.ALL, b)
 523         vsizer1.Add(staline, 0, wx.GROW | wx.ALL, b)
 524         vsizer1.Add(b1, 0, wx.ALIGN_CENTER | wx.ALL, b)
 525         vsizer1.SetMinSize((200, -1))
 526         self.SetSizerAndFit(vsizer1)
 527 
 528         self.parent.SetClientSize(vsizer1.GetSize())
 529 
 530 
 531 class MyPanel_19(wx.Panel):
 532     """- A serie of couples, StaticText-TextCtrl
 533     - Buttons ok and cancel"""
 534 
 535     def __init__(self, parent):
 536         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
 537         self.parent = parent
 538 
 539         lab1 = wx.StaticText(self, -1, 'hydrogen :', (-1, -1), (-1, -1), wx.ALIGN_RIGHT)
 540         lab2 = wx.StaticText(self, -1, 'tin :', (-1, -1), (-1, -1), wx.ALIGN_RIGHT)
 541         lab3 = wx.StaticText(self, -1, 'mendelevium :', (-1, -1), (-1, -1), wx.ALIGN_RIGHT)
 542         lab4 = wx.StaticText(self, -1, 'carbon :', (-1, -1), (-1, -1), wx.ALIGN_RIGHT)
 543         txt1 = wx.TextCtrl(self, -1, '', (-1, -1), (-1, -1))
 544         txt2 = wx.TextCtrl(self, -1, '', (-1, -1), (-1, -1))
 545         txt3 = wx.TextCtrl(self, -1, '', (-1, -1), (-1, -1))
 546         txt4 = wx.TextCtrl(self, -1, '', (-1, -1), (-1, -1))
 547         b1 = wx.Button(self, wx.NewId(), '&OK', (-1, -1), wx.DefaultSize)
 548         b2 = wx.Button(self, wx.NewId(), '&Cancel', (-1, -1), wx.DefaultSize)
 549         staline = wx.StaticLine(self, wx.NewId(), (-1, -1), (-1, 2), wx.LI_HORIZONTAL)
 550 
 551         b = 5
 552         w = 100
 553         hsizer1 = wx.BoxSizer(wx.HORIZONTAL)
 554         hsizer1.Add(lab1, 0, wx.RIGHT, b)
 555         hsizer1.Add(txt1, 1, wx.GROW, b)
 556         hsizer1.SetItemMinSize(lab1, (w, -1))
 557 
 558         hsizer2 = wx.BoxSizer(wx.HORIZONTAL)
 559         hsizer2.Add(lab2, 0, wx.RIGHT, b)
 560         hsizer2.Add(txt2, 1, wx.GROW, b)
 561         hsizer2.SetItemMinSize(lab2, (w, -1))
 562 
 563         hsizer3 = wx.BoxSizer(wx.HORIZONTAL)
 564         hsizer3.Add(lab3, 0, wx.RIGHT, b)
 565         hsizer3.Add(txt3, 1, wx.GROW, b)
 566         hsizer3.SetItemMinSize(lab3, (w, -1))
 567 
 568         hsizer4 = wx.BoxSizer(wx.HORIZONTAL)
 569         hsizer4.Add(lab4, 0, wx.RIGHT, b)
 570         hsizer4.Add(txt4, 1, wx.GROW, b)
 571         hsizer4.SetItemMinSize(lab4, (w, -1))
 572 
 573         hsizer5 = wx.BoxSizer(wx.HORIZONTAL)
 574         hsizer5.Add(b1, 0)
 575         hsizer5.Add(b2, 0, wx.LEFT, 10)
 576 
 577         b = 5
 578         vsizer1 = wx.BoxSizer(wx.VERTICAL)
 579         vsizer1.Add(hsizer1, 0, wx.EXPAND | wx.ALL, b)
 580         vsizer1.Add(hsizer2, 0, wx.EXPAND | wx.ALL, b)
 581         vsizer1.Add(hsizer3, 0, wx.EXPAND | wx.ALL, b)
 582         vsizer1.Add(hsizer4, 0, wx.EXPAND | wx.ALL, b)
 583         vsizer1.Add(staline, 0, wx.GROW | wx.ALL, b)
 584         vsizer1.Add(hsizer5, 0, wx.ALIGN_RIGHT | wx.ALL, b)
 585 
 586         self.SetSizerAndFit(vsizer1)
 587         self.parent.SetClientSize(vsizer1.GetSize())
 588 
 589 
 590 class MyPanel_20(wx.Panel):
 591     """- A FlexGridSizer
 592     - 4 ColWins as cells, all sizeable"""
 593 
 594     def __init__(self, parent):
 595         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
 596 
 597         wred = ColWin(self, -1, wx.RED)
 598         wblue = ColWin(self, -1, wx.BLUE)
 599         wwhite = ColWin(self, -1, wx.WHITE)
 600         wcyan = ColWin(self, -1, wx.CYAN)
 601 
 602         hgap, vgap = 0, 0
 603         nrows, ncols = 2, 2
 604         fgs = wx.FlexGridSizer(nrows, ncols, hgap, vgap)
 605 
 606         b = 5
 607         fgs.AddMany([(wred, 1, wx.EXPAND | wx.ALL, b),
 608                      (wblue, 1, wx.EXPAND | wx.ALL, b),
 609                      (wwhite, 1, wx.EXPAND | wx.ALL, b),
 610                      (wcyan, 1, wx.EXPAND | wx.ALL, b),
 611                     ])
 612 
 613         # or
 614         #~ fgs.Add(wred, 1, wx.EXPAND | wx.ALL, b)
 615         #~ fgs.Add(wblue, 1, wx.EXPAND | wx.ALL, b)
 616         #~ fgs.Add(wwhite, 1, wx.EXPAND | wx.ALL, b)
 617         #~ fgs.Add(wcyan, 1, wx.EXPAND | wx.ALL, b)
 618 
 619         #set all rows and cols sizable, try to comment / uncomment
 620         fgs.AddGrowableRow(0)
 621         fgs.AddGrowableRow(1)
 622         fgs.AddGrowableCol(0)
 623         fgs.AddGrowableCol(1)
 624 
 625         self.SetSizer(fgs)
 626 
 627 
 628 class MyPanel_21(wx.Panel):
 629     """- A FlexgridSizer with 4 cells
 630     - cell (0, 0) is a column of 3 Buttons
 631     - cell (1, 1) is a row of 3 Buttons
 632     - cell (1, 0) is empty
 633     - cell (0, 1) is a ColWin"""
 634 
 635     def __init__(self, parent):
 636         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
 637 
 638         wwhite = ColWin(self, -1, wx.WHITE)
 639         b1 = wx.Button(self, -1, 'button1', (-1, -1), wx.DefaultSize)
 640         b2 = wx.Button(self, -1, 'button2', (-1, -1), wx.DefaultSize)
 641         b3 = wx.Button(self, -1, 'button3', (-1, -1), wx.DefaultSize)
 642         b4 = wx.Button(self, -1, 'button4', (-1, -1), wx.DefaultSize)
 643         b5 = wx.Button(self, -1, 'button5', (-1, -1), wx.DefaultSize)
 644         b6 = wx.Button(self, -1, 'button6', (-1, -1), wx.DefaultSize)
 645 
 646         b = 0
 647         hsizer1 = wx.BoxSizer(wx.HORIZONTAL)
 648         hsizer1.Add(b1, 0, wx.ALL, b)
 649         hsizer1.Add((-1, -1), 1)
 650         hsizer1.Add(b2, 0, wx.ALL, b)
 651         hsizer1.Add((-1, -1), 1)
 652         hsizer1.Add(b3, 0, wx.ALL, b)
 653 
 654         b = 0
 655         vsizer1 = wx.BoxSizer(wx.VERTICAL)
 656         vsizer1.Add(b4, 0, wx.ALL, b)
 657         vsizer1.Add((-1, -1), 1)
 658         vsizer1.Add(b5, 0, wx.ALL, b)
 659         vsizer1.Add((-1, -1), 1)
 660         vsizer1.Add(b6, 0, wx.ALL, b)
 661 
 662         hgap, vgap = 0, 0
 663         nrows, ncols = 2, 2
 664         fgs = wx.FlexGridSizer(nrows, ncols, hgap, vgap)
 665 
 666         b = 5
 667         fgs.AddMany([(vsizer1, 1, wx.EXPAND | wx.ALL, b),
 668                      (wwhite, 1, wx.EXPAND | wx.ALL, b),
 669                      ((-1, -1), 1, wx.EXPAND | wx.ALL, b),
 670                      (hsizer1, 1, wx.EXPAND | wx.ALL, b),
 671                     ])
 672 
 673         #really tricky ;-)
 674         fgs.AddGrowableRow(0)
 675         fgs.AddGrowableCol(1)
 676 
 677         self.SetSizer(fgs)
 678 
 679 
 680 class MyPanel_22(wx.Panel):
 681     """- A FlexGridSizer of 9 cells (3x3) with 5 ColWins in cells
 682     and 4 empty cells"""
 683 
 684     def __init__(self, parent):
 685         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
 686 
 687         wwhite = ColWin(self, -1, wx.WHITE)
 688         wblue = ColWin(self, -1, wx.BLUE)
 689         wgreen = ColWin(self, -1, wx.GREEN)
 690         wcyan = ColWin(self, -1, wx.CYAN)
 691         wred = ColWin(self, -1, wx.RED)
 692 
 693         hgap, vgap = 0, 0
 694         nrows, ncols = 3, 3
 695         fgs = wx.FlexGridSizer(nrows, ncols, hgap, vgap)
 696 
 697         b = 5
 698         fgs.AddMany([(wwhite, 1, wx.EXPAND | wx.ALL, b),
 699                      ((-1, -1), 1, wx.EXPAND | wx.ALL, b),
 700                      (wblue, 1, wx.EXPAND | wx.ALL, b),
 701 
 702                      ((-1, -1), 1, wx.EXPAND | wx.ALL, b),
 703                      (wgreen, 1, wx.EXPAND | wx.ALL, b),
 704                      ((-1, -1), 1, wx.EXPAND | wx.ALL, b),
 705 
 706                      (wred, 1, wx.EXPAND | wx.ALL, b),
 707                      ((-1, -1), 1, wx.EXPAND | wx.ALL, b),
 708                      (wcyan, 1, wx.EXPAND | wx.ALL, b),
 709                     ])
 710 
 711         fgs.AddGrowableRow(0)
 712         fgs.AddGrowableRow(1)
 713         fgs.AddGrowableRow(2)
 714 
 715         fgs.AddGrowableCol(0)
 716         fgs.AddGrowableCol(1)
 717         fgs.AddGrowableCol(2)
 718 
 719         self.SetSizer(fgs)
 720 
 721 
 722 class MyPanel_23(wx.Panel):
 723     """- A FlexGridSizer of 9 cells (3x3) with 4 ColWins in cells and 5 empty cells
 724     - rows 1 and 3 have a fixed size"""
 725 
 726     def __init__(self, parent):
 727         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
 728 
 729         h = 40
 730         wwhite = wx.Window(self, -1, (-1, -1), (-1, h), wx.SIMPLE_BORDER)
 731         wwhite.SetBackgroundColour(wx.WHITE)
 732         wblue = ColWin(self, -1, wx.BLUE)
 733         wgreen = ColWin(self, -1, wx.GREEN)
 734         wred = wx.Window(self, -1, (-1, -1), (-1, h), wx.SIMPLE_BORDER)
 735         wred.SetBackgroundColour(wx.RED)
 736 
 737         hgap, vgap = 0, 0
 738         nrows, ncols = 3, 3
 739         fgs = wx.FlexGridSizer(nrows, ncols, hgap, vgap)
 740 
 741         b = 5
 742         fgs.AddMany([((-1, -1), 1, wx.EXPAND | wx.ALL, b),
 743                      (wwhite, 1, wx.EXPAND | wx.ALL, b),
 744                      ((-1, -1), 1, wx.EXPAND | wx.ALL, b),
 745 
 746                      (wblue, 1, wx.EXPAND | wx.ALL, b),
 747                      ((-1, -1), 1, wx.EXPAND | wx.ALL, b),
 748                      (wgreen, 1, wx.EXPAND | wx.ALL, b),
 749 
 750                      ((-1, -1), 1, wx.EXPAND | wx.ALL, b),
 751                      (wred, 1, wx.EXPAND | wx.ALL, b),
 752                      ((-1, -1), 1, wx.EXPAND | wx.ALL, b),
 753                     ])
 754 
 755         fgs.AddGrowableRow(1)
 756 
 757         fgs.AddGrowableCol(0)
 758         fgs.AddGrowableCol(1)
 759         fgs.AddGrowableCol(2)
 760 
 761         self.SetSizer(fgs)
 762 
 763 
 764 class MyPanel_24(wx.Panel):
 765     """- This example is coming from one of my applications
 766     - in the real app, the white window is a drawing area and
 767       the five lower windows are StaticTexts with a defined
 768       font size (this is why I force a fixed height)"""
 769 
 770     def __init__(self, parent):
 771         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
 772         self.parent = parent
 773 
 774         #a menu for the beauty of the demo
 775         menu1 = wx.Menu()
 776         menu1.Append(101, '&aaa')
 777         menuBar = wx.MenuBar()
 778         menuBar.Append(menu1, '&File')
 779         self.parent.SetMenuBar(menuBar)
 780 
 781         wwhite = ColWin(self, -1, wx.WHITE)
 782         wblue = ColWin(self, -1, wx.BLUE)
 783         wgreen = ColWin(self, -1, wx.GREEN)
 784         wcyan = ColWin(self, -1, wx.CYAN)
 785         wred = ColWin(self, -1, wx.RED)
 786         wcoral = ColWin(self, -1, wx.NamedColour('coral'))
 787         staline = wx.StaticLine(self, -1, (-1, -1), (-1, 2), wx.LI_HORIZONTAL)
 788 
 789         vsizer1 = wx.BoxSizer(wx.VERTICAL)
 790         b = 5
 791         vsizer1.Add(wblue, 1, wx.EXPAND | wx.BOTTOM, b)
 792         vsizer1.Add(wgreen, 1, wx.EXPAND)
 793 
 794         hsizer2 = wx.BoxSizer(wx.HORIZONTAL)
 795         b = 5
 796         minhe = 100
 797         hsizer2.Add(wcoral, 2, wx.EXPAND | wx.RIGHT, b)
 798         hsizer2.Add(wcyan, 3, wx.EXPAND | wx.RIGHT, b)
 799         hsizer2.Add(wred, 3, wx.EXPAND | wx.RIGHT, b)
 800         hsizer2.Add(vsizer1, 2, wx.EXPAND, border=b)
 801         hsizer2.SetItemMinSize(wcoral, (-1, minhe))
 802         hsizer2.SetItemMinSize(wcyan, (-1, minhe))
 803         hsizer2.SetItemMinSize(wred, (-1, minhe))
 804         hsizer2.SetItemMinSize(vsizer1, (-1, minhe))
 805 
 806         vsizer3 = wx.BoxSizer(wx.VERTICAL)
 807         b = 5
 808         vsizer3.Add(staline, 0, wx.GROW | wx.ALL, 0)
 809         vsizer3.Add(wwhite, 1, wx.EXPAND | wx.TOP | wx.LEFT | wx.RIGHT, b)
 810         vsizer3.Add(hsizer2, 0, wx.EXPAND | wx.ALL, b)
 811 
 812         self.SetSizerAndFit(vsizer3)
 813 
 814 
 815 class MyPanel_25(wx.Panel):
 816     """- This shows the relaton between the font size and the size of the
 817       widgets when sizers are used"""
 818 
 819     def __init__(self, parent):
 820         wx.Panel.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize)
 821         self.parent = parent
 822 
 823         fs = 20
 824         self.SetFont(wx.Font(fs, wx.DEFAULT, wx.NORMAL, wx.NORMAL, False))
 825 
 826 
 827         statxt1 = wx.StaticText(self, -1, 'one, two, three', (-1, -1), (-1, -1))
 828         statxt1.SetBackgroundColour(wx.WHITE)
 829         statxt2 = wx.StaticText(self, -1, 'eins, zwei, drei', (-1, -1), (-1, -1))
 830         statxt3 = wx.StaticText(self, -1, 'un, deux, trois', (-1, -1), (-1, -1))
 831         b1 = wx.Button(self, wx.NewId(), 'button1', (-1, -1), (-1, -1))
 832         b2 = wx.Button(self, wx.NewId(), 'button2', (-1, -1), (-1, -1))
 833 
 834         b = 5
 835         hsizer1 = wx.BoxSizer(wx.HORIZONTAL)
 836         hsizer1.Add(b1, 1, wx.EXPAND | wx.ALL, b)
 837         hsizer1.Add(b2, 1, wx.EXPAND | wx.ALL, b)
 838 
 839         vsizer1 = wx.BoxSizer(wx.VERTICAL)
 840         vsizer1.Add(statxt1, 0, wx.ALL, b)
 841         vsizer1.Add(statxt2, 0, wx.ALL, b)
 842         vsizer1.Add(statxt3, 0, wx.ALL, b)
 843         vsizer1.Add(hsizer1, 0, wx.ALL, b)
 844 
 845         self.SetSizerAndFit(vsizer1)
 846         self.parent.SetClientSize(vsizer1.GetSize())
 847 
 848 
 849 class TestComboBox(wx.Panel):
 850     def __init__(self, parent, id):
 851         wx.Panel.__init__(self, parent, id)
 852 
 853         sampleList = []
 854         for i in range(0, 26):
 855             sampleList.append('MyPanel_' + `i`)
 856 
 857         st = wx.StaticText(self, -1, "Select the example you want to see."
 858                          "Then click the View button.", (-1, -1))
 859 
 860         doctxt = wx.StaticText(self, -1, "")
 861         doctxt.SetLabel(MyPanel_0.__doc__)
 862         self.doctxt = doctxt
 863 
 864         # This combobox is created with a preset list of values.
 865         cb = wx.ComboBox(
 866             self, -1, "MyPanel_0", (-1, -1),
 867             (-1, -1), sampleList, wx.CB_DROPDOWN
 868             )
 869         self.cb = cb
 870 
 871         stline = wx.StaticLine(self, -1, (-1, -1), (-1, 2), wx.LI_HORIZONTAL)
 872 
 873         btnView = wx.Button(self, -1, "&View")
 874         self.Bind(wx.EVT_BUTTON, self.OnClickView, btnView)
 875 
 876         btnExit = wx.Button(self, -1, "E&xit")
 877         self.Bind(wx.EVT_BUTTON, self.OnClickExit, btnExit)
 878 
 879         b = 5
 880         vsizer1 = wx.BoxSizer(wx.VERTICAL)
 881         vsizer1.Add(st, 0, wx.EXPAND | wx.ALL, b)
 882         vsizer1.Add(cb, 0, wx.EXPAND | wx.ALL, 0)
 883         vsizer1.Add(doctxt, 0, wx.EXPAND | wx.ALL, b)
 884 
 885         hsizer1 = wx.BoxSizer(wx.HORIZONTAL)
 886         hsizer1.Add(btnView, 0)
 887         hsizer1.Add(btnExit, 0, wx.LEFT, b)
 888 
 889         vsizer2 = wx.BoxSizer(wx.VERTICAL)
 890         vsizer2.Add(vsizer1, 5, wx.EXPAND | wx.ALL, 0)
 891         vsizer2.Add(stline, 0, wx.GROW | wx.ALL, b)
 892         vsizer2.Add(hsizer1, 1, wx.ALIGN_RIGHT | wx.ALL, b)
 893         self.SetSizer(vsizer2)
 894 
 895         self.Bind(wx.EVT_COMBOBOX, self.EvtComboBox, cb)
 896 
 897     # When the user selects something, we go here.
 898     def EvtComboBox(self, evt):
 899         self.doctxt.SetLabel(eval('%s.__doc__' % self.cb.GetValue()))
 900 
 901     def OnClickView(self, evt):
 902         win = wx.Frame(self, -1, self.cb.GetValue(), size=(350, 200),
 903                   style = wx.DEFAULT_FRAME_STYLE)
 904         eval('%s(win)' % self.cb.GetValue())
 905 
 906         win.CenterOnScreen()
 907         win.Show(True)
 908 
 909     def OnClickExit(self, evt):
 910         sys.exit()
 911 
 912 
 913 
 914 class MyFrame(wx.Frame):
 915 
 916     def __init__(self, parent, id):
 917         s = __file__
 918         wx.Frame.__init__(self, parent, id, s, (0, 0), (500, 400))
 919 
 920         self.panel = eval('MyPanel_%d(self)' % panel)
 921         self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
 922 
 923     def OnCloseWindow(self, event):
 924         self.Destroy()
 925 
 926 
 927 class MyApp(wx.App):
 928 
 929     def OnInit(self):
 930         frame = wx.Frame(None, -1, __file__, (0, 0), (400, 300))
 931         frame.panel = TestComboBox(frame, -1)
 932         frame.Show(True)
 933         self.SetTopWindow(frame)
 934         return True
 935 
 936 
 937 def main():
 938     app = MyApp(False)
 939     app.MainLoop()
 940 
 941 
 942 if __name__ == "__main__" :
 943     main()

LearnSizers1 (last edited 2008-03-11 10:50:37 by localhost)

NOTE: To edit pages in this wiki you must be a member of the TrustedEditorsGroup.