Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Tk performance and "UpdateWrapper: Failed to create container"

by Discipulus (Canon)
on Jan 17, 2022 at 12:36 UTC ( [id://11140537]=note: print w/replies, xml ) Need Help??


in reply to Tk performance and "UpdateWrapper: Failed to create container"

Hello olgo,

> 1. Is it possible to disable the GUI Event mechanisms, like the clicking on a button (temporarily while dealing with another event)? I am thinking that this might prove less stressful to the GUI.

It is possible to disable widgets, one by one and by hand, but I doubt this will speed up the general execution time

> 2..

Even more work and no speed boost expected, imho.

> The size of the grid is quite large (up to thousands of cells)..

this is quite a lot of stuff but I'd expect a slow show up, to draw everything, but no broken functionalities: in my Tartaglia-s-triangle if I ask for a triangle with 127 rows it take several seconds to draw it, but then it works as expected.

> I quite often get a "UpdateWrapper: Failed to create container"

this error only appears at tkWinWm.c#L1940 and the function being called is UpdateWrapper which seems to me something that modifies an existing window: are you (over?)modifying the whole window while the program runs?

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: Tk performance and "UpdateWrapper: Failed to create container"
by olgo (Acolyte) on Jan 17, 2022 at 15:06 UTC
    Hi and thanks for your answer.
    Do you know if there is way to set a breakpoint in the execution before ending up in the UpdateWrapper? It is not my intent to modify the main window while running so I need to debug it to understand what is happening.
    I suppose it is down in som XS code somewhere, which is a bit outside my comfortability zone.
      I think trying to debug Tk is very unlikely to result in success for your application.

      If you exceed some Tk limit and that causes some error, then try another way.
      Finding and fixing some Tk bug is a very last resort.

      Please explain why my code at Marshall's TableMatrix code is not a sufficient example which can be adapted to your needs?

      That explanation would help all of us Monks understand what you are trying to do. At this point, I don't think any of us are sure.

      GUI code can be very, very tricky to write. And a lot of experimentation is usually required.

        Marshall, indeed, your TableMatrix seems to do the trick, at least performance-wize. It is significantly faster than my old "widget by widget" solution. As most of my cells are simple text fields with just the occasional Combobox and Checkbox, a lot less widgets now need to be created.

        However, autosizing of columns I do miss from before when using the grid() packer to keep track of my "spreadsheet". Maybe someone knows of a solution?
        In my grid() packer solution, I simply set the width of my widgets to 0 and the geometry manager itself (or maybe the widgets themselves?) auto calculated the necessary width. Is there some means of doing this also for TableMatrix? I guess adding a method for it myself would be doable otherwize.

        Again, thanks for all your help. Bummer I didn't find TableMatrix myself.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11140537]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-03-29 09:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found