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


Groups > comp.lang.python > #21240

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 14:07 -0800
Organization http://groups.google.com
Message-ID <20757474.2202.1330985225312.JavaMail.geo-discussion-forums@ynlt17> (permalink)
References <32271364.3080.1330931558529.JavaMail.geo-discussion-forums@ynjd19> <bf09a908-2b08-42cb-b856-7be04b1ef7b1@r1g2000yqk.googlegroups.com> <19872402.359.1330968669581.JavaMail.geo-discussion-forums@ynnj12> <01a0499e-616f-4395-95d2-b6e54e03bc79@i5g2000yqo.googlegroups.com>

Show all headers | View raw


> > I don't like importing things piecemeal. I suppose I could do:
> 
> So you prefer to pollute? How bout we just auto import the whole
> Python stdlib so you can save a few keystrokes?

> > 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.
> 
> Wah!
> 
> Stop whining and act like a professional! You complain about
> qualifying constants but you happily type "self" until your fingers
> bleed without even a whimper???
> 
> Look, either import ONLY the constants you need, or qualify each
> constant with a module name/variable; that is the choices available to
> a professional. Or, just be lazy and pollute your namespace.
> 
> FYI: Lazy coders get what they deserve in the end.

How exactly am I being lazy and polluting the namespace? I never said I wanted to use the "*" import method, if that's what you are (wrongly) assuming. I said it seems cleaner and, to me, LESS lazy to import the whole module as "import tkinter.constants as tkc" and qualify everything. It's certainly more explicit than importing constants on an as-needed basis, having an ever-increasing list of constants, and referring to them unqualified in the code.

Yes, I complain that tk.N, tk.S, etc. is ugly to look at, but I'm saying it seems like a better way than using them unqualified, unless maybe there is yet another, better way.

As far as using "self" all the time, how do you know I never "whimpered" about it? The first time I learned about it I DIDN'T like it, because it seemed like a lot of unnecessary typing, but eventually I came to accept it because 1) you HAVE to do it, unlike the various options for referring to these constants, and 2) I began to like the explicitness of qualifying everything with "self."

You are very helpful, but you sure like to throw around the term "lazy" a little too unabashedly. I never said I wanted to import with "*", which you seem to think I want to do. I LIKE qualifying things, which is the reason I didn't care so much for your method of importing the constants by name.

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