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


Groups > comp.lang.python > #21157

Re: How do you use the widgets in tkinter.ttk if you want to "import tkinter as tk"?

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!multikabel.net!newsfeed10.multikabel.net!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'suppose': 0.05; 'received:verizon.net': 0.07; 'terry': 0.07; 'python': 0.08; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'tkinter': 0.09; 'anyway': 0.09; 'differently,': 0.16; 'docs,': 0.16; 'reedy': 0.16; 'subject: \n ': 0.16; 'subject:import': 0.16; 'this:': 0.16; 'wrote:': 0.18; 'jan': 0.19; 'header:In-Reply- To:1': 0.22; 'name?': 0.23; 'subject:use': 0.24; 'import': 0.27; 'not.': 0.28; 'separate': 0.28; 'possible?': 0.29; 'replaced': 0.29; 'pm,': 0.29; 'object.': 0.30; 'equivalent': 0.31; 'header :User-Agent:1': 0.33; 'header:X-Complaints-To:1': 0.34; 'to:addr :python-list': 0.35; 'however,': 0.35; 'subject:How': 0.35; 'received:org': 0.36; 'but': 0.37; 'using': 0.37; 'replace': 0.38; 'cannot': 0.39; 'to:addr:python.org': 0.40; 'john': 0.61; 'believe': 0.65; 'utilize': 0.68; 'subject:you': 0.78; 'subject:want': 0.93
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: How do you use the widgets in tkinter.ttk if you want to "import tkinter as tk"?
Date Fri, 02 Mar 2012 21:47:30 -0500
References <29015333.101.1330739333318.JavaMail.geo-discussion-forums@vbbgt10>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host pool-74-109-121-73.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0
In-Reply-To <29015333.101.1330739333318.JavaMail.geo-discussion-forums@vbbgt10>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.359.1330742876.3037.python-list@python.org> (permalink)
Lines 29
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1330742876 news.xs4all.nl 6903 [2001:888:2000:d::a6]:37395
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:21157

Show key headers only | View raw


On 3/2/2012 8:48 PM, John Salerno wrote:
> According to the Python docs, the way to use tkinter.ttk is this:
>
> from tkinter import *
> from tkinter.ttk import *

I suppose the 'advantage' of this is that it will replace tk widgets 
with equivalent ttk widgets, if they exist and have the same name. I 
believe one has to program them differently, however, so the replacement 
cannot be transparent and one mush know anyway what gets replaced and 
what not.

> But what if I don't like this import method and prefer to do:
>
> import tkinter as tk
>
> How then do I utilize tkinter.ttk using the same name?
 > Or is that not possible? Will I have to use to separate names, like this:

No. One name for one object.

> import tkinter as tk
> import tkinter.ttk as ttk

Yes

-- 
Terry Jan Reedy

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


Thread

How do you use the widgets in tkinter.ttk if you want to "import tkinter as tk"? John Salerno <johnjsal@gmail.com> - 2012-03-02 17:48 -0800
  Re: How do you use the widgets in tkinter.ttk if you want to "import tkinter as tk"? Terry Reedy <tjreedy@udel.edu> - 2012-03-02 21:47 -0500
    Re: How do you use the widgets in tkinter.ttk if you want to "import tkinter as tk"? Ben Finney <ben+python@benfinney.id.au> - 2012-03-03 14:34 +1100
    Re: How do you use the widgets in tkinter.ttk if you want to "import tkinter as tk"? John Salerno <johnjsal@gmail.com> - 2012-03-02 21:06 -0800
      Re: How do you use the widgets in tkinter.ttk if you want to "import tkinter as tk"? Rick Johnson <rantingrickjohnson@gmail.com> - 2012-03-04 17:39 -0800
        Re: How do you use the widgets in tkinter.ttk if you want to "import tkinter as tk"? Westley Martínez <anikom15@gmail.com> - 2012-03-04 18:04 -0800
        Re: How do you use the widgets in tkinter.ttk if you want to "import tkinter as tk"? John Salerno <johnjsal@gmail.com> - 2012-03-04 21:53 -0800
      Re: How do you use the widgets in tkinter.ttk if you want to "import tkinter as tk"? Kevin Walzer <kw@codebykevin.com> - 2012-03-04 20:58 -0500
    Re: How do you use the widgets in tkinter.ttk if you want to "import tkinter as tk"? John Salerno <johnjsal@gmail.com> - 2012-03-02 21:06 -0800

csiph-web