Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Although the moon is smaller than the earth, it is farther away.


devel / comp.lang.python / Re: [tkinter]Synchronous image diplay

SubjectAuthor
* [tkinter]Synchronous image diplayStefan Ram
+* Re: [tkinter]Synchronous image diplayStefan Ram
|`- Re: [tkinter]Synchronous image diplayCameron Simpson
`- Re: [tkinter]Synchronous image diplayStefan Ram

1
[tkinter]Synchronous image diplay

<image-20211020201731@ram.dialup.fu-berlin.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: [tkinter]Synchronous image diplay
Date: 20 Oct 2021 20:02:02 GMT
Organization: Stefan Ram
Lines: 31
Expires: 1 Dec 2021 11:59:58 GMT
Message-ID: <image-20211020201731@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de 8NkK/gOwIgemW0zn0ZujLwN695B/3ttkGdfbL1vPZQznyH
X-Copyright: (C) Copyright 2021 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE, en-US, it, fr-FR
 by: Stefan Ram - Wed, 20 Oct 2021 20:02 UTC

I want to diplay images fast in a slideshow (i.e., 10 images
per second), but do not want to skip any image the display
of which needs more time to be created. So I need to know
when exactly an image has become visible on the screen.

I am using tkinter to display large (i.e., 1000x1000, not
10x10) images, something like:

my_label.config\
( image=my_image, bg="#000000", width=my_width, height=my_height )
my_label.pack()

. This kinda works, but "config" and "pack" seem to return
before the image is visible. It seems the image then is
being drawn only while my thread is waiting for the next
input event.

I'd like my program to get to know when the painting of
the image is complete, i.e., when the image is really
visible on the screen. Is it possible to pass a call back
for this or to receive an event in this case?

If I'd insert

root.after( dt, f )

after "pack", then f would be called "dt" after "pack" has
returned. But I want it to be called "dt" after /the images
has become visible on the screen/ instead.

Re: [tkinter]Synchronous image diplay

<update_idletasks-20211020211824@ram.dialup.fu-berlin.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: [tkinter]Synchronous image diplay
Date: 20 Oct 2021 20:18:52 GMT
Organization: Stefan Ram
Lines: 8
Expires: 1 Dec 2021 11:59:58 GMT
Message-ID: <update_idletasks-20211020211824@ram.dialup.fu-berlin.de>
References: <image-20211020201731@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de ezub8Ti0Lmv8FVaQ2ICPFA3Hwt4LeSOH7wF6x/etx+t4pQ
X-Copyright: (C) Copyright 2021 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE, en-US, it, fr-FR
User-Agent: nn/6.7.3
 by: Stefan Ram - Wed, 20 Oct 2021 20:18 UTC

ram@zedat.fu-berlin.de (Stefan Ram) writes:
>I want to diplay images fast in a slideshow (i.e., 10 images

(There's a problem with my [S] key.)

It seems that update_idletasks() solved my problem!

Re: [tkinter]Synchronous image diplay

<update_idletasks-20211020212043@ram.dialup.fu-berlin.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: [tkinter]Synchronous image diplay
Supersedes: <update_idletasks-20211020211824@ram.dialup.fu-berlin.de>
Date: 20 Oct 2021 20:20:59 GMT
Organization: Stefan Ram
Lines: 11
Expires: 1 Dec 2021 11:59:58 GMT
Message-ID: <update_idletasks-20211020212043@ram.dialup.fu-berlin.de>
References: <image-20211020201731@ram.dialup.fu-berlin.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de pBqmp8i7qGWZF45VSMKjAA5obWSVhMyp9jOe04goHkfqAI
X-Copyright: (C) Copyright 2021 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE, en-US, it, fr-FR
 by: Stefan Ram - Wed, 20 Oct 2021 20:20 UTC

Supersedes: <update_idletasks-20211020211824@ram.dialup.fu-berlin.de>

ram@zedat.fu-berlin.de (Stefan Ram) writes:
>I want to diplay images fast in a slideshow (i.e., 10 images

(There's a problem with my [S] key.)

It seems that update_idletasks() solved my problem!

Re: [tkinter]Synchronous image diplay

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: cs...@cskk.id.au (Cameron Simpson)
Newsgroups: comp.lang.python
Subject: Re: [tkinter]Synchronous image diplay
Date: Thu, 21 Oct 2021 10:03:46 +1100
Lines: 17
Message-ID: <mailman.0.1634771031.23718.python-list@python.org>
References: <update_idletasks-20211020211824@ram.dialup.fu-berlin.de>
<YXCgUqb3voNCtvpX@cskk.homeip.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.uni-berlin.de mZlLJgHQ0Bq2aP9y6ozqQgv1YcOecaeo+t7Sa4zu13SA==
Return-Path: <cameron@cskk.id.au>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '(which': 0.04; 'loop':
0.07; 'ram': 0.07; 'subject:image': 0.07; 'idle': 0.09;
'rendering': 0.09; 'writes:': 0.09; 'yes.': 0.09; 'cheers,': 0.11;
'(i.e.,': 0.16; "(there's": 0.16; 'cameron': 0.16; 'from:addr:cs':
0.16; 'from:addr:cskk.id.au': 0.16; 'from:name:cameron simpson':
0.16; 'gui.': 0.16; 'idle,': 0.16; 'message-id:@cskk.homeip.net':
0.16; 'received:13.237': 0.16; 'received:13.237.201': 0.16;
'received:13.237.201.189': 0.16; 'received:cskk.id.au': 0.16;
'received:id.au': 0.16; 'received:mail.cskk.id.au': 0.16;
'simpson': 0.16; 'solved': 0.16; 'subject:tkinter': 0.16;
'wrote:': 0.16; 'problem': 0.16; 'to:addr:python-list': 0.20;
'subject:: [': 0.21; 'run': 0.23; 'seems': 0.26; 'stefan': 0.26;
'header:User-Agent:1': 0.30; 'think': 0.32; 'but': 0.32; 'header
:In-Reply-To:1': 0.34; 'pending': 0.35; 'received:au': 0.35;
'file': 0.38; 'want': 0.40; 'event': 0.40; 'received:13': 0.64;
'received:userid': 0.66; 'subject:]': 0.70; 'problem!': 0.84;
'resume,': 0.91
Mail-Followup-To: python-list@python.org
Content-Disposition: inline
In-Reply-To: <update_idletasks-20211020211824@ram.dialup.fu-berlin.de>
User-Agent: Mutt/2.0.3 (2020-12-04)
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.35
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: <YXCgUqb3voNCtvpX@cskk.homeip.net>
X-Mailman-Original-References: <update_idletasks-20211020211824@ram.dialup.fu-berlin.de>
 by: Cameron Simpson - Wed, 20 Oct 2021 23:03 UTC

On 20Oct2021 20:18, Stefan Ram <ram@zedat.fu-berlin.de> wrote:
>ram@zedat.fu-berlin.de (Stefan Ram) writes:
>>I want to diplay images fast in a slideshow (i.e., 10 images
>
> (There's a problem with my [S] key.)
>
> It seems that update_idletasks() solved my problem!

Yes. That causes the event loop to resume, render, then run any pending
idle tasks (which run when the event loop is idle, implying that any
pending rendering is complete). So you know at that time that a new
image will have been displayed.

Think of it like flush() for file output, but for a GUI.

Cheers,
Cameron Simpson <cs@cskk.id.au>

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor