Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

I surely do hope that's a syntax error. -- Larry Wall in <199710011752.KAA21624@wall.org>


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

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

1
RE: RE: Problem resizing a window and button placement

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

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=25366&group=comp.lang.python#25366

  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: RE: Problem resizing a window and button placement
Date: Sun, 25 Feb 2024 16:19:57 -0500
Lines: 70
Message-ID: <mailman.15.1708896005.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>
<dd484037-16c8-b707-89f6-99f327207913@yahoo.co.uk>
<083301da6830$63224480$2966cd80$@SGA.Ninja>
Mime-Version: 1.0
Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de abyanwSOOmYEZRNtrsW8GQ1NXSyvkOZFG7obHauzDpHQ==
Cancel-Lock: sha1:H0CryaypQwfp0nXNfYI+0HXLrNI= sha256:XHpDmfN9sYSjC7T5/A/E+4y1TXvoPCjw20hjGeVU8cc=
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=cN+HJetS;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.004
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'def': 0.04; 'traceback':
0.04; '(most': 0.05; 'last):': 0.05; 'tkinter': 0.07; 'fails':
0.09; 'resizing': 0.09; 'suggestion,': 0.09; 'typeerror:': 0.09;
'import': 0.15; '2024': 0.16; 'flickr': 0.16;
'from:addr:gronicus': 0.16; 'from:addr:sga.ninja': 0.16; 'gauld':
0.16; 'message-id:@SGA.Ninja': 0.16; 'photo-blog': 0.16;
'received:floathosting.com': 0.16;
'received:mars.floathosting.com': 0.16; 'url-ip:79.170.44.132/32':
0.16; 'url-ip:79.170.44/24': 0.16; 'url-ip:79.170/16': 0.16; 'url-
ip:79/8': 0.16; 'url:alan-g': 0.16; 'url:alan_gauld': 0.16;
'url:alangauldphotos': 0.16; 'variable,': 0.16; 'wrote:': 0.16;
'problem': 0.16; 'uses': 0.19; 'url:amazon': 0.19; 'to:addr
:python-list': 0.20; 'maybe': 0.22; 'code': 0.23; 'skip:- 10':
0.25; 'function': 0.27; 'program': 0.31; 'here,': 0.32; 'python-
list': 0.32; 'window': 0.32; 'but': 0.32; 'header:In-Reply-To:1':
0.34; 'close': 0.35; 'fix': 0.36; 'author': 0.37; 'file': 0.38;
'use': 0.39; 'steve': 0.39; 'alan': 0.40; 'learn': 0.40; 'skip:0
20': 0.61; 'skip:o 10': 0.61; 'from:': 0.62; 'to:': 0.62; '25,':
0.62; 'follow': 0.62; 'skip:o 20': 0.63; 'button': 0.64; 're:':
0.64; 'bad': 0.67; 'outside': 0.67; 'url-ip:18/8': 0.67; 'adds':
0.69; 'url:author': 0.69; 'site': 0.70; 'interesting': 0.71;
'global': 0.73; 'sent:': 0.78; 'placement': 0.81; 'extra': 0.84;
'itself.': 0.84; 'me:': 0.91; '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=BNEmyjvPfiwHT/5dIwW+mJyNpXnkTfocqO5STM3NJRI=; b=cN+HJetS3AiTo+irAx2HSeDI5F
P6DPrvty7ksCqS49GiMIllE5Ls0/mgIsnc0xth+6WmA8lKb/H/4y11uDOBPEprb4iXd+xJtZEv/cL
U6FdA6A+RTAHxBEc6Y6RRO/Wb9CS7N34cXwHQTcSBRVcUsusyi096VEZej2JADB61nDn7fK3naEwy
Mn0ngudo2zKh/pQoHHMgv8UZyamGzbauB12dRlXv4gStgrIfVZNSPjqpjT9eLjLLLhvnCEPttZOAj
tVMewN45Bttvtq7LDAY3mxB1DDfF2Pkr+CbWuU2BGu8PUy5F4knAPOfpwl0cLvLp/G6k8SMG9iwLg
Ns65MqeQ==;
In-Reply-To: <dd484037-16c8-b707-89f6-99f327207913@yahoo.co.uk>
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQJGy7zzXF4y2G8MeMWTWHq0fMItvQIzKKK2AzCygCMCTZHTpQJPWNtlAuepcsMCIock6AIvta91AZpYCAsBx1Fa36+d4nBA
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: <083301da6830$63224480$2966cd80$@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>
<07c701da679e$d3a8a6f0$7af9f4d0$@SGA.Ninja>
<dd484037-16c8-b707-89f6-99f327207913@yahoo.co.uk>
 by: Steve GS - Sun, 25 Feb 2024 21:19 UTC

SOLUTION FOUND!

The fix was to write the code that uses the width value and to place it into the function itself.
Kluge? Maybe but it works.

Mischief Managed.

=======================As for the most recent suggestion, it fails for me:

Traceback (most recent call last):
File "F:/___zInsulin Code A 08-02-23/WinPic/IOWw.pyw", line 14, in <module>
print("Ww Outside = <" + str(Ww) > + ">")
TypeError: bad operand type for unary +: 'str'

With the need to close the window, it adds an extra step and intervention to the program to use. I am not sure how this help[s.

As a curio, it would be interesting to see how to use the value of a variable, created in the function used here, and make it available to the code outside the function.

SGA

-----Original Message-----
From: Alan Gauld <learn2program@gmail.com>
Sent: Sunday, February 25, 2024 12:44 PM
To: Steve GS <Gronicus@SGA.Ninja>; python-list@python.org
Subject: Re: RE: Problem resizing a window and button placement

On 25/02/2024 03:58, Steve GS via Python-list wrote:
import tkinter as tk

Ww = None

def on_configure(*args):
global Ww
Ww = root.winfo_width()
print("Ww Inside = <" + str(Ww) + ">")

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

print("Ww Outside = <" + str(Ww) > + ">")

Produces:
Ww Inside = <200>
Ww Inside = <200>
Ww Inside = <205>
Ww Inside = <205>
Ww Inside = <206>
Ww Inside = <206>
Ww Outside = <206>

HTH

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor