Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Cell configuration with ttk::treeview and tk::tablelist

132 views
Skip to first unread message

eras.r...@gmail.com

unread,
May 13, 2013, 10:10:39 AM5/13/13
to

Hi

I have tried to configure certain cell of table with ttk::treeview and tk::tablelist, but not succeed yet.

For example i want to set background color of certain cell (not all row or column).

tk::tablelist seems to work, if i don't sort the table afterwards. But i need sorting. Do i need to build some clever code or are there exist some special way to do that by tk::tablelist ?

Are there exists some handle to certain cell, which is "permanent" ?

Have you any ideas how to solve this problem ?


---
Eras

nemethi

unread,
May 13, 2013, 2:31:09 PM5/13/13
to
If you set the background color of a tablelist cell (by using the
cellconfigure subcommand) then the new background color will persist
(you don't need any special code to ensure this).

--
Csaba Nemethi http://www.nemethi.de mailto:csaba....@t-online.de

eras.r...@gmail.com

unread,
May 14, 2013, 2:13:52 AM5/14/13
to

> If you set the background color of a tablelist cell (by using the
> cellconfigure subcommand) then the new background color will persist
> (you don't need any special code to ensure this).
>


That is true, but if i would want to change the color of the cell after a sorting. It is not at same position longer. How do i know, what is the new position of the cell, so i can change it's color ?

---
Eras

nagu

unread,
May 14, 2013, 12:21:46 PM5/14/13
to
>
> That is true, but if i would want to change the color of the cell after a sorting. It is not at same position longer. How do i know, what is the new position of the cell, so i can change it's color ?
>
>

Please look at: getkeys and getfullkeys commands. Keys obtained from these commands can be used as row index.

Each item of a tablelist widget has a unique sequence number that remains unchanged until the item is deleted, thus acting as a key that uniquely identifies the item even if the latter's position (i.e., numerical row index) changes. This command provides read-only access to the full keys obtained by prepending the letter k to these internal item IDs.

Regards,
nagu.

eras.r...@gmail.com

unread,
May 15, 2013, 3:19:55 AM5/15/13
to

>
> Please look at: getkeys and getfullkeys commands. Keys obtained from these commands can be used as row index.
>

Thanks you :)

That was exactly i was looking for. There was also "-name" in rowconfigure-command if i want use names (not numbers).

---
Eras

nemethi

unread,
May 15, 2013, 2:10:15 PM5/15/13
to
Yes, that is another way you can go, but it needs extra rowconfigure
invocations and is less performant than using getkeys or getfullkeys.
0 new messages