1

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

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

4 Comments

all this stuff is done with tkinter library ? Or I can do it directly in vtk ?
I don't know anything about vtk; I would do this all in Tkinter.
Oackley is tk_chooseColor running with python ? Which library should I import to use it ?
@Patrick: my mistake. tk_colorChooser is the Tcl name. With Tkinter you would use it like from tkColorChooser import askcolor; color=askcolor()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.