简体   繁体   中英

How can I implement a color table with VTK / TK in python

I'm developing an application in VTK / TK and I was wondering what's the best way to provide the user with a table which lists items and allow the user to pick the color for each item:

item1 | color
item2 | color
item3 | color

thanks

I would create a frame, then write a loop that creates a label widget and a button for each item. The background of the button would be the current color. There needs not be any text on the button, just make it square. The button would call a method that calls tk_chooseColor to get a color from the user.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM