-------- Original Message -------- Subject: Re: [cells-devel] Celtk: How to set title of Wish window and also name of app ? Date: Sat, 01 Apr 2006 23:12:23 -0500 From: Ken Tilton kentilton@gmail.com Reply-To: kentilton@gmail.com To: Goenninger, Frank fgoenninger@prion.de References: F43CECE8-7EFF-46B9-A4AA-106AA92E3265@prion.de
Goenninger, Frank wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
Hi Kenny and all others:
I do have the following mini app now:
- -x-x-x-x-x-
(defmodel psu-rc-app (window) () (:default-initargs :id :psu-rc-app-w :title$ "System Power Supply Remote Control (Version A.01.00)" :kids (c? (the-kids (app-menubar)))))
;; THIS IS HOW I SET THE TITLE OF THE WISH SHELL WINDOW ;; Any better way?
(defmethod initialize-instance :after ((self psu-rc-app) &key) (tk-format '(:configure "title") "wm title . HI"))
Yes and no. No in that, no, there is not a better way. :) Yes in that there should be. :)
Since there is only one Tk class like this, a fancy macro might not have much value. What we need is a bunch of:
(defobserver title$ ((self window)) (tk-format '(:configure "title") "wm title . ~a" (or new-value "Untitled")))
...observers, one per "wm XXXX...." that might follow from a window attribute. Note that, unlike intervening during i-i, this works even on /changes/ to the title (which would be unusual, but for other window attributes perfectly normal. so let's hand;e the general case.
Also... no, sorry, i forgot myself: the ii call to tk-format gets deferred until the tk-client-que-handler decides to dispatch configures, which is after things get made, so the window has been instantiated on the TK side before the tile change gets dispatched.
Anyway, if someone wants to code up the observers I will happily add them to Celtk, if not I will certainly get to them eventually as my need arises. Right now I am going quietly mad trying to make sense of Tcl/Tk handling of fonts and text items in a canvas. :)
As for the application name, er, can you copy wish.exe to frank.exe? Otherwise, if the doc does not help, I would try comp.lang.tcl. But if there is anyway to control that, I imagine we can get Celtk to handle it.
ken
On 4/2/06, Ken Tilton kentilton@gmail.com wrote:
Since there is only one Tk class like this, a fancy macro might not have much value. What we need is a bunch of:
(defobserver title$ ((self window)) (tk-format '(:configure "title") "wm title . ~a" (or new-value "Untitled")))
...observers, one per "wm XXXX...." that might follow from a window attribute. Note that, unlike intervening during i-i, this works even on /changes/ to the title (which would be unusual, but for other window attributes perfectly normal. so let's hand;e the general case...
...
Anyway, if someone wants to code up the observers...
OK, got a good night's sleep, not feeling so lazy now. Look for me to fill in this gap shortly. Trouble is I am already wreaking havoc on the Canvas/Item component to suit my needs (fancier layout scheme that I expect to use eventually for widgets as well) and it has already broken the demos by not being compatible with the classic Tk scheme. I can /probably/ fix that with a couple of carefully-placed if forms. we'll see.
ken