I've run up against LTK's incompleteness a couple times now. First, I wanted to be able to change the default color of shapes drawn on a canvas. My quick fix was to create an optional parameter to create-oval that passes its argument on at the end of the command to wish. Not exactly an ideal fix. The second time was when I wanted to change the back color of my canvas to black, which I will probably work around by changing the default color of the canvas created by the canvas class to black. Again, not a clean fix.
Now, it would be possible to complete LTK by adding all the possible parameters to every command as arguments or slots, depending on how that command is abstracted. I assume that, with enough interest, this is the eventual goal. It would also be possible to have everything accept optional parameters to let users stick parameters onto the ends of things (but they still have to know the parameters exist, and to know tcl syntax, and probably sometimes to look at the source to figure out which command is being issued for a given ltk function). For the time being, the latter option seems to be the best choice. Would Peter like me to look into adding this to LTK? Perhaps he'd rather take on the project?
Chris Capel
Actually, your problem has been adressed to a big part with the upcoming Ltk verstion 0.87, as I *did* add all configuration options as keyword arguments to most widgets (though not to the canvas widgets yet). I have not quite got around to make that version "final" but hope to be able to do that soon. In the meanwhile I can attach my current development version, so if you want to test it, I could publish the final version with more confidence that I didn't break things too badly :)
Peter
On Mon, 13 Dec 2004 19:56:30 -0600, Chris Capel pdf23ds@gmail.com wrote:
I've run up against LTK's incompleteness a couple times now. First, I wanted to be able to change the default color of shapes drawn on a canvas. My quick fix was to create an optional parameter to create-oval that passes its argument on at the end of the command to wish. Not exactly an ideal fix. The second time was when I wanted to change the back color of my canvas to black, which I will probably work around by changing the default color of the canvas created by the canvas class to black. Again, not a clean fix.
Now, it would be possible to complete LTK by adding all the possible parameters to every command as arguments or slots, depending on how that command is abstracted. I assume that, with enough interest, this is the eventual goal. It would also be possible to have everything accept optional parameters to let users stick parameters onto the ends of things (but they still have to know the parameters exist, and to know tcl syntax, and probably sometimes to look at the source to figure out which command is being issued for a given ltk function). For the time being, the latter option seems to be the best choice. Would Peter like me to look into adding this to LTK? Perhaps he'd rather take on the project?
Chris Capel
"What is it like to be a bat? What is it like to bat a bee? What is it like to be a bee being batted? What is it like to be a batted bee?" -- The Mind's I (Hofstadter, Dennet) _______________________________________________ ltk-user site list ltk-user@common-lisp.net http://common-lisp.net/mailman/listinfo/ltk-user