Setting up sizers

Perhaps someone can help me understand how to use sizers better. I have
created below a rough ASCII_art version of my gui. The first box is an
output box that writes each step as it happens. The next is a RadioBox for
selecting the input source. Then there are three buttons. Finally there is
another RadioBox for selecting the mode. The use of the gui
notwithstanding, how should I set up sizers for these objects for a decent
layout. I welcome layout comments, but please send them to me rather than
the list so as not to waste everyone's time. I had intended to center the
input source RadioBox, but it likes to be on the left, so I have left it
there. :slight_smile:

--vicki

------------------------------------------------------------------------|
                                                                       >
                                                                       >
------------------------------------------------------------------------|

Select input source:
O Select Command Below O Read Input from File

                                 __ __________________________
         Please select command: |__| |__________________________|

···

______________________
                          > >
                          >_Button 1____________|

                          ______________________
                          > >
                          >_Button 2____________|

                          ______________________
                          > >
                          >_Button 3____________|

                              O Mode1 O Mode2

Vicki Stanfield wrote:

Perhaps someone can help me understand how to use sizers better. I have
created below a rough ASCII_art version of my gui. The first box is an
output box that writes each step as it happens. The next is a RadioBox for
selecting the input source. Then there are three buttons. Finally there is
another RadioBox for selecting the mode. The use of the gui
notwithstanding, how should I set up sizers for these objects for a decent
layout. I welcome layout comments, but please send them to me rather than
the list so as not to waste everyone's time. I had intended to center the
input source RadioBox, but it likes to be on the left, so I have left it
there. :slight_smile:

--vicki

------------------------------------------------------------------------|
                                                                       >
------------------------------------------------------------------------|

Select input source:
O Select Command Below O Read Input from File

                                __ __________________________
        Please select command: |__| |__________________________|

                         ______________________
                         > >
                         >_Button 1____________|

                         ______________________
                         > >
                         >_Button 2____________|

                         ______________________
                         > >
                         >_Button 3____________|

                             O Mode1 O Mode2

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

Hi Vicki,

I'm not all that experienced with wxPython but I think this will work (in the following order):

1. Make your main sizer a vertical sizer
2. Insert the output box into the main sizer
3. Insert the 'Select input source' label into the main sizer
4. Insert a horizontal sizer into the main sizer
5. Insert the two radio buttons into the horizontal sizer
6. Insert another horizontal box into the main sizer
7. Insert the 'please select command' label and (textbox?) into this horizontal sizer
8. Insert each of the 3 buttons into the main sizer.
9. Insert another horizontal sizer into the main sizer.
10. Insert the radio buttons into this horizontal sizer.

Hope this helps,

Regards,
Wayne

P.S. Nice ASCII art :wink:

Perhaps someone can help me understand how to use sizers better. I have
created below a rough ASCII_art version of my gui. The first box is an
output box that writes each step as it happens. The next is a RadioBox for
selecting the input source. Then there are three buttons. Finally there is
another RadioBox for selecting the mode. The use of the gui
notwithstanding, how should I set up sizers for these objects for a decent
layout. I welcome layout comments, but please send them to me rather than
the list so as not to waste everyone's time. I had intended to center the
input source RadioBox, but it likes to be on the left, so I have left it
there. :slight_smile:

[layout snipped]

You might get something out of my sizers tutorial at
What Do These Sizer Things Do? . The sample code is in C++,
but the concepts are the same.

As for your particular layout, it looks like you could get away with a
single vertical box sizer at the top, with buttons and horizontal sizers
added to it. For example,

                                __ __________________________
        Please select command: |__| |__________________________|

This could be a horizontal box sizer with a wxStaticText, and whatever
controls you want those to be. You then add that sizer to the vertical
box sizer.

Hope this helps,

···

On Wed, Dec 17, 2003 at 01:20:47PM -0500, Vicki Stanfield wrote:

--
Brian

Vicki Stanfield wrote:

Perhaps someone can help me understand how to use sizers better. I have
created below a rough ASCII_art version of my gui. The first box is an
output box that writes each step as it happens. The next is a RadioBox for
selecting the input source. Then there are three buttons. Finally there is
another RadioBox for selecting the mode. The use of the gui
notwithstanding, how should I set up sizers for these objects for a decent
layout. I welcome layout comments, but please send them to me rather than
the list so as not to waste everyone's time. I had intended to center the
input source RadioBox, but it likes to be on the left, so I have left it
there. :slight_smile:

Use a wxBoxSizer(wxVERTICAL) for the row groupings, with subsizers as needed for the rows that have multiple items. You can use the alignment flags when adding items to center them within their allotted space, or whatever is needed.

···

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

You might get something out of my sizers tutorial at
What Do These Sizer Things Do? . The sample code is in C++,
but the concepts are the same.

Thanks, I had lost the link to that tutorial. I'll take a look at it and
see if it clears anything up.

--vicki

Read this page in the WIki...it should help

http://wiki.wxpython.org/index.cgi/UsingSizers

Then set up a simple app that contains your best attempt at how to do
what you want, and it's not quite right, post it here with a question.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Vicki Stanfield wrote:

> You might get something out of my sizers tutorial at
> What Do These Sizer Things Do? . The sample code is in C++,
> but the concepts are the same.

Thanks, I had lost the link to that tutorial. I'll take a look at it and
see if it clears anything up.

Vicki,

A nice way to learn might be to translate that tutorial to Python, and
then you could put it in the Wiki...hint, hint.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Vicki,

A nice way to learn might be to translate that tutorial to Python, and
then you could put it in the Wiki...hint, hint.

-Chris

Thanks, I might do that if I get time over the holidays. It seems to me
that there are significant issues (at least for beginners) not addressed
by the two tutorials that I have seen. I remember when I learned Motif,
having to acquaint myself with how the order of the creation of sizers and
widgets and their add statements affected the look of the created gui and
exactly which step in the process actually drew the widgets. [It has been
a long time since I have written Motif code, so I have lost a great deal
of what I learned then.] Likewise I remember having to create code and
alter it many times to get the feel of things. For instance, I believe
that the order of creation for the supersizer (what I call the large
vertical sizer in my example) and all it's subordinate sizers and widgets
should be discussed somewhere. And there are several ways to affect
changes in the widget layout. For instance, I seem to get the same result
whether I use the wxRB_SINGLE style within a vertical sizer or create a
horizontal sizer without specifying the wxRB_SINGLE at least when the
sizer contains buttons. There is an abundance of information to be
digested, so let me see if I can translate it into wxPython newbie.

--vicki

Vicki Stanfield wrote:

It seems to me
that there are significant issues (at least for beginners) not addressed
by the two tutorials that I have seen.

It is hard to learn.

I remember when I learned Motif,
having to acquaint myself with how the order of the creation of sizers and
widgets and their add statements affected the look of the created gui

I don't think this is critical in wx. The only difference that order of
creation makes is that tab-order is determined by creation order, but
that is separate from sizers.

Likewise I remember having to create code and
alter it many times to get the feel of things.

That's been the case for me too, but it's a lot easier in Python!
wxDEsigner is worth checking out too...you get a gui to set things up,
and you can preview the results right in the GUI. It's not free,
however.

For instance, I believe
that the order of creation for the supersizer (what I call the large
vertical sizer in my example) and all it's subordinate sizers and widgets
should be discussed somewhere.

It's probably not because it doesn't matter, except that you can't add a
sizer to another sizer untill you've created it, which should be
obvious!

And there are several ways to affect

changes in the widget layout. For instance, I seem to get the same result
whether I use the wxRB_SINGLE style within a vertical sizer or create a
horizontal sizer without specifying the wxRB_SINGLE at least when the
sizer contains buttons.

I don't think wxRB_SINGLE has anything to do with sizers, it has to so
with how the interaction betweent he buttons is handled by the system.

There is an abundance of information to be
digested, so let me see if I can translate it into wxPython newbie.

That would be fabulous.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                        
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov