Tile TreeView -- embedded images ...
- From: spam@xxxxxxxxxxxx
- Date: Mon, 10 Sep 2007 16:55:56 -0400
Up until recently, I've found that a Tk_Table was a great way to display thumbnails ... and it is, but the tile TreeView has a funky tabular mode of display which allows a very convenient tree/table with embedded widgets.
As far as working with the ttk::treeview manpage, it is very good, as far as it goes, but I'm having difficulty in sizing the rows displayed to accommodate the thumbnails (in this instance about 50px X 50px). It appears that one must somehow modify the *THEME* description in order to do this, and I've ascertained this by my inability to find a direct way to do it in the widget control interface as described in the man page (or am I missing something important -- it wouldn't be the first time 8-).
Changing theme appearances of treeview's, or any tile type widgets for that matter, remains a bit of a mystery to me, can anyone point me to the code/parms (or better yet some DOCS) on the subject?? Basically I just need to change the row height to accommodate the images.
Here's my callback ... and it works ok, the function extracts the embedded thumbnail from a jpeg, and embeds the image into the tv and it displays ok, but the images overlap on the 1 text line tall rows, and are *** fuggly.
proc dirTab { key pth } {
tv::clear $key
set tv [wdg::lookup $key tree]
set lst [util::listFiles $pth]
foreach f $lst {
set fn [file join $pth $f]
set this [tv::addTree $key {} $f]
if [util::isImageFile $fn] {
set blob [util::getFile $fn]
set pic [blob2Tn $blob]
$tv item $this -image $pic
unset blob
}
# size, type and mtime ...
$tv set $this 0 [util::bigNumber [file size $fn]]
$tv set $this 1 [util::fileType $fn]
$tv set $this 2 [clock format [file mtime $fn] -format "%Y-%m-%d"]
}
}
Surely there must be a straightforward way to tell treeview to centre the text on a 50px (or arbitrary) high line??
Thanks for any pointers,
Rob Sciuk
.
- Follow-Ups:
- Re: Tile TreeView -- embedded images ...
- From: Joe English
- Re: Tile TreeView -- embedded images ...
- From: Googie
- Re: Tile TreeView -- embedded images ...
- Prev by Date: Re: work with socket
- Next by Date: Re: work with socket
- Previous by thread: tcltalk
- Next by thread: Re: Tile TreeView -- embedded images ...
- Index(es):