Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

User hostile.


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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!nntp.comgw.net!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 19:33:52 -0500
Lines: 139
Message-ID: <mailman.7.1708821239.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>
Mime-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de CL8McnEHWhginCQY9n9S1AY4oT0YphndkRQvACbb1dOw==
Cancel-Lock: sha1:EwL6IT1uxfrXiXAwoNUeOrFOaGQ= sha256:m4NuCPvzoHgxkhEYtE1MxwJOw98IbL7cZrQuib2jGCE=
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=AvsOdIik;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.024
X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'variable': 0.05;
'apparently': 0.09; 'resizing': 0.09; 'values.': 0.09; 'window.':
0.09; 'that.': 0.15; '2024': 0.16; 'barry': 0.16; 'declare': 0.16;
'design.': 0.16; 'does,': 0.16; 'from:addr:gronicus': 0.16;
'from:addr:sga.ninja': 0.16; 'functions,': 0.16; 'languages.':
0.16; 'message-id:@SGA.Ninja': 0.16; 'received:floathosting.com':
0.16; 'received:mars.floathosting.com': 0.16; 'using?': 0.16;
'variable.': 0.16; 'want,': 0.16; 'wrote:': 0.16; 'problem': 0.16;
'python': 0.16; 'values': 0.17; 'code.': 0.17; 'feb': 0.17;
'to:addr:python-list': 0.20; 'ran': 0.22; 'code': 0.23; 'run':
0.23; 'skip:- 10': 0.25; 'url-ip:188.166.95.178/32': 0.25; 'url-
ip:188.166.95/24': 0.25; 'cannot': 0.25; 'programming': 0.25;
'url-ip:188.166/16': 0.25; 'tried': 0.26; 'perform': 0.26;
'local': 0.27; 'coming': 0.27; 'function': 0.27; 'printed': 0.28;
'code,': 0.31; 'seem': 0.31; 'am,': 0.31; 'url-ip:188/8': 0.31;
'think': 0.32; 'extract': 0.32; 'python-list': 0.32; 'window':
0.32; 'unless': 0.32; 'but': 0.32; 'same': 0.34; 'header:In-Reply-
To:1': 0.34; 'yes,': 0.35; 'those': 0.36; 'added': 0.39; 'use':
0.39; 'rest': 0.39; 'steve': 0.39; 'reports': 0.40; 'learn': 0.40;
'both': 0.40; 'try': 0.40; 'should': 0.40; 'event': 0.40;
'method': 0.61; 'from:': 0.62; 'to:': 0.62; 'between': 0.63;
'button': 0.64; 'height': 0.64; 're:': 0.64; 'your': 0.64; 'look':
0.65; 'outside': 0.67; 'cc:': 0.69; 'within': 0.69; 'instead,':
0.70; 'rules': 0.70; 'global': 0.73; 'languages,': 0.76; 'vary':
0.76; 'sent:': 0.78; 'placement': 0.81; 'capture': 0.84;
'global.': 0.84; 'responds': 0.84; 'saturday,': 0.84; 'sub': 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=l20sH2HPgzRf2OoaHqAEhsGbhs/Fzqt52gbgPaY3qlA=; b=AvsOdIikFQXf0Z3NrA6zNl1188
OSraU1EdNWp11axt9lDs+Oya/CwKL0k6kbgxw+pbEmeEWTypgxd8TRKLUBM4cdIsbHO7LoB1VlJPf
0hMrYv0Qw4FP8D1dIm+/bB0jz0AA+DIlVrltvkBf+G0NRV4+8RJ0st2ZyDylgf0O02eKPWPt3W9KI
LSCA0gwxSrZH3IXii6RhzU4yeWqxsvdZcDfBwilXuCxFO8IXBY3DOofCpH1fS1NcI7PonPYG4Y+uL
FObaYDv5NT1vRnW+7JZfy9WcZOx0jYbOFVMPhmNNuMjssuQEPBH94MNT97CwHktoVIoca8SThXWJP
kulwshng==;
In-Reply-To: <31caf694-99fd-41ca-a98c-cb0d5d4a758e@tompassin.net>
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQJGy7zzXF4y2G8MeMWTWHq0fMItvQIzKKK2AzCygCMCTZHTpbADzMaw
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: <077801da6782$4f6046d0$ee20d470$@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>
 by: Steve GS - Sun, 25 Feb 2024 00:33 UTC

"Well, yes, in Python a
variable created inside a
function or method is local to
that function unless you
declare it global."

Yes, I knew that. I tried to
global it both before the
function call and within it.
Same for when I created the
variable. If I try to use it
in the rest of the code, it
keeps coming up as not
declared. In other functions,
I can 'return' the variable
but that apparently would not
work for this function.

Is this type of function any
different that that which I
have been using?

SGA

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

On 2/24/2024 3:20 AM, Steve GS
via Python-list wrote:
> Yes, I ran that elegantly
> simple code. The print
> statement reports the X, Y,
> Height and Width values.
> However, I do not see how to
> capture the width value.
>
> I experimented with the
code
> Vwidth = rootV.winfo_width()
> and it also reports the
width
> as I resize the window.
>
> However, I cannot seem to
use
> the variable Vwidth outside
> the sub routine. It is
acting
> as if Vwidth is not global
but
> I added that. It is
reported
> that Vwidth is not defined
> when I try to use it in my
> code.

Well, yes, in Python a
variable created inside a
function or method is local to
that function unless you
declare it global. That
characteristic is called its
"scope". But if you think you
need it to be a global
variable you should rethink
your design. For one thing,
before the next time you use
your global variable the
window size may have changed
again.

Instead, it would be better to
have the function that
responds to the resize event
perform the action that you
want, or call another function
that does, passing the new
width to it.

Note that in most programming
languages, variables have a
scope. The rules about those
scopes vary between languages.

>
> So close......
> SGA
>
> -----Original Message-----
> From: Barry
> <barry@barrys-emacs.org>
> Sent: Saturday, February 24,
> 2024 3:04 AM
> To: Steve GS
> <Gronicus@sga.ninja>
> Cc: MRAB
>
<python@mrabarnett.plus.com>;
> python-list@python.org
> Subject: Re: Problem
resizing
> a window and button
placement
>
>
>
>> On 24 Feb 2024, at 04:36,
> Steve GS via Python-list
> <python-list@python.org>
> wrote:
>>
>> How do I extract the values
>> from args?
>
> You can look up the args in
> documentation.
> You can run the example code
> MRAB provided and see what
is
> printed to learn what is in
> the args.
>
> Barry
>
>

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

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor