Article View: comp.sys.mac.oop.powerplant
Article #39Re: LWindow-Can change AutoPosition Manually?
From: Eden Smallwood
Date: Tue, 03 Jul 2001 18:45
Date: Tue, 03 Jul 2001 18:45
54 lines
3444 bytes
3444 bytes
In article <B7669966.27EA%sk@karma-lab.com>, Stephen Kay <sk@karma-lab.com> wrote:
� Is it possible to change the "AutoPosition" attribute of an LWindow
� dynamically before it is created?
�
� In other words, the WIND Resource type provide these constants:
�
� noAutoCenter = 0x0000,
� centerMainScreen = 0x280a,
� alertPositionMainScreen = 0x300a,
� etc.
�
� You can select one of these in LWindow's Inspector (in Constructor).
� Can you change this on the fly before you create the windows through code?
It's *Backward-compatible-Man* ("BM"), to the rescue!
The other response you got for system 8.5 and above- I guess that's
the right way to do it, though it seems like alot of trouble for what
you want to do. For earlier OS, you might try something more brute force:
The PPob file you're editing in Constructor- if you drop that file
on ResEdit, you'll notice the 'WIND' resources in there which correspond
to your LWindows- the LWindow will be using that regular ol' Mac
toolbox WIND resource to *base itself* on- the values in that WIND are
used in creating the LWindow.
So, you've almost answered your own question- just grab that WIND,
change the field with that position value, before you execute the
code which causes UReanimator to read that PPob, which contains an
LWindow, which reads that WIND. See?
Handle windH = ::Get1Resource( 'WIND' , theID );
HLock( windH );
(*windH)[ theOffset ] = centerMainScreen;
HUnlock( windH );
NowDoPowerPlantCodeToLoadAndShowWin( theID );
As far as theOffset, *where* that value is stored, I think it's
the last two bytes of a system 7 or beyond WIND, but you can deduce
it for yourself either by playing in ResEdit, ( duplicate the WIND,
alter the "autoPosition" of one from the menu, compare those two ), or
add up what you see in "MacWindows.r" describing the WIND. See?
Who *was* that BitMasked man?
Eden
� If someone knows how to do this, it would be greatly appreciated.
� I spent several hours so far attempting to understand and track this down,
� but it's not clear to me at all whether this is even possible.
�
� Thanks,
� Stephen Kay
Technical Details
Message-ID:
<030720011145021478%zeppenwolf@geocities.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!news.gtei.net!news.lafn.org!zeppenwolfReferences:
<B7669966.27EA%sk@karma-lab.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10bcce,c55fc3df69c11b0 X-Google-Attributes: gid10bcce,public X-Google-Thread: f635e,c55fc3df69c11b0 X-Google-Attributes: gidf635e,public X-Google-Thread: f7f77,c55fc3df69c11b0 X-Google-Attributes: gidf7f77,public X-Google-ArrivalTime: 2001-07-03 11:45:03 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!news.gtei.net!news.lafn.org!zeppenwolf From: Eden Smallwood <zeppenwolf@geocities.com> Newsgroups: comp.sys.mac.oop.powerplant,comp.sys.mac.programmer.codewarrior,codewarrior.mac Subject: Re: LWindow-Can change AutoPosition Manually? Date: Tue, 03 Jul 2001 11:45:02 -0700 Organization: Bungalows Of The Holy Lines: 54 Message-ID: <030720011145021478%zeppenwolf@geocities.com> References: <B7669966.27EA%sk@karma-lab.com> NNTP-Posting-Host: 192.168.10.21 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: zook.lafn.org 994185784 67905 192.168.10.21 (3 Jul 2001 18:43:04 GMT) X-Complaints-To: usenet@lafn.org NNTP-Posting-Date: 3 Jul 2001 18:43:04 GMT User-Agent: YA-NewsWatcher/3.1.8