Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!hplabs!hpda!hpcupt1!hpcuhb!hpindda!atchison From: atchison@hpindda.HP.COM (Lee Atchison) Newsgroups: comp.sys.mac.programmer Subject: Re: Showing a list of all the available windows Message-ID: <7390004@hpindda.HP.COM> Date: 25 Feb 88 21:31:47 GMT References: <8224@eleazar.Dartmouth.EDU> Organization: HP Information Networks, Cupertino, CA Lines: 50 / hpindda:comp.sys.mac.programmer / rs4u+@andrew.cmu.edu (Richard Siegel) / 9:45 am Feb 24, 1988 / > >It's "SetItem" you're thinking of; "SetIText" is for setting dialog items. Thanks for correcting me. My copy of IM is at home. >I need to write a Windows menu... > >The question is, when to maintain it? Every activate/deactivate event? That >seems the best question; you can waste a LOT of time doing it every time >through the main event loop. Anyway, the window list only changes on >activate/deactivate events anyway.... First, I'm assuming that you are only concerned about inserting windows that you use into your menu (ie. you don't care about DA windows, etc.). Now, the only time you need to update the window list is when you create and destroy a window. You don't have to update it everytime there is an activate/deactivate event. I have an application that I have a window list. I recreate the window list everytime I create/destroy a window. I also go one step further, however. I put a check mark by the active window. So, I use two routines, one which recreates the window menu list (which I call after window creation and destruction) and one which checks/unchecks the active window which is call during the activate/deactivate event. Actually, the code to maintain the window list is quite easy. If you, or anyone else, is interested in some source code segments, I'd be glad to send them.... > > --Rich > >=================================================================== >Richard Siegel >Confused Undergrad, Carnegie-Mellon University > >The opinions stated here do not represent the policies >of Carnegie-Mellon University. > >Arpa: rs4u@andrew.cmu.edu >UUCP: {decvax,ucbvax,sun}!andrew.cmu.edu!rs4u >================================================================== >---------- -lee ---- Lee Atchison Hewlett Packard, Information Networks Division atchison%hpindda@hplabs.hp.com