Re: questions about tktreectrl please?



Hi Tim,

yes, yes, yes! Converting it to a PS file is great.
How can I do that? I can study the Canvas widget of course, but if you
can give me some hints, I really appreciate it.
Thanks again,

Beet

Tim Baker wrote:
"beet" wrote in message:
Hi all,

I have some questions about some features of this widget please help
me:
1. How can I print the content in the tree table in a good format?

If you mean on a printer there is no support for it. I've never even
considered it before now. I suppose I could convert it to postscript
like the Canvas widget does.

2. Can I highlight both selected rows and columns by setting
itembackground?

A column's -itembackground option determines the color of items in that
column only, and affects every item. You can set the background color
independently for every item-column by using a "rect" element like so:

.t element create myElement rect -background blue
.t style create myStyle
.t style elements myStyle {myElement}
.t style layout myStyle myElement -detach yes -indent no -iexpand xy
.t item style set $item $column myStyle

Then if you wanted to change the color of a specific item-column you would
write:

.t item element configure $item $column myElement -background green

There is a better way to do this using a custom state that will use less
memory:

.t state define myState
.t element configure myElement -background {green myState blue {}}

.t item state forcolumn $item $column myState ; # now it is green
.t item state forcolumn $item $column !myState ; # now it is blue again


Thanks a lot,
Sincerely

BEET

Hopefully there aren't any errors or you will be very confused.

-- Tim Baker

.