home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!gatech!hubcap!opusc!usceast!walkerj
- From: walkerj@math.scarolina.edu (Jim Walker)
- Subject: Re: popup menus in non-system font
- Message-ID: <walkerj.716184884@milo.math.scarolina.edu>
- Sender: usenet@usceast.cs.scarolina.edu (USENET News System)
- Organization: USC Department of Computer Science
- References: <1992Sep10.214027.7936@dcs.qmw.ac.uk>
- Date: 11 Sep 92 04:14:44 GMT
- Lines: 59
-
- In <1992Sep10.214027.7936@dcs.qmw.ac.uk> jeremyr@dcs.qmw.ac.uk (Jeremy Roussak) writes:
-
- >I want a popup menu to appear in a non-system font and size.
- >There's something about this in the Q&A stack, so I followed
- >Apple's advice. My code looks like this:
-
- >SysFontFam = (*v.options)->menuFont;
- >SysFontSize = (*v.options)->menuSize;
- >LastSPExtra = CurFMInput = -1;
-
- >then PopUpMenuSelect, then reset SysFontFam and SysFontSize and
- >invalidate the other two globals again.
-
- >Now, this works a treat. Until, that is, I run an app like
- >MSWord (are there any?) or even, I am told, MacWrite IIJ. Then
- >(and sometimes for no apparent reason), although the font
- >changes for the popup, the size doesn't: it stays at 12 point.
- >Checking with MacsBug, SysFontSize is set to 9.
-
- >The problem persists after running MSWord, even after quitting
- >it. Sometimes it will then go away again, but more often it
- >persists until I reboot.
-
- Here's an answer, archived from CompuServe:
-
- |Date: Wed, Aug 19, 1992 11:32:27 AM
- |Subject: #95335-PopUpMenuSelect + style
- |From: Spec Bowers 70731,3710
- |To: Ken Elston 71251,310
- |
- |
- |Ken,
- |
- |It's a bug in several Microsoft products. You can program around it but it's a
- |nuisance.
- |
- |The Window Manager's port is normally set to size 0, system standard.
- |Microsoft comes along and sets it to size 12 and doesn't restore it.
- |
- |The technique described in previous messages for setting font and size for a
- |popup menu, simply sets the system standard. Whenever a port is using size 0,
- |it uses the standard size stored in the low memory globals. If the port is set
- |to 12 or any other size, the default size is ignored.
- |
- |The cure is to set the window manager's port (WMGRPort) to size 0 before
- |calling PopupMenuSelect. You'll have to save the current port, get the WMGR
- |port, set the current port to be the WMGR port, set the size to 0, then
- |restore the current port to the original. You probably should reverse the
- |process after PopupMenuSelect returns. It is proper practice to restore port
- |settings. On the other hand the proper setting for the WMGR port is 0.
- |
- |
- |Spec Bowers
- |Bowers Development
- |(developers of AppMaker)
-
- --
-
- -- Jim Walker USC Dept. of Math. walkerj@math.scarolina.edu
-