Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

All programmers are playwrights and all computers are lousy actors.


devel / comp.lang.python / Re: Problem resizing a window and button placement

SubjectAuthor
o Re: Problem resizing a window and button placementGrant Edwards

1
Re: Problem resizing a window and button placement

<mailman.6.1708786017.3452.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=29538&group=comp.lang.python#29538

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: grant.b.edwards@gmail.com (Grant Edwards)
Newsgroups: comp.lang.python
Subject: Re: Problem resizing a window and button placement
Date: Fri, 23 Feb 2024 22:28:27 -0500 (EST)
Lines: 37
Message-ID: <mailman.6.1708786017.3452.python-list@python.org>
References: <06a301da66be$bfdc0da0$3f9428e0$@SGA.Ninja>
<76894f6f-551c-470a-93c7-b229c28f8b58@mrabarnett.plus.com>
<4ThXQg0JvMznVG1@mail.python.org>
X-Trace: news.uni-berlin.de Wr+lxnqdjXWZ7TSMyj3nVQfz/PDjMtIzjBAAiGvhImJg==
Cancel-Lock: sha1:EzzW3j5A9sUFt6PXDIKkVw/JggM= sha256:1jmT8B7y6z2oi4zixztLQkRSQmNZXvdvhGDZEiCjL7o=
Return-Path: <grant.b.edwards@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: UNSURE 0.336
X-Spam-Level: ***
X-Spam-Evidence: '*H*': 0.42; '*S*': 0.09; 'calculating': 0.09; "'':":
0.16; 'buttons': 0.16; 'from:addr:grant.b.edwards': 0.16;
'from:name:grant edwards': 0.16; 'locate': 0.16; 'right.': 0.16;
'url:#': 0.16; 'url:layout': 0.16; 'wrote:': 0.16; 'grant': 0.17;
'to:addr:python-list': 0.20; 'python,': 0.25; 'done': 0.28;
'wrong': 0.28; 'header:User-Agent:1': 0.30; "doesn't": 0.32;
'python-list': 0.32; 'window': 0.32; 'but': 0.32; 'definitely':
0.35; 'yes,': 0.35; 'from:addr:gmail.com': 0.35; 'work,': 0.36;
'change': 0.36; 'handle': 0.39; 'use': 0.39; 'steve': 0.39;
'something': 0.40; 'want': 0.40; 'event': 0.40; 'button': 0.64;
'spend': 0.64; 'produce': 0.65; 'url-ip:18/8': 0.67; 'url:%3':
0.67; 'url-ip:3/8': 0.67; 'message-id:invalid': 0.68; 'right':
0.68; 'url:%20': 0.71; 'little': 0.73; "you'll": 0.73; 'bind':
0.84; 'manager:': 0.84; 'said:': 0.84; 'wasting': 0.84; 'border':
0.91; 'placing': 0.91; 'manager.': 0.93; 'positions': 0.96
User-Agent: slrn/1.0.3 (Linux)
X-Mailman-Approved-At: Sat, 24 Feb 2024 09:46:55 -0500
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
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: <https://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>
X-Mailman-Original-Message-ID: <4ThXQg0JvMznVG1@mail.python.org>
X-Mailman-Original-References: <06a301da66be$bfdc0da0$3f9428e0$@SGA.Ninja>
<76894f6f-551c-470a-93c7-b229c28f8b58@mrabarnett.plus.com>
 by: Grant Edwards - Sat, 24 Feb 2024 03:28 UTC

On 2024-02-24, MRAB via Python-list <python-list@python.org> wrote:
> On 2024-02-24 01:14, Steve GS via Python-list wrote:
>
>> Python, Tkinter: How do I determine if a window has been resized? I
>> want to locate buttons vertically along the right border and need
>> to know the new width. The buttons are to move with the change of
>> location of the right-side border.
>
> Bind an event handler for '<Configure>':
>
> ----8<----
> [...]
> ----8<----
>
> Are you placing the buttons yourself? I always use layouts and they
> handle such things automatically.

Yes, definitely what he said: use a layout manager.

I hope this doesn't sound rude, but if you're calculating button
positions based on window size, you're doing it wrong and will end up
wasting a lot of time to produce something that won't work right.

Use a layout manager:

https://tkinterpython.top/layout/#:~:text=Tkinter%20has%20three%20built%2Din,%2C%20grid%20%2C%20and%20place%20managers.

https://www.pythonguis.com/tutorials/create-ui-with-tkinter-pack-layout-manager/

https://www.pythonguis.com/tutorials/use-tkinter-to-design-gui-layout/

You'll have to spend a little time learning how they work, but in the
end you'll get done sooner and have better results.

--
Grant

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor