• Hello MLAers! We've re-enabled auto-approval for accounts. If you are still waiting on account approval, please check this thread for more information.

Pop-up menus on System 6

Can anyone point me to a working example of how to use PopUpMenuSelect to implement a pop-up menu in System 6?

For context, I'm working through the examples in Macintosh C Programming Primer, Volume I, Second Edition, but limiting myself to System 6 compatibility. This means the system pop-up menu control (procID 1008) is not available.

In the WorldClock example, I worked around this limitation by moving the time zone menu to the menu bar, no biggie. But now I'm starting the Reminders example and there are multiple pop-up menus to implement, so I'd like to use that design. Plus, they just seem like generally useful controls to have available.
 
Perfect, thank you!

It took me a while to locate the first edition, I think because the second edition was way more popular? Anyway, for future reference:

First edition ISBN: 0201156628
Second edition ISBN: 0201608383
 
So while not directly related to the topic at hand, I have a challenge that isn't addressed in Volume I: designing windows using ResEdit.

I understand how to lay out a DLOG using DITL, but can I also use DITL to lay out controls for a document WIND? Is that even standard practice, or are window controls typically laid out procedurally, instead?
 
Is that even standard practice, or are window controls typically laid out procedurally, instead?

I think the intention is really that a WIND is something that your application is in control of drawing most of, whereas if you want something with controls and stuff, you would tend to only have one of them and it would be a modeless dialog. Don't forget you can use other WDEFs for your dialogs too. So, if you want a WIND you're probably going to be in charge of drawing it yourself (including adding controls yourself).
 
So while not directly related to the topic at hand, I have a challenge that isn't addressed in Volume I: designing windows using ResEdit.

I understand how to lay out a DLOG using DITL, but can I also use DITL to lay out controls for a document WIND? Is that even standard practice, or are window controls typically laid out procedurally, instead?
Obviously, lots of early pre-System 7 apps use controls within WINDs. The major reason why I suspect that DITLs aren't used for this is because they only implement a layout manager suitable for DLOGs where the dimensions of the window are fixed.
 
A DLOG combines the info of a WIND with a DITL.
Dialogs can be modeless - meaning you can interact with other stuff while it is displayed and it can be resized.
Sample source code and resources at https://68kmla.org/bb/index.php?threads/localtalk-but-faster.45615/post-505648
I don't recall if that source code works on System 6?
The code was reverse engineered from Apple's ADB Analyzer utility which has date 1990. I believe System 7 is 1991. Several non-ADB related windows were added for serial port stuff. I used ADB Analyzer as the base for my serial port stuff because ADB Analyzer uses the serial port to sniff ADB. Here's a screenshot https://68kmla.org/bb/index.php?threads/localtalk-but-faster.45615/post-505309

I used Resorcerer to create and edit resources.
 
Typically, for windows you use ResEdit to define the window properties, but laying out and managing the controls in the window is on you. You can create the controls in ResEdit or just define them in code, but it depends on your use case. As @joevt points out, you can create a moveable modeless dialog box and use ResEdit to layout the controls and then you handle all the event processing within a modeless dialog proc. Typically, apps adding controls to windows manage the layout and updating through code and standard window activate and update events.
 
Back
Top