Pergunta

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

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top