Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Breadth-first search is the bulldozer of science. -- Randy Goebel


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

SubjectAuthor
o Re: Problem resizing a window and button placementMRAB

1
Re: Problem resizing a window and button placement

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: python@mrabarnett.plus.com (MRAB)
Newsgroups: comp.lang.python
Subject: Re: Problem resizing a window and button placement
Date: Sun, 25 Feb 2024 03:36:04 +0000
Lines: 33
Message-ID: <mailman.11.1708832352.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>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de 1R+ADKYxol3rS+HfMVkilgH3dHvI6VFvtigH0ti79D8g==
Cancel-Lock: sha1:Vqh7aQKybQMc+lpHJ48A/qQCMAs= sha256:0SHr2mc51rsbVlS9wJmzx7eMX5+oWcUFmUZYlYEoy8M=
Return-Path: <python@mrabarnett.plus.com>
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=plus.com header.i=@plus.com header.b=POnjh6gG;
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.021
X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'def': 0.04; 'tkinter':
0.07; 'from:addr:python': 0.09; 'received:192.168.1.64': 0.09;
'import': 0.15; 'from:addr:mrabarnett.plus.com': 0.16;
'from:name:mrab': 0.16; 'message-id:@mrabarnett.plus.com': 0.16;
'received:plus.net': 0.16; 'wrote:': 0.16; 'to:addr:python-list':
0.20; 'it,': 0.29; 'header:User-Agent:1': 0.30;
'received:192.168.1': 0.32; 'header:In-Reply-To:1': 0.34; 'also,':
0.36; "skip:' 10": 0.37; 'received:192.168': 0.37; 'neither':
0.39; 'steve': 0.39; 'happen': 0.40; 'helps': 0.60; 'skip:o 10':
0.61; 'received:212': 0.62; 'skip:o 20': 0.63; 'within': 0.69;
'global': 0.73
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019;
t=1708832165; bh=IT2vfRbmADMMIpU83VUHYFXlJMxKBG9k/CYWxeBjul8=;
h=Date:Subject:To:References:From:In-Reply-To;
b=POnjh6gGwtQ3xt8NjLzKCKbUpQf+FU0PlURRlm0axIL8GhYs+0YYNm2zWp5O3RfCX
AcYk88+YCclstzaSvbTyZseMjKdidopiV+QrzoZIv3HYuQE7J5UIC0BlYiEbvZuqJo
KGOojeOjnKJHiClOwqD+Qd1AJt0sV9LqVQMPbxuWNb3woDj7O1Wp4befbu6bx0ryPB
RGfhiw7o/YAjjykGw93zkPvn0ewGZTqVuEW9plieO5KEnCuEQylsw2fRG29MhC3Bm+
h7Ve0Li0f3hZbWa7j68wY28bWKl5NDswKL5FsRZMQaDFGYhvd6Cttqoc9D2LpRkrcc
GxI2C6eZxjWvA==
X-Clacks-Overhead: "GNU Terry Pratchett"
X-CM-Score: 0.00
X-CNFS-Analysis: v=2.4 cv=AacSHGXG c=1 sm=1 tr=0 ts=65dab5a5
a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17
a=IkcTkHD0fZMA:10 a=gJVnBG7XAAAA:8 a=qFQf0ZSLHDjQOTYUV0UA:9 a=3ZKOabzyN94A:10
a=QEXdDO2ut3YA:10 a=eP4t8ZpUoh57DiAYbYVe:22
X-AUTH: mrabarnett@:2500
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
In-Reply-To: <07b101da6795$97d57df0$c78079d0$@SGA.Ninja>
X-CMAE-Envelope: MS4xfM8YPdkIBaK3yJQLBNN5yvrcGqgna+a9ENNU6JtlOX0VVGUdygCSdQ1pvfsUu+NJ1OrOxhajBfTfxmzv2mDo2us+AuCAue0sQ42Xkwk02zlkeoFQ1tWk
vdAeZIArhnjWPp0l3fprVEFCj3XsPK/jg0YLSk72w85hIgiPqJa9FRz+m9qddhIc7Q26OWPk9aNewIBXG4HFYeq2LtpNfJOvrl8=
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: <5d93173f-b172-408a-a052-c670214581b2@mrabarnett.plus.com>
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>
 by: MRAB - Sun, 25 Feb 2024 03:36 UTC

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<----

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor