[Tutor] Frames and the grid manager

Alan Gauld alan.gauld at blueyonder.co.uk
Sat Aug 21 20:28:25 CEST 2004

Hi Klas,

> I have desigend a small gui for my convert program. I 
> have used the grid manager and placed everything in the 
> master frame. I now plan to expand my program a bit 
> more to make it possible to convert a few other types 
> of files. I then think it would be best to separate 
> my gui into frames. 

Frames are just widgets like any other widget. You can use them 
with the grid or packer or placer. You just treat the whole frame 
as a unit. In fact you can even use the packer to place controls 
inside a frame with is itself placed via a grid. Or you can use 
a grid in the Frame but the packer to stack up the frames. 

This is how I tend to build my GUIs - I use a grid or the packer 
to build frames which make up horizontal strips of my interface 
and then pack the frames on top of each other to form the final 
outer frame. For example:


Or if I wanted the buttons down the right hand side I'd put
the menu and toolbar along the top then create a grid with 
the input &  display on the left, the buttons on the right
and finally the statusbar at the bottom.

Using frames for building GUIs is a lot like using functions 
to write code, you can very easily move things around and 
reorganize the GUI using frames. This is one reason I find 
most graphical GUI builders counter productive, its much 
faster to reshape a GUI when I'm using the Python prompt 
and a few predefined frames than moving stuff about in 
a GUI builder.

Have you tried creating a frame with some of your controls in
and putting it onto your grid? What problems did you get?
Alan G.

More information about the Tutor mailing list