Tony Cappellini | 19 Aug 03:25

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
(Continue reading)

Jean-Michel Fauth | 19 Aug 08:19

Re: Sizers, finally


2008/8/19 Tony Cappellini <cappy2112 <at> 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/

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





_______________________________________________
wxpython-users mailing list
wxpython-users <at> lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
Robin Dunn | 21 Aug 09:18

Re: Sizers, finally

Jean-Michel Fauth wrote:
> 
> 2008/8/19 Tony Cappellini <cappy2112 <at> gmail.com <mailto:cappy2112 <at> 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 <at> lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

raffaello | 21 Aug 09:54

Re: Sizers, finally

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 <at> alldunn.com>
Jean-Michel Fauth wrote:

2008/8/19 Tony Cappellini <cappy2112 <at> gmail.com <mailto:cappy2112 <at> 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 <at> lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

_______________________________________________
wxpython-users mailing list
wxpython-users <at> lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
Mike Driscoll | 21 Aug 21:12

Re: Sizers, finally

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 <at> alldunn.com <mailto:robin <at> alldunn.com>>
>
>     Jean-Michel Fauth wrote:
>
>
>         2008/8/19 Tony Cappellini <cappy2112 <at> gmail.com
>         <mailto:cappy2112 <at> gmail.com> <mailto:cappy2112 <at> gmail.com
>         <mailto:cappy2112 <at> 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 <at> lists.wxwidgets.org
>     <mailto:wxpython-users <at> lists.wxwidgets.org>
>     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 <at> lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
raffaello | 22 Aug 00:07

Re: Sizers, finally

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 <at> 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 <at> alldunn.com <mailto:robin <at> alldunn.com>>


   Jean-Michel Fauth wrote:


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

       <mailto:cappy2112 <at> 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 <at> lists.wxwidgets.org
   <mailto:wxpython-users <at> lists.wxwidgets.org>


# -*- 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 <at> lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users


_______________________________________________
wxpython-users mailing list
wxpython-users <at> lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
Mike Driscoll | 22 Aug 15:47

Re: Sizers, finally

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 <at> pythonlibrary.org 
> <mailto:mike <at> 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
Attachment (LearnSizers8.zip): application/zip, 35 KiB
_______________________________________________
wxpython-users mailing list
wxpython-users <at> lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
Tony Cappellini | 22 Aug 02:10

Re: Sizers, finally

---------- Forwarded message ----------
From: raffaello <barbarossa.platz <at> gmail.com>
To: wxpython-users <at> lists.wxwidgets.org
Date: Fri, 22 Aug 2008 00:07:46 +0200
Subject: Re: [wxpython-users] Sizers, finally
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 <at> 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.

I was able to download LearnSizers8.zip an unzip it.

However, after the recent link to this was posted
http://wiki.wxpython.org/Widget%20Inspection%20Tool

I'm not able to get the boarders of the sizers to be displayed.
I've got the inspection too launched from my app, but this doesn't
seem to work for me

"Highlight: Highlight in the live window the item that is currently
selected in the widget tree. Top-level windows will be flickered, and
other items will have borders drawn around them for a few seconds, as
shown in the screenshot below."
_______________________________________________
wxpython-users mailing list
wxpython-users <at> lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
Tony Cappellini | 22 Aug 02:17

re: Sizers, finally

To be more precise, my inspection tool doesn't have the same Toolbar
buttons as in the screenshot here
http://wiki.wxpython.org/Widget%20Inspection%20Tool

My Inspection Tool Looks like this (attached)
_______________________________________________
wxpython-users mailing list
wxpython-users <at> lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
Mike Driscoll | 22 Aug 16:02

Re: Sizers, finally

Tony Cappellini wrote:
> To be more precise, my inspection tool doesn't have the same Toolbar
> buttons as in the screenshot here
> http://wiki.wxpython.org/Widget%20Inspection%20Tool
>
> My Inspection Tool Looks like this (attached)
>   

Mine doesn't. It has all the same toolbar buttons that the wiki shows. 
I'm using the 2.8.8.0 version of the Demo. What about you?

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

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

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

Tony Cappellini | 22 Aug 18:56

Re: Sizers, finally

I'm using 2.8.4.0.

On Fri, Aug 22, 2008 at 7:02 AM, Mike Driscoll <mike <at> pythonlibrary.org> wrote:
> Tony Cappellini wrote:
>>
>> To be more precise, my inspection tool doesn't have the same Toolbar
>> buttons as in the screenshot here
>> http://wiki.wxpython.org/Widget%20Inspection%20Tool
>>
>> My Inspection Tool Looks like this (attached)
>>
>
> Mine doesn't. It has all the same toolbar buttons that the wiki shows. I'm
> using the 2.8.8.0 version of the Demo. What about you?
>
> -------------------
> Mike Driscoll
>
> Blog:   http://blog.pythonlibrary.org
> Python Extension Building Network:     http://www.pythonlibrary.org
>
>
_______________________________________________
wxpython-users mailing list
wxpython-users <at> lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Tony Cappellini | 22 Aug 18:59

Re: Sizers, finally

What does the version of the demo have to do with the sizer borders
being highlighted?
The inspection tool isn't part of the demo, it's part of the core wx package.

On Fri, Aug 22, 2008 at 7:02 AM, Mike Driscoll <mike <at> pythonlibrary.org> wrote:
> Tony Cappellini wrote:
>>
>> To be more precise, my inspection tool doesn't have the same Toolbar
>> buttons as in the screenshot here
>> http://wiki.wxpython.org/Widget%20Inspection%20Tool
>>
>> My Inspection Tool Looks like this (attached)
>>
>
> Mine doesn't. It has all the same toolbar buttons that the wiki shows. I'm
> using the 2.8.8.0 version of the Demo. What about you?
>
> -------------------
> Mike Driscoll
>
> Blog:   http://blog.pythonlibrary.org
> Python Extension Building Network:     http://www.pythonlibrary.org
>
>
_______________________________________________
wxpython-users mailing list
wxpython-users <at> lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users

Mike Driscoll | 22 Aug 19:17

Re: Sizers, finally

Tony Cappellini wrote:
> What does the version of the demo have to do with the sizer borders
> being highlighted?
> The inspection tool isn't part of the demo, it's part of the core wx package.
>   

It probably doesn't. But I think Robin added that feature within the 
last two or three releases of wxPython. I should have said I was using 
wxPython 2.8.8.0. The wiki does show that Robin was running 2.8.8.0 in 
the screenshot and it was updated at the end of June. I trolled back 
into the archives and found Robin mentioning the following to me actually:

"Take a peek at the new preview build of 2.8.8.  I've made some 
enhancements to the widget inspection tool that lets you highlight 
sizers and widgets in the live app." I received this on June 5th, 2008 
on the list. So I think you'll just need to upgrade.

Mike

> On Fri, Aug 22, 2008 at 7:02 AM, Mike Driscoll <mike <at> pythonlibrary.org> wrote:
>   
>> Tony Cappellini wrote:
>>     
>>> To be more precise, my inspection tool doesn't have the same Toolbar
>>> buttons as in the screenshot here
>>> http://wiki.wxpython.org/Widget%20Inspection%20Tool
>>>
>>> My Inspection Tool Looks like this (attached)
>>>
>>>       
>> Mine doesn't. It has all the same toolbar buttons that the wiki shows. I'm
>> using the 2.8.8.0 version of the Demo. What about you?
>>
>> -------------------
>> Mike Driscoll
>>
>> Blog:   http://blog.pythonlibrary.org
>> Python Extension Building Network:     http://www.pythonlibrary.org
>>
>>
>>     
>
>   

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

Robin Dunn | 22 Aug 19:36

Re: Sizers, finally

Tony Cappellini wrote:
> To be more precise, my inspection tool doesn't have the same Toolbar
> buttons as in the screenshot here
> http://wiki.wxpython.org/Widget%20Inspection%20Tool
> 
> My Inspection Tool Looks like this (attached)

The sizer highlight (and others) was added in 2.8.8.0.

--

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

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


Gmane