Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Not only is UNIX dead, it's starting to smell really bad. -- Rob Pike


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

SubjectAuthor
o RE: Problem resizing a window and button placementSteve GS

1
RE: Problem resizing a window and button placement

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: Gronicus@SGA.Ninja (Steve GS)
Newsgroups: comp.lang.python
Subject: RE: Problem resizing a window and button placement
Date: Sat, 24 Feb 2024 22:58:00 -0500
Lines: 48
Message-ID: <mailman.13.1708833485.3452.python-list@python.org>
References: <06f101da66da$902357f0$b06a07d0$@SGA.Ninja>
<C72A9439-2300-4DCD-8A56-7C3AAE718EF4@barrys-emacs.org>
<070d01da66fa$5faea870$1f0bf950$@SGA.Ninja>
<31caf694-99fd-41ca-a98c-cb0d5d4a758e@tompassin.net>
<077801da6782$4f6046d0$ee20d470$@SGA.Ninja>
<13edcbad-1914-424c-97aa-3679eaf77fd8@mrabarnett.plus.com>
<07b101da6795$97d57df0$c78079d0$@SGA.Ninja>
<5d93173f-b172-408a-a052-c670214581b2@mrabarnett.plus.com>
<07c701da679e$d3a8a6f0$7af9f4d0$@SGA.Ninja>
Mime-Version: 1.0
Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de 9nHEvMlkmQ0lPz7pQ6cmJQHhOqfVhziwh2mIfTYjJQXA==
Cancel-Lock: sha1:HxlqFU2Pk9roaMcPgiyBCshp/3c= sha256:dR1VJJToFZrLZiPdtJA8MD1T7UsH0mZuk0CX4FS42Iw=
Return-Path: <Gronicus@SGA.Ninja>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=sga.ninja header.i=@sga.ninja header.b=GamVLE30;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.035
X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'def': 0.04; 'tkinter':
0.07; 'code?': 0.09; 'resizing': 0.09; 'import': 0.15;
'url:mailman': 0.15; '2024': 0.16; 'from:addr:gronicus': 0.16;
'from:addr:sga.ninja': 0.16; 'message-id:@SGA.Ninja': 0.16;
'received:floathosting.com': 0.16;
'received:mars.floathosting.com': 0.16; 'wrote:': 0.16; 'problem':
0.16; 'to:addr:python-list': 0.20; 'skip:- 10': 0.25; 'url-
ip:188.166.95.178/32': 0.25; 'url-ip:188.166.95/24': 0.25;
'url:listinfo': 0.25; 'url-ip:188.166/16': 0.25; 'it,': 0.29;
'url-ip:188/8': 0.31; 'python-list': 0.32; 'window': 0.32; 'header
:In-Reply-To:1': 0.34; 'also,': 0.36; "skip:' 10": 0.37; 'use':
0.39; 'neither': 0.39; 'steve': 0.39; 'happen': 0.40; 'helps':
0.60; 'skip:o 10': 0.61; 'from:': 0.62; 'to:': 0.62; 'skip:o 20':
0.63; 'button': 0.64; 're:': 0.64; 'within': 0.69; 'global': 0.73;
'sent:': 0.78; 'placement': 0.81; 'saturday,': 0.84; 'width': 0.91
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sga.ninja;
s=default;
h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:
Date:Subject:In-Reply-To:References:To:From:Sender:Reply-To:Cc:Content-ID:
Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
List-Post:List-Owner:List-Archive;
bh=vfytMVeGs99WN7l9A3TSskfAAlNWsh4/0aGBqviGTZM=; b=GamVLE30TkHwhFYSaIA0J450H7
D+SZCilla0nILAOiT5oVApJet9iOhDHQXnV6FZjDE6GkA7hZdWcIJPV4QylL0zvQ1C+FZECLPWzNc
LQk0YfZOEbPwqofbSo/LUPntxRgudzi6wH9V09dxaCQL0m0iKbnUwqhGLA79aUpG98Lv97XsD0llY
Y44sMBYwnUE/wet1yVMmFM1GPrfjpodldidMZHCJ3X+hwS2Pq1wGGNZ6J6+mjlw8FbiTffWhHVHjc
9VuMG798ArlD85zzZ9hjLsAGTWOlpb4TDrXwY5F9LgEoBWYxCeThjgH/37DmxwWqGMF2K/MY7bSFs
t1h4RWeg==;
In-Reply-To: <5d93173f-b172-408a-a052-c670214581b2@mrabarnett.plus.com>
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQJGy7zzXF4y2G8MeMWTWHq0fMItvQIzKKK2AzCygCMCTZHTpQJPWNtlAuepcsMCIock6AIvta91r7fQmiA=
Content-Language: en-us
X-AntiAbuse: This header was added to track abuse,
please include it with any abuse report
X-AntiAbuse: Primary Hostname - mars.floathosting.com
X-AntiAbuse: Original Domain - python.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - SGA.Ninja
X-Get-Message-Sender-Via: mars.floathosting.com: authenticated_id:
gronicus@sga.ninja
X-Authenticated-Sender: mars.floathosting.com: gronicus@sga.ninja
X-Source:
X-Source-Args:
X-Source-Dir:
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: <07c701da679e$d3a8a6f0$7af9f4d0$@SGA.Ninja>
X-Mailman-Original-References: <06f101da66da$902357f0$b06a07d0$@SGA.Ninja>
<C72A9439-2300-4DCD-8A56-7C3AAE718EF4@barrys-emacs.org>
<070d01da66fa$5faea870$1f0bf950$@SGA.Ninja>
<31caf694-99fd-41ca-a98c-cb0d5d4a758e@tompassin.net>
<077801da6782$4f6046d0$ee20d470$@SGA.Ninja>
<13edcbad-1914-424c-97aa-3679eaf77fd8@mrabarnett.plus.com>
<07b101da6795$97d57df0$c78079d0$@SGA.Ninja>
<5d93173f-b172-408a-a052-c670214581b2@mrabarnett.plus.com>
 by: Steve GS - Sun, 25 Feb 2024 03:58 UTC

So, how do I use the width value in my code?

SGA

-----Original Message-----
From: Python-list <python-list-bounces+gronicus=sga.ninja@python.org> On Behalf Of MRAB via Python-list
Sent: Saturday, February 24, 2024 10:36 PM
To: python-list@python.org
Subject: Re: Problem resizing a window and button placement

On 2024-02-25 02:51, Steve GS wrote:
> import tkinter as tk
>
> #global Ww Neither global helps
> def on_configure(*args):
> # print(args)
> #global Ww Neither global helps
> Ww = root.winfo_width()
> print("WwInside = <" + str(Ww) + ">")
>
> root = tk.Tk()
> root.bind('<Configure>', on_configure) print("WwOutside = <" + str(Ww)
> + ">")
> #NameError: name 'Ww' is not defined
> root.mainloop()
'Ww' won't exist until 'on_configure' assigns to it, and that won't happen until `mainloop` starts.

Also, 'global' works only within a function.

----8<----

import tkinter as tk

def on_configure(event):
print(f'{event.width=}, {event.height=}')

root = tk.Tk()
root.bind('<Configure>',on_configure)
root.mainloop()

----8<----

--
https://mail.python.org/mailman/listinfo/python-list

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor