Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dump the dialog manager



On Wednesday, February 27, 2002, at 23:20, Bryan Pietrzak wrote:
If you have the luxury, dump the dialog manager and just use windows and
controls. The only challenge here is instantiating windows and controls,
but you can use NIBs to do that, or AuntieDialog to read in a DLOG and
DITL and create a window and controls. Then you can use the modern
Carbon Event method of dialog processing. It works really well, it's
easy and it doesn't suffer the limitations of dialogs which are a dying
breed and not as well supported by Carbon.
:
:
As I said, the only tricky thing is instantiating your window and
control. In my cases, I use an approach I developed quite a while ago,
long before Carbon. I layout my dialogs in Resourcerer using DLOG. But,
I only use dialog item controls in the dialog, no "built-in" dialog
items. I use this dialog to visually lay things out. Then I have a
control list resource 'CTL#' that is simply a list of shorts
representing the resource IDs of the controls used in the dialog.

It's simpler just to use GetNewDialog to instantiate your window and controls. I create a standard DLOG and DITL, and a dlgx resource to specify "Use theme controls" and "Use control hierarchy" That way, every dialog item is a control. After calling GetNewDialog I call GetDialogItemAsControl to get a ControlRef for each of my items. In effect, I have instantiated a window with controls.

CarbonEvents certainly is the easiest way to manage the controls, menus, and windows. It's much better and easier than ModalDialog, but that doesn't mean that all of the Dialog Manager is junk. GetNewDialog still is a useful way to instantiate the window and its controls. A secondary advantage is that you can layout the dialog with familiar tools such as Resorceror.

In my case, of course, I use AppMaker to layout the dialog and to generate the CarbonEvents code to manage it.

Spec Bowers
Bowers Development
(developers of AppMaker)
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.