Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by olgo (Acolyte)
on Jan 18, 2022 at 14:22 UTC ( #11140565=note: print w/replies, xml ) Need Help??


in reply to Re^3: Tk performance and "UpdateWrapper: Failed to create container"
in thread Tk performance and "UpdateWrapper: Failed to create container"

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.
  • Comment on Re^4: Tk performance and "UpdateWrapper: Failed to create container"

Replies are listed 'Best First'.
Re^5: Tk performance and "UpdateWrapper: Failed to create container"
by Marshall (Canon) on Jan 19, 2022 at 09:56 UTC
    I suppose that you saw set_col_width($table,@col_heads); #THIS WILL CAUSE A SCREEN REFRESH! set_col_width() shows setting the width of individual columns specified in characters. In the demo, they all wind up being the same width, but of course they don't have to be. Due to perhaps proportional fonts, num of chars may not be the best measurement, but I think it is likely that you can come up with a heuristic that will work well.

    I found out that set_col_width() caused a screen refresh. I called that after say a column sort operation to update the screen. Anyway, this is a fast operation.

    In my application, I had an array structure ["headingname", width], etc. And I was fine with a "one size fits all" judgment of the width needed for each type of column. Mileage varies, I have no idea of what your data looks like.

    TableMatrix is a complicated GUI object. There are many, many options. I didn't use any color options, but that is a possibility. I did implement different behavior for left mouse click vs right mouse click within a cell and that worked out very well.

    Designing a good GUI can take a lot of effort. There were no existent GUI's for the class of application I was developing. I spent a couple of months carefully thinking through the information I wanted to display to the user. Doing something cool for the first time is hard.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2022-06-29 08:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (96 votes). Check out past polls.

    Notices?