Re: Changing size of sub frame
IvorW <[email protected]> Fri, 03 Nov 2006 20:41:07 +0000
| Newsgroups | gmane.comp.lang.perl.tk |
|---|---|
| Message-ID | <[email protected]> |
Watson, Keith R. wrote: >I'm writing some Perl/TK code and I can't figure out how to >programmatically change the position of a sub frame. I can read and >change the size of the main window but I can't figure out how to read or >change the position of the sub frame. The plan is to be able to let the >user change the size of the window and position of the adjuster and save >the settings on exit so the app comes up in the same configuration the >next time they run it. > >I've scoured "Learning Perl/TK", "Mastering Perl/TK", and Google and >haven't found a solution. Below is some code that demonstrates the >problem. > > In the example you have given, you are using the geometry manager called "pack". This doesn't give you control of the position of subwidgets - they are all alligned in sequence against one or other of the edges (top, bottom, left, right). You can change the order of them by repacking, but you can't move them. To allow repositioning, you need to use a different geometry manager. "place" is the one that gives you absolute positioning and sizing of your subwidgets, but you will need to do the calculations yourself. An alternative is to use a canvas, which may be more appropriate depending on what it is you are untimately wanting to do. The answers are in the books you have mentioned, and in the documentation that comes with Tk. Hopefully I've given you enough terms to look up, to find what you want. Ivor. --++**==--++**==--++**==--++**==--++**==--++**==--++**== ptk mailing list [email protected] https://mailman.stanford.edu/mailman/listinfo/ptk