On 11/6/07, Ken Tilton kennytilton@optonline.net wrote:
Andy Chambers wrote:
On 11/6/07, Ken Tilton kennytilton@optonline.net wrote:
Hmmpph. Too bad Tk does not know about that, we have to unpack and then repack, no simple "visible" flag.
So I think that setting the visible attribute is the way to go.
OK. Don't forget :collapsed (c? (not (^visible))) if that is what you want. (I /think/ collapsed works in the Tk bit.)
grepping the Celtk source, I can't find anything about collapsed (although it does appear in the cells geometer class. I can't find anything in the tk docs about collapse either. Should I inherit from the geometer class itself to get this or am I missing the point entirely.
-- Andy
Andy Chambers wrote:
On 11/6/07, Ken Tilton kennytilton@optonline.net wrote:
Andy Chambers wrote:
On 11/6/07, Ken Tilton kennytilton@optonline.net wrote:
Hmmpph. Too bad Tk does not know about that, we have to unpack and then repack, no simple "visible" flag.
So I think that setting the visible attribute is the way to go.
OK. Don't forget :collapsed (c? (not (^visible))) if that is what you want. (I /think/ collapsed works in the Tk bit.)
grepping the Celtk source, I can't find anything about collapsed (although it does appear in the cells geometer class. I can't find anything in the tk docs about collapse either. Should I inherit from the geometer class itself to get this or am I missing the point entirely.
Hmmm, come to think of it, if you are doing vanilla Celtk (not Cello) collapsed might not apply. I /think/ simply making, say, the middle widget of three invisible would cause it to be unpacked (there being no way to say "invisible" in Tk) and then packing would scrunch the ends together simply because there would be no middle.
Sorru for the headfake.
kt
On Nov 7, 2007 5:56 PM, Ken Tilton kennytilton@optonline.net wrote:
Hmmm, come to think of it, if you are doing vanilla Celtk (not Cello) collapsed might not apply. I /think/ simply making, say, the middle widget of three invisible would cause it to be unpacked (there being no way to say "invisible" in Tk) and then packing would scrunch the ends together simply because there would be no middle.
OK I've got it working nicely now. It's mostly the same as I previously posted except the expansion is specified more like a row/stack widget (i.e. you don't have to use :expansion you just put in the widgets). The specified expansion together with the expander button all remain as kids for the life of the widget and an observer on the expanded slot packs/unpacks as necessary.
My next question is about the :tk-spec keyword in deftk forms. How does this relate (if at all) to the allowed options you see in the tk manual pages. It seems like some of them correspond directly and others don't exist. For example...
comparing the spec at http://www.tcl.tk/man/tcl8.5/TkCmd/bitmap.htm to....
(deftk bitmap (item) () (:tk-spec bitmap -state -tags -anchor -background -activebackground -disabledbackground -bitmap -activebitmap -disabledbitmap -foreground -activeforeground -disabledforeground))
the celtk spec doesn't have the -data, -file, -maskdata, -maskfile options and the tk spec doesn't have the -state, -tags, -anchor options.
From what I can gather, celtk is mostly using tile widgets as the
underlying framework and some of the :tk-specs match those specs better but there are still inconsistencies.
Cheers, Andy