Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!apple!amdahl!dwl10 From: dwl10@uts.amdahl.com (Dave Lowrey) Newsgroups: comp.sys.amiga Subject: Re: Anybody know how to do this stuff? Message-ID: Date: 15 Dec 89 16:02:58 GMT References: <6149@nigel.udel.EDU> Reply-To: dwl10@amdahl.uts.amdahl.com (Dave Lowrey) Organization: Amdahl Corporation, Houston TX Lines: 34 In article <6149@nigel.udel.EDU> koren%hpfelg.hp.com@cunyvm.cuny.edu writes: > >Well, this point is a little unclear to me. Who "owns" the CLI window? >Is the the currently running shell? What if a shell is invoked from >within a shell? I wished to add a command which lets the user change >the window title bar of the CLI window by saying something like: > > window -title "my title" > >I wanted to implement this command as an external binary. The binary >sets the window title and then exits. Perhaps that is not a legal thing >to do, in which case I'll leave the command out. > The window is owned by the process that opened it. You will have problems with writing your program for that reason. The "owner" of the window is ata responsible for refreshing it. Part of the refresh process is to re-write the title, if necessary. This requires the title text to be avaliable. If you make a new title, it will stay around until the window is refreshed, t then the title will be garbage because your program has exited, and the memory that was taken by the new title has been allocated for something else! You could allocate memory for the title, and not free it. But then who will free it when the window is closed? I attempted to do this, and found the only way was to have a program sitting in the background that periodically checked the windows, and changed titles if necessary. I decided it wasn't worth the extra cycles and memory. -- "What is another word | Dave Lowrey | [The opinions expressed MAY be for 'Thesaurus'?" | Amdahl Corp. | those of the author and are not | Houston, Texas | necessarily those of his Steven Wright | amdahl!dwl10 | employer] (`nuff said!)