Small UI question: toolbars
Small UI question: toolbars
- Subject: Small UI question: toolbars
- From: Leonard Budney <email@hidden>
- Date: Tue, 5 Jul 2005 10:08:20 -0400
Hello!
I'm implementing a toolbar for my document-based app. I saw the
example at cocoa dev central, which was for a dialog-based app, and
am muddling through to apply its example to my app. A couple of
questions come to mind:
1) So far, there's one toolbar item, "Show/Hide Checked". Clicking it
actually changes the user preference governing whether to show or
hide checked items. As a result, every document is affected,
regardless which toolbar is actually clicked. Before creating the
toolbar, the only way to access this behavior was through the
preference panel, so in that sense nothing has changed. The question:
is this a UI faux pas? Is it legit for a toolbar button to alter a
preference that then affects every window?
2) In adapting the example from a dialog-based app, I had trouble
getting delegates to line up properly. Specifically, the menu talks
to the toolbar controller, which is set in MainMenu.nib, but the
document window also does so, and this is done within MyDocument.nib.
I decided to implement the toolbar controller as a singleton, and
invoke it directly in code via [ToolbarController
sharedToolbarController], rather than instantiating it in IB. Does
that make sense? Is there a better, more standard way?
3) I want toolbar customization to affect all documents. So far, I
only actually need one instance of my one-item NSToolbar, so I create
it as a member of the singleton ToolbarController and assign it to
every document window. Next I'll add a "save" button and grapple with
the issue of identifying which document to save--which does look
doable. Am I on the wrong track? Are there bad things that can happen
to me for taking this approach?
Perhaps all these questions can be answered with a link to an example
document-based app using toolbars, or a pointer into the documentation.
Thanks!
Len.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden