Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Fascinating, a totally parochial attitude. -- Spock, "Metamorphosis", stardate 3219.8


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.18.1708934208.3452.python-list@python.org>

  copy mid

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

  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: Mon, 26 Feb 2024 02:56:35 -0500
Lines: 137
Message-ID: <mailman.18.1708934208.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>
<cd441398-c4d4-4d33-9df7-43163b1d856d@tompassin.net>
<087801da6889$52395bf0$f6ac13d0$@SGA.Ninja>
Mime-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de pSIMilv9XinUntluE/quDQO8H8NxLtAMjor2vQOVf1wg==
Cancel-Lock: sha1:UVNci4+cgNEZqJ2Kukjzuv+psUQ= sha256:Lu2zxC2jSMFesp8rCcZeusyOJGUxauOuaY8JLMJ56oU=
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=ULu0+uJX;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.007
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; '"have': 0.16; '2024': 0.16; 'elsewhere': 0.16;
'far,': 0.16; 'from:addr:gronicus': 0.16; 'from:addr:sga.ninja':
0.16; 'gauld': 0.16; 'message-id:@SGA.Ninja': 0.16;
'received:floathosting.com': 0.16;
'received:mars.floathosting.com': 0.16; 'value?': 0.16;
'variable,': 0.16; 'wrote:': 0.16; 'problem': 0.16; 'code.': 0.17;
'uses': 0.19; 'pm,': 0.19; 'to:addr:python-list': 0.20; 'maybe':
0.22; 'code': 0.23; 'idea': 0.24; 'skip:- 10': 0.25; 'url-
ip:188.166.95.178/32': 0.25; 'url-ip:188.166.95/24': 0.25;
'discussion': 0.25; 'cannot': 0.25; 'url-ip:188.166/16': 0.25;
'perform': 0.26; 'function': 0.27; 'thinking': 0.28; 'url-
ip:188/8': 0.31; 'program': 0.31; 'guess': 0.32; 'here,': 0.32;
'python-list': 0.32; 'right,': 0.32; 'window': 0.32; 'but': 0.32;
'there': 0.33; 'header:In-Reply-To:1': 0.34; 'close': 0.35; 'fix':
0.36; 'others': 0.37; 'file': 0.38; 'use': 0.39; 'steve': 0.39;
'wrote': 0.39; 'still': 0.40; 'alan': 0.40; 'event': 0.40; 'skip:0
20': 0.61; 'skip:o 10': 0.61; 'from:': 0.62; 'to:': 0.62; '25,':
0.62; 'finally': 0.62; 'skip:o 20': 0.63; 'button': 0.64; 'pass':
0.64; 're:': 0.64; 'back': 0.67; 'bad': 0.67; 'outside': 0.67;
'adds': 0.69; 'discovery': 0.69; 'interesting': 0.71; 'global':
0.73; 'sent:': 0.78; 'placement': 0.81; 'extra': 0.84; 'itself.':
0.84; 'responds': 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=DObSSysSRGdrzoj1ZWQakcDg4tx+hLBMWMM1fHEfB04=; b=ULu0+uJXmy0bHZB6VnJLN1wmVv
RAD3PSUKVD5Kfj/E3Gwipp6u+ZaTM27oVIfntIf86n3edkvdhnBjpCdyg0+02ajls/rdTauoJk7ww
wOEgUQc9T6NG0b3wNYdJW9o/yrb2n98CVGNbAtHv9LQM6+1k/t4uH8ZkA5l8XqSyrMdSxAIDSu0Y9
CJPuziJZjUrY5mTj5vP6FU3ZMA7Btva1Q9FjPK6nox6ZTc/r35vX/tYExl2kKmo98Kno/Ml5bqpcP
3F4nYPyRMYlIRCEXTy17t/Zd3Dd8z+S15rSVlCdJpsci4mVokqLK9WEGB12ywdbq1A7KDetG1nsMX
x7Z748Rw==;
In-Reply-To: <cd441398-c4d4-4d33-9df7-43163b1d856d@tompassin.net>
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQJGy7zzXF4y2G8MeMWTWHq0fMItvQIzKKK2AzCygCMCTZHTpQJPWNtlAuepcsMCIock6AIvta91AZpYCAsBx1Fa3wLI9NlvAdYvt4eveZOLQA==
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: <087801da6889$52395bf0$f6ac13d0$@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>
<083301da6830$63224480$2966cd80$@SGA.Ninja>
<cd441398-c4d4-4d33-9df7-43163b1d856d@tompassin.net>
 by: Steve GS - Mon, 26 Feb 2024 07:56 UTC

Musta misstit....
I had thought of that before I
started the discussion but
figured it would take more
code than it finally needed.
I guess I was also
variable-dependent thinking
that I would need the result
elsewhere in the code. So
far, I see that I don't need
the value.

Then there is that discovery
element: Why is my original
idea not working? I still
cannot pass the value back
from the function. What is
different about this function
that others would have given
me the value?

SGA

-----Original Message-----
From: Python-list
<python-list-bounces+gronicus=
sga.ninja@python.org> On
Behalf Of Thomas Passin via
Python-list
Sent: Sunday, February 25,
2024 5:55 PM
To: python-list@python.org
Subject: Re: Problem resizing
a window and button placement

On 2/25/2024 4:19 PM, Steve GS
via Python-list wrote:
> 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.

Right, just what I wrote
earlier:

"have the function that
responds to the resize event
perform the action that you
want"

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

--
https://mail.python.org/mailma
n/listinfo/python-list

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor