visible sizer border

is it possible to make the border around a sizer visible ie. an indented line.

this is so that i can group elements in a sizer in a more visual manner and make things more obvious to the user.

You are describing a separate control, the wx.StaticBox.

See the wxPython API for how to use it; see the wxWidgets docs for
notes on its use.

···

On 19-Jun-2005, Timothy Smith wrote:

is it possible to make the border around a sizer visible ie. an
indented line.

--
\ "Oh, I realize it's a penny here and a penny there, but look at |
  `\ me: I've worked myself up from nothing to a state of extreme |
_o__) poverty." -- Groucho Marx |
Ben Finney <ben@benfinney.id.au>

Ben Finney wrote:

···

On 19-Jun-2005, Timothy Smith wrote:

is it possible to make the border around a sizer visible ie. an
indented line.
   
You are describing a separate control, the wx.StaticBox.

See the wxPython API for how to use it; see the wxWidgets docs for
notes on its use.

yuck, it'd be much more logical to be able to show a border for the sizer :confused:

Timothy Smith wrote:

Ben Finney wrote:

is it possible to make the border around a sizer visible ie. an
indented line.
  
You are describing a separate control, the wx.StaticBox.

See the wxPython API for how to use it; see the wxWidgets docs for
notes on its use.

yuck, it'd be much more logical to be able to show a border for the sizer :confused:

I know what you mean. Coming from Tkinter, I initially expected sizers to be like Tkinter "frames" (legitimate child widgets that can be given a visible border attribute) and was initially stumped when they turned out not to be. The thing is, sizers aren't derived from wx.Window so they're not really displayable widgets at all. As far as I can tell, they're really just a collection of instructions that describe how a set of real widgets (the ones added to the sizer) should be laid out when it comes time to draw them. After having used them for a while, I've actually become quite fond of sizers. They're easy to use and they work well!

Anyway, in your particular case, you might be able to put everything into a wx.Panel (as opposed to a wx.StaticBox) and use that to segregate your application into logical areas. wx.Panel is derived from wx.Window and (I presume) supports the normal wx.Window styles (like wx.RAISED_BORDER for instance) although I've never actually tried that. I have changed the color of a panel before to denote a region and that worked fine.

Regards,

Charlie Hubbard

···

On 19-Jun-2005, Timothy Smith wrote:

Timothy Smith wrote:
>yuck, it'd be much more logical to be able to show a border for the
>sizer :confused:

The wx.Sizer classes aren't controls, and aren;t ever displayed. They
are collections of controls, with position and sizing relationships
described.

Anyway, in your particular case, you might be able to put everything
into a wx.Panel (as opposed to a wx.StaticBox) and use that to segregate
your application into logical areas.

Note that the docs for wxStaticBox (in wxWidgets docs) explain that
you don't put anything "in" it; you make the StaticBox a sibling of
other controls in the same group.

As you say, a wx.Panel, containing a Sizer, containing the StaticBox
and all other controls, would be ideal. The StaticBox would be used to
display the "visible border" that the original poster asked for.

···

On 18-Jun-2005, Charlie Hubbard wrote:

--
\ "If you're not part of the solution, you're part of the |
  `\ precipitate." -- Steven Wright |
_o__) |
Ben Finney <ben@benfinney.id.au>

Ben Finney wrote:

···

On 18-Jun-2005, Charlie Hubbard wrote:

Timothy Smith wrote:
   

yuck, it'd be much more logical to be able to show a border for the sizer :confused:
     
The wx.Sizer classes aren't controls, and aren;t ever displayed. They
are collections of controls, with position and sizing relationships
described.

Anyway, in your particular case, you might be able to put everything into a wx.Panel (as opposed to a wx.StaticBox) and use that to segregate your application into logical areas.
   
Note that the docs for wxStaticBox (in wxWidgets docs) explain that
you don't put anything "in" it; you make the StaticBox a sibling of
other controls in the same group.

As you say, a wx.Panel, containing a Sizer, containing the StaticBox
and all other controls, would be ideal. The StaticBox would be used to
display the "visible border" that the original poster asked for.

so if i want to group these controls together and have a border around them i have to put them on a sub panel? ugh ugly but i guess i'll have to.

Sunday, June 19, 2005, 10:23:47 PM, Timothy Smith wrote:

(...)

so if i want to group these controls together and have a border
around them i have to put them on a sub panel? ugh ugly but i guess
i'll have to.

You don't have to do that as long as you don't need different bg
colours for the groups. (And that would also prevent you from using
titles for the groups as well as make things strange as you'd have to
deal with names like 'panel.subpanel.control' instead of just
'panel.control'.)

Take a closer look into the code for the StaticBox demo (under the
'Core Windows/Controls' group) and you'll see that you just need to:

1. create a wx.Panel;
2. create a wx.StaticBox having the wx.Panel as parent;
3. create a wx.StaticBoxSizer having the wx.StaticBox as parent;
4. create any controls you want to group together as children of the
wx.Panel and add them to wx.StaticBoxSizer.

-- tacao

No bits were harmed during the making of this e-mail.

Saturday, June 18, 2005, 10:49:26 PM, Timothy Smith wrote:

yuck, it'd be much more logical to be able to show a border for the
sizer :confused:

No. Sizers were made to be invisible things. Invisible things should
never show anything. 8^)

-- tacao

No bits were harmed during the making of this e-mail.

E. A. Tacao wrote:

Sunday, June 19, 2005, 10:23:47 PM, Timothy Smith wrote:

(...)

so if i want to group these controls together and have a border
around them i have to put them on a sub panel? ugh ugly but i guess
i'll have to.
   
You don't have to do that as long as you don't need different bg
colours for the groups. (And that would also prevent you from using
titles for the groups as well as make things strange as you'd have to
deal with names like 'panel.subpanel.control' instead of just
'panel.control'.)

Take a closer look into the code for the StaticBox demo (under the
'Core Windows/Controls' group) and you'll see that you just need to:

1. create a wx.Panel;
2. create a wx.StaticBox having the wx.Panel as parent;
3. create a wx.StaticBoxSizer having the wx.StaticBox as parent;
4. create any controls you want to group together as children of the
wx.Panel and add them to wx.StaticBoxSizer.

-- tacao

No bits were harmed during the making of this e-mail.

cool that's all working like a charm. i wasn't aware of StaticBoxSizer. once i got that i was right.