aneuryzm
aneuryzm

Reputation: 64844

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

Upvotes: 1

Views: 586

Answers (1)

Bryan Oakley
Bryan Oakley

Reputation: 386210

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.

Upvotes: 1

Related Questions