Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #21235

Re: Tkinter: Why aren't my widgets expanding when I resize the window?

From John Salerno <johnjsal@gmail.com>
Newsgroups comp.lang.python
Subject Re: Tkinter: Why aren't my widgets expanding when I resize the window?
Date 2012-03-05 09:31 -0800
Organization http://groups.google.com
Message-ID <19872402.359.1330968669581.JavaMail.geo-discussion-forums@ynnj12> (permalink)
References <32271364.3080.1330931558529.JavaMail.geo-discussion-forums@ynjd19> <bf09a908-2b08-42cb-b856-7be04b1ef7b1@r1g2000yqk.googlegroups.com>

Show all headers | View raw


> You will need to configure the root columns and rows also because the
> configurations DO NOT propagate up the widget hierarchy! Actually, for
> this example, I would recommend using the "pack" geometry manager on
> the frame. Only use grid when you need to use grid. Never use any
> functionality superfluously! Also, you should explicitly pack the
> frame from OUTSIDE frame.__init__()!

Ok, so use pack when putting the frame into the root, since that's all that goes into the root directly. But just out of curiosity, what did I do wrong with using grid? How would it work with grid?


> from tkinter.constants import BOTH, YES

> I always use either:
> 
>  sticky='nswe'
>  sticky=N+S+W+E

This is something I'm not too thrilled with. I don't like importing things piecemeal. I suppose I could do:

import tkinter.constants as tkc (or something like that)

and qualify each constant. Seems like more work, but it just seems better than having to manage each constant that I need in the import list.

Also, N+S+E+W and (N, S, E, W) don't seem to work unless qualified, so that's four more constants I'd have to explicitly import. And (tk.N, tk.S, tk.E, tk.W) is just horrible to look at.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Tkinter: Why aren't my widgets expanding when I resize the window? John Salerno <johnjsal@gmail.com> - 2012-03-04 23:12 -0800
  Re: Tkinter: Why aren't my widgets expanding when I resize the window? Rick Johnson <rantingrickjohnson@gmail.com> - 2012-03-05 05:09 -0800
    Re: Tkinter: Why aren't my widgets expanding when I resize the window? John Salerno <johnjsal@gmail.com> - 2012-03-05 09:31 -0800
      Re: Tkinter: Why aren't my widgets expanding when I resize the window? Rick Johnson <rantingrickjohnson@gmail.com> - 2012-03-05 11:03 -0800
        Re: Tkinter: Why aren't my widgets expanding when I resize the window? John Salerno <johnjsal@gmail.com> - 2012-03-05 14:07 -0800
          Re: Tkinter: Why aren't my widgets expanding when I resize the window? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-03-06 01:10 +0000
            Re: Tkinter: Why aren't my widgets expanding when I resize the window? John Salerno <johnjsal@gmail.com> - 2012-03-05 17:53 -0800
            Re: Tkinter: Why aren't my widgets expanding when I resize the window? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-03-06 01:58 +0000
            Re: Tkinter: Why aren't my widgets expanding when I resize the window? Rick Johnson <rantingrickjohnson@gmail.com> - 2012-03-05 18:20 -0800
              Re: Tkinter: Why aren't my widgets expanding when I resize the window? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-03-06 02:33 +0000
                Re: Tkinter: Why aren't my widgets expanding when I resize the window? Rick Johnson <rantingrickjohnson@gmail.com> - 2012-03-05 18:56 -0800
                Re: Tkinter: Why aren't my widgets expanding when I resize the window? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-03-06 03:09 +0000
  Re: Tkinter: Why aren't my widgets expanding when I resize the window? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-03-05 12:25 -0500

csiph-web