Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.83.MISMATCH!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '16,': 0.03; 'skip:[ 20': 0.04; 'canvas': 0.07; 'padding': 0.07; 'tkinter': 0.07; 'logic': 0.09; 'matplotlib': 0.09; 'prevents': 0.09; 'skip:t 60': 0.09; 'skip:t 70': 0.09; 'width': 0.09; 'window.': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; 'gui': 0.12; '640,': 0.16; '8bit%:1': 0.16; 'api,': 0.16; 'blend': 0.16; 'personally,': 0.16; 'resizing': 0.16; 'skip:u 60': 0.16; 'skip:\xa0 60': 0.16; 'tk()': 0.16; 'tkinter.': 0.16; 'utilize.': 0.16; 'wxpython': 0.16; 'wrote:': 0.18; 'library': 0.18; 'app': 0.19; "python's": 0.19; 'written': 0.21; 'import': 0.22; 'email addr:gmail.com>': 0.22; 'cc:addr:python.org': 0.22; 'this?': 0.23; 'library,': 0.24; 'skip:{ 20': 0.24; 'decide': 0.24; 'cc:2**0': 0.24; "i've": 0.25; '15,': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'point': 0.28; 'skip:p 30': 0.29; "doesn't": 0.30; 'returned': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'url:mailman': 0.30; 'program,': 0.31; 'app.': 0.31; 'loads': 0.31; 'skip:i 60': 0.31; 'skip:r 60': 0.31; 'figure': 0.32; 'url:python': 0.33; 'older': 0.33; 'style': 0.33; 'maybe': 0.34; 'skip:d 20': 0.34; "i'd": 0.34; 'could': 0.34; 'problem': 0.35; 'skip:s 30': 0.35; 'usual': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'height': 0.36; 'url:listinfo': 0.36; 'similar': 0.36; 'url:org': 0.36; 'two': 0.37; 'performance': 0.37; 'skip:& 10': 0.38; 'window': 0.38; 'skip:[ 10': 0.38; 'issue': 0.38; 'fact': 0.38; 'pm,': 0.38; 'skip:& 20': 0.39; 'skip:p 20': 0.39; 'url:mail': 0.40; 'how': 0.40; 'around.': 0.60; 'issues,': 0.61; 'url:u': 0.61; 'back': 0.62; 'more': 0.64; 'different': 0.65; 'to:addr:gmail.com': 0.65; 'url:0': 0.67; 'skip:r 30': 0.69; 'jul': 0.74; 'hoping': 0.75; 'url:gif': 0.82; 'url:images': 0.83; '180': 0.84; 'around,': 0.84; 'done;': 0.84; 'forced': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Mkf0Hpo9V/jsEi+/x7BpQcI42WHIxfJF14COx3vjon0=; b=zcL7xXLj0/+f0ne2ltmQEVFgN9Fs9Hh0CiQJxMqw/nGvbNYEBQz1XJfkiW/NFTgzxs 3mH+r2HCOl0uHnGv2oDaPV+yRFkYPTeaRSlN+e3Bg2xiLiPJ2sKQ5AjlkaOdd0DQgBtJ JgbJ/wQf9yk8H1E7j3+zOODukbvcAqlm9xdi92iVQDL3QB0wzrWSSaphuVmh4542atrn JgpSQKtEtpD1OISL9AbTKbklP+Y0l7q4bPdYr9+K6dpx1LzFRN3axAqJ6EnP1bKdeRAg wNBQhyzAK2ZUiCsFSxJBZ6XU6DFPqZUUZx5Weiewlx4eCIH5xPqSyEvHnYIBq41TzJvt AlKw== MIME-Version: 1.0 X-Received: by 10.49.24.52 with SMTP id r20mr5589265qef.54.1374024884325; Tue, 16 Jul 2013 18:34:44 -0700 (PDT) In-Reply-To: References: Date: Tue, 16 Jul 2013 21:34:44 -0400 Subject: Re: tkinter redraw rates From: David Hutto To: fronagzen@gmail.com Content-Type: multipart/alternative; boundary=047d7b3a93a62492db04e1ab19f0 Cc: python-list X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 220 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1374024892 news.xs4all.nl 15891 [2001:888:2000:d::a6]:55955 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:50771 --047d7b3a93a62492db04e1ab19f0 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Jul 16, 2013 at 9:32 PM, David Hutto wrote: > I've had a similar problem with a tkinter/3D app. right now I'm looking > toward Blender, and the Python API, but there is also wxpython, and the > usual python's library gtk. > > There is also matplotlib with the ion window. but, I, personally, am going > to go with Blender, and Python API, with maybe a few other imports, and if > ctypes...includes if I remember C correctly without reference at this time > the usages of returned data type values > for you to utilize. > > > But for the plainer answer I'd go with wxpython if you decide not to use a > different library, and for a GDK, Blend > > > On Tue, Jul 16, 2013 at 8:57 PM, wrote: > >> Hm. So I've written a GUI in tkinter. I've found two performance issues, >> I was hoping someone could point me in the right direction. >> >> Firstly, I'm using an image as a border, namely: >> >> from tkinter import * >> from tkinter import ttk >> >> root_frame = Tk() >> root_frame.configure(background = 'black') >> >> img1 = PhotoImage("frameBorder", data=""" >> R0lGODlhQABAAMIHAAAAABkfLTMrMzMrZjNVZjNVmUFch////ywAAAAAQABAAAAD9A >> i63P4wykmrvTjrzbu/hlGMZGmeaBp2QmgIQSzPdG3fbShk+u3/wFkONAgaj7aBoWIo >> Ip9P5aQFrSJfkpd1C2xluWDfEhIKm2mrh/bM9qrZ8MDYYYiz54263Yxn6PdgfQt/gF >> uCCoSFVYcAiYpPjI6PR5GTVpWWUJiZV2SckJ6flKGiQZulP6eoN6qrNa2uM7CxMbO0 >> trG4rrqrvKi+pcCiwp/EnMaZyJbKk8yPzorQhdKA1HuRMLQ0bnSSuYyN2mhZ2eLcD1 >> >> TicjtZ3sPgfu7J8A0EBOWfQxg5a4/87BtcCBxIsKDBgh8SKlzIsKHDhxAVJgAAOw==""") >> >> style = ttk.Style() >> style.element_create("RoundedFrame", "image", "frameBorder", >> border=30, sticky="nsew") >> style.layout("RoundedFrame", [("RoundedFrame", {"sticky": "nsew"})]) >> >> input_frame = ttk.Frame(root_frame, >> style = "RoundedFrame", >> padding = 15, >> width = 640, >> height = 180 >> ) >> input_frame.pack(padx=10, pady=10) >> >> This works, yes, but is annoyingly laggy on an older computer when I try >> to move the window around. I figure it's because the program has to keep >> redrawing the image border when dragged around, and is exacerbated by the >> fact that I have two of the imageborder frames in my application. How can I >> remedy this? I've tried using a hard-drawn image on a Canvas instead of the >> image border, but it's suboptimal because that prevents resizing the window. >> >> >> The other performance issue I've found is that when the logic is running, >> the app doesn't redraw. Ordinarily this would be acceptable, but as part of >> my program, it loads data from a website, and during the load, the window >> completely freezes up and doesn't respond until the download is done; as I >> understand it, tkinter doesn't redraw until it is forced to by .update() or >> control is given back to the mainloop. How can I force a more frequent >> redraw rate? >> -- >> http://mail.python.org/mailman/listinfo/python-list >> > > > I've had a similar problem with a tkinter/3D app. right now I'm looking > toward Blender, and the Python API, but there is also wxpython, and the > usual python's library gtk. > > There is also matplotlib with the ion window. but, I, personally, am going > to go with Blender, and Python API, with maybe a few other imports, and if > ctypes...includes if I remember C correctly without reference at this time > the usages of returned data type values > for you to utilize. > > > But for the plainer answer I'd go with wxpython if you decide not to use a > different library, and for a GDK, Blender. > -- Best Regards, David Hutto *CEO:* *http://www.hitwebdevelopment.com* --047d7b3a93a62492db04e1ab19f0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable



On Tue, Jul 16, 2013 at 9:32 PM, David Hutto <= dwightdhutto@gm= ail.com> wrote:
I've had a similar problem with a tkinter/3D app. right now I'm l= ooking toward Blender, and the Python API, but there is also wxpython, and = the usual python's library gtk.

There is also matplotlib with the ion window. but, I, personally, am going = to go with Blender, and Python API, with maybe a few other imports, and if = ctypes...includes if I remember C correctly without reference at this time = the usages of returned data type values
for you to utilize.


But for the plainer answer I'd go = with wxpython if you decide not to use a different library, and for a GDK, = Blend


On Tue, Jul 16, 2013 at 8:57 PM, <fronagzen@gmail.com> wr= ote:
Hm. So I've written a GUI in tkinter. I've found two performance is= sues, I was hoping someone could point me in the right direction.

Firstly, I'm using an image as a border, namely:

from tkinter import *
from tkinter import ttk

root_frame =3D Tk()
root_frame.configure(background =3D 'black')

img1 =3D PhotoImage("frameBorder", data=3D"""
=A0 =A0 =A0 =A0R0lGODlhQABAAMIHAAAAABkfLTMrMzMrZjNVZjNVmUFch////ywAAAAAQABA= AAAD9A
=A0 =A0 =A0 =A0i63P4wykmrvTjrzbu/hlGMZGmeaBp2QmgIQSzPdG3fbShk+u3/wFkONAgaj7= aBoWIo
=A0 =A0 =A0 =A0Ip9P5aQFrSJfkpd1C2xluWDfEhIKm2mrh/bM9qrZ8MDYYYiz54263Yxn6Pdg= fQt/gF
=A0 =A0 =A0 =A0uCCoSFVYcAiYpPjI6PR5GTVpWWUJiZV2SckJ6flKGiQZulP6eoN6qrNa2uM7= CxMbO0
=A0 =A0 =A0 =A0trG4rrqrvKi+pcCiwp/EnMaZyJbKk8yPzorQhdKA1HuRMLQ0bnSSuYyN2mhZ= 2eLcD1
=A0 =A0 =A0 =A0TicjtZ3sPgfu7J8A0EBOWfQxg5a4/87BtcCBxIsKDBgh8SKlzIsKHDhxAVJg= AAOw=3D=3D""")

style =3D ttk.Style()
style.element_create("RoundedFrame", "image", "fra= meBorder",
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 border= =3D30, sticky=3D"nsew")
style.layout("RoundedFrame", [("RoundedFrame", {"s= ticky": "nsew"})])

input_frame =3D ttk.Frame(root_frame,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 style =3D "RoundedFram= e",
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 padding =3D 15,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 width =3D 640,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 height =3D 180
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 )
input_frame.pack(padx=3D10, pady=3D10)

This works, yes, but is annoyingly laggy on an older computer when I try to= move the window around. I figure it's because the program has to keep = redrawing the image border when dragged around, and is exacerbated by the f= act that I have two of the imageborder frames in my application. How can I = remedy this? I've tried using a hard-drawn image on a Canvas instead of= the image border, but it's suboptimal because that prevents resizing t= he window.


The other performance issue I've found is that when the logic is runnin= g, the app doesn't redraw. Ordinarily this would be acceptable, but as = part of my program, it loads data from a website, and during the load, the = window completely freezes up and doesn't respond until the download is = done; as I understand it, tkinter doesn't redraw until it is forced to = by .update() or control is given back to the mainloop. How can I force a mo= re frequent redraw rate?
--
http://mail.python.org/mailman/listinfo/python-list


I've had a similar p= roblem with a tkinter/3D app. right now=20 I'm looking toward Blender, and the Python API, but there is also=20 wxpython, and the usual python's library gtk.

There is also matplotlib with the ion window. but, I, personally, am=20 going to go with Blender, and Python API, with maybe a few other=20 imports, and if ctypes...includes if I remember C correctly without=20 reference at this time the usages of returned data type values
for you to utilize.


But for the plainer answer I'd go = with wxpython if you decide not to use a different library, and for a GDK, = Blender.



--
Best Regards,
David Hutto
<= b>CEO: http://www.hitwebdevelopment.com
--047d7b3a93a62492db04e1ab19f0--