Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #50770

Re: tkinter redraw rates

References <b80dcc82-7fdb-4213-bec0-5e704483ce28@googlegroups.com>
Date 2013-07-16 21:32 -0400
Subject Re: tkinter redraw rates
From David Hutto <dwightdhutto@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.4791.1374024725.3114.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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, <fronagzen@gmail.com> 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
>



-- 
Best Regards,
David Hutto
*CEO:* *http://www.hitwebdevelopment.com*

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

tkinter redraw rates fronagzen@gmail.com - 2013-07-16 17:57 -0700
  Re: tkinter redraw rates David Hutto <dwightdhutto@gmail.com> - 2013-07-16 21:32 -0400
  Re: tkinter redraw rates David Hutto <dwightdhutto@gmail.com> - 2013-07-16 21:34 -0400
  Re: tkinter redraw rates Dave Angel <davea@davea.name> - 2013-07-16 21:40 -0400
    Re: tkinter redraw rates fronagzen@gmail.com - 2013-07-16 18:51 -0700
      Re: tkinter redraw rates Dave Angel <davea@davea.name> - 2013-07-16 22:21 -0400
        Re: tkinter redraw rates fronagzen@gmail.com - 2013-07-16 20:04 -0700
          Re: tkinter redraw rates Dave Angel <davea@davea.name> - 2013-07-17 06:07 -0400
            Re: tkinter redraw rates fronagzen@gmail.com - 2013-07-17 04:08 -0700
              Re: tkinter redraw rates Michael Torrie <torriem@gmail.com> - 2013-07-17 16:53 -0600
            Re: tkinter redraw rates fronagzen@gmail.com - 2013-07-17 04:10 -0700
              Re: tkinter redraw rates Dave Angel <davea@davea.name> - 2013-07-17 07:42 -0400
                Re: tkinter redraw rates fronagzen@gmail.com - 2013-07-17 06:18 -0700
                Re: tkinter redraw rates Dave Angel <davea@davea.name> - 2013-07-17 13:38 -0400
                Re: tkinter redraw rates fronagzen@gmail.com - 2013-07-17 17:44 -0700
                Re: tkinter redraw rates Dave Angel <davea@davea.name> - 2013-07-17 21:07 -0400
                Re: tkinter redraw rates fronagzen@gmail.com - 2013-07-17 21:38 -0700
                Re: tkinter redraw rates Dave Angel <davea@davea.name> - 2013-07-18 00:52 -0400
                Re: tkinter redraw rates Christian Gollwitzer <auriocus@gmx.de> - 2013-07-18 09:20 +0200
                Re: tkinter redraw rates fronagzen@gmail.com - 2013-07-18 02:10 -0700
                Re: tkinter redraw rates Peter Otten <__peter__@web.de> - 2013-07-17 20:10 +0200

csiph-web