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


Groups > comp.lang.python > #102132

Re: Tkinter spacing

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Peter Otten <__peter__@web.de>
Newsgroups comp.lang.python
Subject Re: Tkinter spacing
Date Tue, 26 Jan 2016 17:39:46 +0100
Organization None
Lines 43
Message-ID <mailman.20.1453826400.2338.python-list@python.org> (permalink)
References <e8736485-c4d6-4868-8da1-64ada4767bc1@googlegroups.com> <9ce727b5-db2d-41a1-ab51-e32f8ec614c8@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding 7Bit
X-Trace news.uni-berlin.de vaeSbe9QrEMVo3LU3I3Y2Qxrmm237nWkvgPjmou2du8w==
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.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'root': 0.04; 'canvas': 0.07; 'grid': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; '...)': 0.16; 'idle,': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'received:t-ipconnect.de': 0.16; 'subject:Tkinter': 0.16; 'tk()': 0.16; 'wrote:': 0.16; 'tkinter': 0.22; 'import': 0.24; 'script': 0.25; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'cancel': 0.27; 'strongly': 0.30; 'window': 0.30; 'gives': 0.35; 'mix': 0.35; 'but': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'to:addr:python.org': 0.40; 'received:de': 0.40; 'email addr:gmail.com': 0.62; 'per': 0.62; 'panel': 0.63; 'picked': 0.66; '3))': 0.84; 'ttk': 0.84; 'window,': 0.84
X-Injected-Via-Gmane http://gmane.org/
X-Gmane-NNTP-Posting-Host p57bd9df8.dip0.t-ipconnect.de
User-Agent KNode/4.13.3
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:102132

Show key headers only | View raw


high5storage@gmail.com wrote:

>> from tkinter import *
>> from tkinter import ttk
>> 
>> root = Tk()
>> root.geometry("822x600+100+100")
>> nav_bar = ttk.Frame(root, borderwidth=2, relief='ridge', padding=(10, 3,
>> 10, 3))
>> 
>> btn_first  = ttk.Button(nav_bar, text='|<', width=4)  # for buttons
>> root.mainloop()
> 
> Hmm - this only gives me an empty window (no errors).

That's strange. 

If you ran the script in Idle, try again from the commandline.

> What puzzles me that every book/site on tkinter strongly warns of mixing
> pack and grid managers...

You can mix pack and grid for one window, but you have to pick one layout 
manager per parent widget:

top = Toplevel(root)

panel = Frame(top)
panel.pack(...) 
# we picked pack() and now have to use it for all
# children of top
canvas = Canvas(top, ...)
canvas.pack(...) # must use pack() again

# we are free to pick a layout for panel
ok = Button(panel)
ok.grid(...)
# we picked grid() and now have to use it for all 
# children of panel
cancel = Button(panel)
cancel.grid(...) # must use grid()

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


Thread

Tkinter spacing KP <kai.peters@gmail.com> - 2016-01-25 19:41 -0800
  Re: Tkinter spacing Peter Otten <__peter__@web.de> - 2016-01-26 09:07 +0100
  Re: Tkinter spacing high5storage@gmail.com - 2016-01-26 07:55 -0800
    Re: Tkinter spacing Peter Otten <__peter__@web.de> - 2016-01-26 17:39 +0100
  Re: Tkinter spacing high5storage@gmail.com - 2016-01-26 14:48 -0800
    Re: Tkinter spacing Christian Gollwitzer <auriocus@gmx.de> - 2016-01-27 07:50 +0100
  Re: Tkinter spacing Christian Gollwitzer <auriocus@gmx.de> - 2016-01-27 07:48 +0100

csiph-web