Sizers, finally

I've got the GUI laid out in my next wx app (pure wx, no Pythoncard),
and it's shaped up pretty well, with much less problems than the
previous program I attempted using sizers.

This GUI uses several sizers (all BoxSizers, unfortunately) and I'm
finally getting more comfortable using them, even after not having
written any GUI code for a few months. (That doesn't mean I wont trip
over them the next time I use sizer. I probably will, but now have
something I've written to look back on)

I want to thank the readers/contributors to this list for helping me
through my problems.

For the newbies: Here are some things you should seriously take
advantage of if you're just starting with wxPython or having problems
in general

     1. The wx Wiki ---> http://wiki.wxpython.org/FrontPage
     2. The book: "wxPython in Action" -----> www.manning.com/rappin/
         (there's even a download version you can read on the bus/train to work)

     3. Mike's Sizer tutorials -------> http://wiki.wxpython.org/SizerTutorials

Robin has/had a very useful suggestion regarding sizers: draw a crude
diagram of what you expect the layout of your sizers to look like, as
if the sizers were visible. He had emailed me a jpg which showed the
layout of the sizers in a program I had problems with, and it really
does make you think differently about how the layout should be, and
how to get your layout to be that way. If I still had the jpg, I would
attach it. It's not in my emails, and I think it was on my laptop
which was stolen.

The sizers tutorials might also benefit from a simple jpg illustrating
what the layout/position/boundaries looks like.

Do the sizers have an attribute that can be enabled, which shows their
border/boundary lines?
(like the Grid lines in Word and Excel tables).

Thanks Everyone!

One way to achieve this is to use the inspection tool.
See, eg, the module inspection_tool_and_sizers.py in LearnSizers8.zip available
at http://spinecho.ze.cx/
Jean-Michel Fauth, Switzerland
[OT]
Does gmane work for you ? I’m only able to read messages like
weft didn’t produce an output. or
Warning: fopen(/var/tmp/weft/gmane/comp/python/wxpython/62567): failed to open stream: Input/output error in /home/httpd/gmane/news/wefta.php on line 135

···

2008/8/19 Tony Cappellini cappy2112@gmail.com

Do the sizers have an attribute that can be enabled, which shows their

border/boundary lines?

(like the Grid lines in Word and Excel tables).

Jean-Michel Fauth wrote:

2008/8/19 Tony Cappellini <cappy2112@gmail.com <mailto:cappy2112@gmail.com>>

    Do the sizers have an attribute that can be enabled, which shows their
    border/boundary lines?
    (like the Grid lines in Word and Excel tables).

One way to achieve this is to use the inspection tool.

See, eg, the module inspection_tool_and_sizers.py in LearnSizers8.zip available
at http://spinecho.ze.cx/

And you can see the WIT in action showing the sizer outlines at:
http://wiki.wxpython.org/Widget%20Inspection%20Tool

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

The problem is that the module inspection_tool_and_sizers.py in LearnSizers8.zip IS NOT available at http://spinecho.ze.cx/: there is a link there, but it takes to nothing. Could please J.M. Fault reset it?

···

2008/8/21 Robin Dunn robin@alldunn.com

Jean-Michel Fauth wrote:

2008/8/19 Tony Cappellini <cappy2112@gmail.com mailto:cappy2112@gmail.com>

Do the sizers have an attribute that can be enabled, which shows their

border/boundary lines?

(like the Grid lines in Word and Excel tables).

One way to achieve this is to use the inspection tool.

See, eg, the module inspection_tool_and_sizers.py in LearnSizers8.zip available

at http://spinecho.ze.cx/

And you can see the WIT in action showing the sizer outlines at:

http://wiki.wxpython.org/Widget%20Inspection%20Tool

Robin Dunn

Software Craftsman

http://wxPython.org Java give you jitters? Relax with wxPython!


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

raffaello wrote:

The problem is that the module inspection_tool_and_sizers.py in LearnSizers8.zip IS NOT available at http://spinecho.ze.cx/: there is a link there, but it takes to nothing. Could please J.M. Fault reset it?

That link works for me...in Firefox 3 on Windows XP. I didn't try it with my other browsers. Regardless, I upzipped it and included the file you were looking for.

inspection_tool_and_sizers.py (1.89 KB)

···

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org
Python Extension Building Network: http://www.pythonlibrary.org

2008/8/21 Robin Dunn <robin@alldunn.com <mailto:robin@alldunn.com>>

    Jean-Michel Fauth wrote:

        2008/8/19 Tony Cappellini <cappy2112@gmail.com
        <mailto:cappy2112@gmail.com> <mailto:cappy2112@gmail.com
        <mailto:cappy2112@gmail.com>>>

           Do the sizers have an attribute that can be enabled, which
        shows their
           border/boundary lines?
           (like the Grid lines in Word and Excel tables).

        One way to achieve this is to use the inspection tool.

        See, eg, the module inspection_tool_and_sizers.py in
        LearnSizers8.zip available
        at http://spinecho.ze.cx/

    And you can see the WIT in action showing the sizer outlines at:
    http://wiki.wxpython.org/Widget%20Inspection%20Tool

    -- Robin Dunn
    Software Craftsman
    http://wxPython.org Java give you jitters? Relax with wxPython!

    _______________________________________________
    wxpython-users mailing list
    wxpython-users@lists.wxwidgets.org
    <mailto:wxpython-users@lists.wxwidgets.org>
    http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Thanks for your kindness, Mike, but the file I was looking for is just the full .zip (LearnSizers8.zip). And my Firefox must be wet, because this time the link took me to iFrance, “le portail des jeunes actifs”. Et, hélas, je ne suis plus jeune, et pas trop actif non plus.

Would it be too much trouble for you, to send the whole file?

···

2008/8/21 Mike Driscoll mike@pythonlibrary.org

raffaello wrote:

The problem is that the module inspection_tool_and_sizers.py in LearnSizers8.zip IS NOT available at http://spinecho.ze.cx/: there is a link there, but it takes to nothing. Could please J.M. Fault reset it?

That link works for me…in Firefox 3 on Windows XP. I didn’t try it with my other browsers. Regardless, I upzipped it and included the file you were looking for.


Mike Driscoll

Blog: http://blog.pythonlibrary.org

Python Extension Building Network: http://www.pythonlibrary.org

2008/8/21 Robin Dunn <robin@alldunn.com mailto:robin@alldunn.com>

Jean-Michel Fauth wrote:





    2008/8/19 Tony Cappellini <cappy2112@gmail.com

mailto:cappy2112@gmail.com <mailto:cappy2112@gmail.com

    <mailto:cappy2112@gmail.com>>>







       Do the sizers have an attribute that can be enabled, which

    shows their

       border/boundary lines?

       (like the Grid lines in Word and Excel tables).



    One way to achieve this is to use the inspection tool.



    See, eg, the  module inspection_tool_and_sizers.py in

    LearnSizers8.zip available

    at [http://spinecho.ze.cx/](http://spinecho.ze.cx/)





And you can see the WIT in action showing the sizer outlines at:

[http://wiki.wxpython.org/Widget%20Inspection%20Tool](http://wiki.wxpython.org/Widget%20Inspection%20Tool)







--    Robin Dunn

Software Craftsman

[http://wxPython.org](http://wxPython.org)  Java give you jitters?  Relax with wxPython!



_______________________________________________

wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

mailto:wxpython-users@lists.wxwidgets.org

[http://lists.wxwidgets.org/mailman/listinfo/wxpython-users](http://lists.wxwidgets.org/mailman/listinfo/wxpython-users)

-- coding: iso-8859-1 --

#--------------------------------------------------------------------

Name: inspection_tool_and_sizers.py

Purpose: An application to learn sizers

Author: Jean-Michel Fauth, Switzerland

Copyright: (c) 2007-2008 Jean-Michel Fauth

Licence: None

os dev: w2k sp4

py dev: Python 2.5.2

wx dev: wxPython 2.8.7.1-ansi

Revision: 25 May 2008

#--------------------------------------------------------------------

Usage of the wxPython inspection tool with sizers.

#--------------------------------------------------------------------

import wx

from colour_window import ColWin

#--------------------------------------------------------------------

3 ColWins, horizontally, height ratio 1:2:3.

class MyPanel1(wx.Panel):

def __init__(self, parent):

    wx.Panel.__init__(self, parent)

    self.parent = parent



    wred = ColWin(self, wx.ID_ANY, wx.RED)

    wblue = ColWin(self, wx.ID_ANY, wx.BLUE)

    wgreen = ColWin(self, wx.ID_ANY, wx.GREEN)



    b = 5

    hsizer1 = wx.BoxSizer(wx.HORIZONTAL)

    hsizer1.Add(wred, 1, wx.EXPAND | wx.ALL, b)

    hsizer1.Add(wblue, 2, wx.EXPAND | wx.ALL, b)

    hsizer1.Add(wgreen, 3, wx.EXPAND | wx.ALL, b)



    self.SetSizer(hsizer1)

#-----------------------------------------------------------------

if name == “main” :

import base_frame

import wx.lib.inspection #inspection tool



app = wx.PySimpleApp()

frame = base_frame.MyFrame(None, panel=MyPanel1)



#set values to the parent frame to be easily recognized in the inspection tool.

frame.SetPosition((33, 22))

frame.SetSize((333, 222))



frame.Show()



#show the inspection frame of the inspection tool

wx.lib.inspection.InspectionTool().Show()



app.MainLoop()

#eof-----------------------------------------------------------------


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

raffaello wrote:

Thanks for your kindness, Mike, but the file I was looking for is just the full .zip (LearnSizers8.zip). And my Firefox must be wet, because this time the link took me to iFrance, "le portail des jeunes actifs". Et, hélas, je ne suis plus jeune, et pas trop actif non plus.
Would it be too much trouble for you, to send the whole file?

2008/8/21 Mike Driscoll <mike@pythonlibrary.org <mailto:mike@pythonlibrary.org>>

    raffaello wrote:

        The problem is that the module inspection_tool_and_sizers.py
        in LearnSizers8.zip IS NOT available at
        http://spinecho.ze.cx/: there is a link there, but it takes to
        nothing. Could please J.M. Fault reset it?

    That link works for me...in Firefox 3 on Windows XP. I didn't try
    it with my other browsers. Regardless, I upzipped it and included
    the file you were looking for.

    -------------------
    Mike Driscoll

No problem. It should be attached to this email. Hopefully your web client accepts zip files. If not, I can tar it.

Mike

LearnSizers8.zip (35.7 KB)