Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > New Panther features for developers

New Panther features for developers
Thread Tools
Gametes
Mac Elite
Join Date: Sep 2000
Location: Norfolk, Va
Status: Offline
Reply With Quote
Jun 25, 2003, 06:14 PM
 
This image suggests that tabs will be totally replaced by the new button rows. Can anyone verify if this happens automatically, in IB?
you are not your signature
     
IamBob
Senior User
Join Date: Nov 2000
Status: Offline
Reply With Quote
Jun 26, 2003, 11:38 AM
 
Please God(s)....no!?

They look awful distracting to me. If that is something we're going to see more of I only hope there's an easy way to disable/change it.

That said, I wouldn't mind being able to make those "button rows" in IB. They make a great box-less group of buttons.
     
sandsl
Senior User
Join Date: Aug 2002
Location: Oxford, England
Status: Offline
Reply With Quote
Jun 26, 2003, 12:03 PM
 
Tabs have been replaced by those button groups. I'm not sure (yet) if it is possible to specifically select if they can appear as tabs rather than buttons.
Luke
     
clarkgoble
Mac Elite
Join Date: Mar 2001
Location: Provo, UT
Status: Offline
Reply With Quote
Jun 26, 2003, 04:53 PM
 
I like this a *lot* better than the 10.2 tabs. Why? Because there is a huge confusion over what the tabs are. Really they function as buttons and not tabs.

Think of your real world use of tabs. Either they are part of a paper, and thus you ought to be able to drag the tab and document, much as you can in Adobe GoLive, or else they ought to encapsulate a document, as in Safari.

Yet tabs in control panels and the like are really a "give me a new set of buttons." I truly don't like that function as I think they are better met by a button.

Now as to the tabs in Project Builder. I honestly didn't mind most of them there as I think they functioned the way they do in Safari. (Indeed I believe Safari's tabs were largely based on Project Builder) For multiple *documents* I think a tab is fundamentally more usable than a button-bar.
     
bewebste
Senior User
Join Date: Mar 2000
Location: Ithaca, NY
Status: Offline
Reply With Quote
Jun 26, 2003, 04:54 PM
 
That is the default way that tabs are now drawn under Panther, and I'm pretty sure it can't be changed. I like that the new tabs now take up less window real estate, but I'm not really sure of the reasoning behind changing them. The darkened background is pretty aesthetically pleasing, to me at least. They've also update NSBox with a similar background/border scheme.
     
DaGuy
Senior User
Join Date: Oct 2000
Location: Lawrence, KS
Status: Offline
Reply With Quote
Jun 27, 2003, 02:41 AM
 
What about toolbars? Is there an associated IB widget or are they still to be implemented programmatically?
     
iOliverC
Grizzled Veteran
Join Date: Jun 2002
Status: Offline
Reply With Quote
Jun 27, 2003, 02:43 AM
 
Originally posted by DaGuy:
What about toolbars? Is there an associated IB widget or are they still to be implemented programmatically?
You still gotta do it programmtically, there is no toolbar widget in the preview dev tools Interface Builder.
     
DaGuy
Senior User
Join Date: Oct 2000
Location: Lawrence, KS
Status: Offline
Reply With Quote
Jun 27, 2003, 02:55 AM
 
Thanks.

So what else is new? I haven't heard about any news APIs except for those associated with the SafariSDK. Any news on IB?
     
HCRefugee
Fresh-Faced Recruit
Join Date: Mar 2003
Status: Offline
Reply With Quote
Jun 27, 2003, 02:40 PM
 
>So what else is new? I haven't heard about any news APIs except for those
>associated with the SafariSDK

The WWDC 2003 video re: QuickTime indicated that greater access to the QT API via Cocoa is forthcoming. About time!
     
gralem
Dedicated MacNNer
Join Date: Nov 2000
Location: Malaysia
Status: Offline
Reply With Quote
Jun 27, 2003, 04:17 PM
 
Originally posted by DaGuy:
Thanks.

So what else is new? I haven't heard about any news APIs except for those associated with the SafariSDK. Any news on IB?
In my mind, NSController class is the biggest deal. New IB Palettes and BINDINGS attributes. Less coding, more handled by IB.

---gralem
     
techtrucker
Senior User
Join Date: Feb 2003
Location: USA
Status: Offline
Reply With Quote
Jun 27, 2003, 04:19 PM
 
What's the story with the NSController class?
MacBook 2.0 160/2GB/SuperDrive
Lots of older Macs
     
hamiltondj
Forum Regular
Join Date: Aug 2000
Location: middlesex, nj, usa
Status: Offline
Reply With Quote
Jun 27, 2003, 04:26 PM
 
Originally posted by techtrucker:
What's the story with the NSController class?
Panther adds a controller class that will handle alot of the glue code.

MVC is not only preferred but using the controller class will actully speed up how fast you chan churn out an app.
     
Gametes  (op)
Mac Elite
Join Date: Sep 2000
Location: Norfolk, Va
Status: Offline
Reply With Quote
Jun 27, 2003, 08:44 PM
 
So what does NSControler do? automethods for UI elements? autoinventory? how about just a list of the methods it implements.
you are not your signature
     
3R1C
Mac Enthusiast
Join Date: Oct 2001
Status: Offline
Reply With Quote
Jun 28, 2003, 12:07 AM
 
WWDC == world wide developer conference.
the key word in that acronym is DEVELOPER. there are threads with 300 posts about the panther gui. Where can I find information about new DEVELOPER stuff? Im really frustrated by this. It sounds like there is a crapload of new great stuff for us but i cant find out whats new. I want to thank the few developers here who have shared their new discoveries, but to be frank, i really dont care too much about the gui.
( Last edited by 3R1C; Nov 11, 2003 at 12:00 AM. )
3R1C
     
techtrucker
Senior User
Join Date: Feb 2003
Location: USA
Status: Offline
Reply With Quote
Jun 28, 2003, 09:09 AM
 
Originally posted by hamiltondj:
Panther adds a controller class that will handle alot of the glue code.

MVC is not only preferred but using the controller class will actully speed up how fast you chan churn out an app.
How does it differ from the way it works now...In my apps I create controller objects from either NSObject or NSWindowController, and I generally follow the MVC paradigm. It sounds like instead of starting with NSObject you start with NSController and that gives you added functionality?
Thanks to those who have the Panther preview and who are taking the time to post info and screenshots.
MacBook 2.0 160/2GB/SuperDrive
Lots of older Macs
     
dont.wanna.tell
Forum Regular
Join Date: Oct 2000
Location: Berlin / Germany
Status: Offline
Reply With Quote
Jun 28, 2003, 04:44 PM
 
The idea is that you don't need to do any coding at all.

As far as I know things these are some old classes from EOF that have finally surfaced in Cocoa now.

In IB you just select NSController and tell it to what preference it should bind that controll, or to what modell it should bind this or that table view and everything else happens automagically.

cu Martin
     
Gametes  (op)
Mac Elite
Join Date: Sep 2000
Location: Norfolk, Va
Status: Offline
Reply With Quote
Jul 1, 2003, 12:43 AM
 
The mother load:

XML Parsing
Speech Recognition and Synthesis
A URL implementation which totally handles all web access... period: cookies, passwords, downloading, etc.
The NSController class and its subclasses which seem so freakishly new to me that I'm simply baffled by their potential power.
NSInputStream and NSOutput stream for the command line (ahem and ahem)
Alerts and shadows UI style for use.
Beefed up Glyph and Type handling... I think we're going to see alot of really cool text layout like free 2D math equations in TextEdit.
( Last edited by Gametes; Jul 1, 2003 at 02:59 AM. )
you are not your signature
     
DaGuy
Senior User
Join Date: Oct 2000
Location: Lawrence, KS
Status: Offline
Reply With Quote
Jul 1, 2003, 11:20 AM
 
Originally posted by Gametes:
The mother load:

XML Parsing
Speech Recognition and Synthesis
A URL implementation which totally handles all web access... period: cookies, passwords, downloading, etc.
The NSController class and its subclasses which seem so freakishly new to me that I'm simply baffled by their potential power.
NSInputStream and NSOutput stream for the command line (ahem and ahem)
Alerts and shadows UI style for use.
Beefed up Glyph and Type handling... I think we're going to see alot of really cool text layout like free 2D math equations in TextEdit.


Hold on... I need to wipe the drool of my keyboard. Swish, swish... Done! Now please tell us more!

1. Is the XML SAX or DOM based or does the API include both?

2. How does NSInputStream work? Is it just a more straightforward way to send commands the STDIN than the what you get when using the NSTask and NSPipe combination? Is NSInput synchronous/asynchronous or can it be both?

3. Can you or anyone else post some snipplets as to get some idea about of the XML, NSInputStream and and NSController?

I couldn't attend WWDC
     
lfrog2
Fresh-Faced Recruit
Join Date: Apr 2001
Status: Offline
Reply With Quote
Jul 1, 2003, 12:01 PM
 
Originally posted by Gametes:
The mother load:

XML Parsing
Speech Recognition and Synthesis
A URL implementation which totally handles all web access... period: cookies, passwords, downloading, etc.
The NSController class and its subclasses which seem so freakishly new to me that I'm simply baffled by their potential power.
NSInputStream and NSOutput stream for the command line (ahem and ahem)
Alerts and shadows UI style for use.
Beefed up Glyph and Type handling... I think we're going to see alot of really cool text layout like free 2D math equations in TextEdit.
I can't wait to get my copy of Panther and XCode!
     
Gametes  (op)
Mac Elite
Join Date: Sep 2000
Location: Norfolk, Va
Status: Offline
Reply With Quote
Jul 1, 2003, 02:24 PM
 
And I don't know if people have already noticed this, but Disc Recording is freely available too, and the keychain framework has been beefed up.

I'm not at my computer, but what I read of the NSXMLParser header was that you feed it data or html and it notifies a delegate (there are like a dozen delegate methods, presumably so that the class can be used for background threaded parsing of multiple sites) with the results as it moves through the website. Methods like (to the delegate) parser:foundAttribute:at: or something like that. It looked really thorough, but I don't know what document model it prefers.
All I know is -- and I can't decide if I'm happy or sad about this -- is that the weeks I spent writing my own parser seem now to have been only for my own education.
you are not your signature
     
BimmerBoy79
Fresh-Faced Recruit
Join Date: May 2002
Location: London, ON Canada
Status: Offline
Reply With Quote
Jul 1, 2003, 03:53 PM
 
I don't know if anyone else has found this but in the DevTools Extras directory there is also a AddressBook palette. It let's you drop an address book search right into your app...pretty damn nice!

Michael.
     
3R1C
Mac Enthusiast
Join Date: Oct 2001
Status: Offline
Reply With Quote
Jul 1, 2003, 04:26 PM
 
Bindings
A major new feature in Cocoa for Panther is the ability to bind UI objects to model objects through controllers. This technology allows Cocoa developers to get much more application implementation done directly in Interface Builder.

The Cocoa Binding technology is based in the Model-View-Controller (MVC) design paradigm. Cocoa provides a rich set of view and model classes; but, until now, there was no powerful and generalized controller functionality. With the new binding technology, Cocoa developers finally have API level and Interface Builder level support for binding display values and characteristics of an application's UI to data held in the application's data model. Via the controller layer, data values and changes can be propagated live between UI elements and the application's data storage without developers having to write all of the glue code they had to before.

In Interface Builder, check out the Bindings palette for NSController classes that can be added to new and existing nibs. These controllers add functionality like selection tracking, propagating edits in the user interface, sorting, and handling input validation. The logic built into the NSUserDefaultsController, NSObjectController, and NSArrayController, which are provided to you by default, allow you to focus on designing the data model and user interface without having to write excessive amounts of glue code to get to a polished application. The controller classes provide the glue logic for you.

In Interface Builder, there is a new inspector item for AppKit widgets: the bindings Inspector. This inspector allows you to bind user interface elements like NSTextField, NSTableView, NSImageView, NSTabView, to NSController instances in your nib. This way you don't have to explicitly make outlet connections to your NSDocument or NSApplication file's owner. Various properties of the widget (such as the source of a NSTextField's value, or the font and text color of the text field) can be controlled through a controller. Interface Builder's bindings inspector allows you to create a binding between each property of a UI widget and a controller.

Relevant header files for this technology include <AppKit/NSKeyValueBinding.h>, <AppKit/NSController.h>, <AppKit/NSArrayController.h>, <AppKit/NSObjectController.h>, <AppKit/NSUserDefaultsController>, and <AppKit/NSEditor.h>.

Key value coding has also been enhanced to support the bindings technology. Please refer to <Foundation/NSKeyValueCoding.h> and <Foundation/NSKeyValueObserving.h> for info.

We are working feverishly to bring you more documentation for the Cocoa Binding APIs and functionality. Please file any bugs you find and check the Apple developer website for updates.
( Last edited by 3R1C; Nov 10, 2003 at 11:57 PM. )
3R1C
     
3R1C
Mac Enthusiast
Join Date: Oct 2001
Status: Offline
Reply With Quote
Jul 1, 2003, 04:31 PM
 
NSTableView
Now implements the NSUserInterfaceValidations protocol, and specifically validates the selectAll: target/action method.

NSTableView and NSOutlineView draw a keyboard focus indication if there is enough room to display one. The focus indication is draw either around the enclosing scroll view, or around the table and header (when not enclosed in a scroll view). If there is not enough room to display most of the focus ring, then none is shown.

In Jaguar and prior releases, -selectedCell would only returned a non-nil value when editing text via a double click. Now, in apps linked agains Panther or later, selectedCell always returns the cell that was clicked, regardless of what type of cell was clicked. So, while the user clicks on a NSSliderCell and drags the mouse around, the table will return the slider cell that is being manipulated from -selectedCell. This will allow you to query the current slider value from your action method.

For applications linked against Panther or later, NSTableView now returns YES from -needsPanelToBecomeKey. This means that users can navigate to a table using the <tab> key. Previously, unless you subclassed NSTableView and overrode this method, the user would have to be in "Any Controls" keyboard navigation mode to be able to <tab> to a table. If the table is in a panel that returnes YES from becomesKeyOnlyIfNeeded, then this needsPanelToBecomeKey to become key returns YES only if the panel is currently key. By doing this, clicks in such panels will not force the panel to become key. Note that double clicking in a text cell to start editing will force the panel to become key.

NSTableHeaderView now waits until mouse up to select or deselect a column. If the user has clicked in an previously unselected header, the header will be drawn in a pressed (NSOnState) but not selected state until the user mouses up in the header cell. Among other things, this means that a column doesn't have to be selected in order to be moved by a user.

NSTableHeaderCell has fixed a bug with the positioning of its indicator image. Prior to Panther, indicator images set using NSTableView's -setIndicatorImage:inTableColumn: resulted in an image that was drawn too low, such that only the top half of the image was visible. This has been fixed. NSTableHeaderCell now properly centers the image for apps linked on or after Panther.

NSTableView's last table column now draws its column highlight all the way to the end. All other columns leave small gap between column highlights (if there is an inter-cell spacing) by their column highlight short of the actual end of the column.

NSTableView now caches the results from numberOfRowsInTableView: when possible. In the past, NSTableView messaged the data source for this value an inordinate amount of times .

Tables now supports drawing its background using the standard alternating colors used by many applications, such as iTunes. The new flags are saved in old and new style keyed archiver. This feature can be adopted at IB design time, or at runtime using the following new API:

- (void)setUsesAlternatingRowBackgroundColors:(BOOL) useAlternatingRowColors;
- (BOOL)usesAlternatingRowBackgroundColors;
NSTableView now exposes an override point to allow complete background coloring customization. To customize background drawing, override the following new API:

- (void)drawBackgroundInClipRect:(NSRect)clipRect;

Index Set Base APIs

NSTableView now provide index set based selection API:

#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
- (void)selectColumnIndexes:(NSIndexSet *)indexes byExtendingSelection:(BOOL)extend;
// Sets the column selection using the indexes. Selection is set/extended based on the extend flag.
// If a subclasser implements only the deprecated selectColumn:byExtendingSelection: methods, then this method will be called in a loop. If a subclasser implements this method, then selectColumn:byExtendingSelection: will not be used. This allows subclassers already overriding selectColumn:byExtendingSelection: to still receive all selection message. Note that, to avoid cycles, subclassers of this method and selectColumn:byExtendingSelection: should not call each other.
- (void)selectRowIndexes:(NSIndexSet *)indexes byExtendingSelection:(BOOL)extend;
// Sets the row selection using the indexes. Selection is set/extended based on the extend flag.
// If a subclasser implements only the deprecated selectRow:byExtendingSelection: methods, then this method will be called in a loop. If a subclasser implements this method, then selectRow:byExtendingSelection: will not be used. This allows subclassers already overriding selectRow:byExtendingSelection: to still receive all selection message. Note that, to avoid cycles, subclassers of this method and selectRow:byExtendingSelection: should not call each other.

- (NSIndexSet *)selectedColumnIndexes;
- (NSIndexSet *)selectedRowIndexes;
#endif
The following non-index set based APIs have been deprecated:

// A method that was deprecated in Mac OS 10.3. You should use selectColumnIndexes:byExtendingSelection: instead. See that method for more details.
- (void)selectColumn:(int)column byExtendingSelection:(BOOL)extend;
// A method that was deprecated in Mac OS 10.3. You should use selectRowIndexes:byExtendingSelection: instead. See that method for more details.
- (void)selectRow:(int)row byExtendingSelection:(BOOL)extend;
// A method that was deprecated in Mac OS 10.3. You should use selectedColumnIndexes instead.
- (NSEnumerator *)selectedColumnEnumerator;
// A method that was deprecated in Mac OS 10.3. You should use selectedRowIndexes instead.
- (NSEnumerator *)selectedRowEnumerator;

Sorting UI

NSTableView now provides a general sorting API on NSTableView which will make sorting UI implementation easier. The API consists of methods that will allow NSTableView to automatically manage the sorting UI and to create sort descriptors to be used by the data source when the user clicks on a table header. The data will not be automatically sorted, but the data source will be told when it should resort its data.

A table column is considered sortable if it it has a sortDescriptorPrototype. A sort descriptor contains three pieces of information: a key, selector, and sort direction. When used as a columns prototype, the sort descriptor defines several interesting things. First, the presence of a sort descriptor prototype indicates the column is sortable. Next the prototype's sort direction defines the initial sorting direction. Finally, the key and selector define provide a convenient location to store information the data source will need when sorting. Note that it is not required that the key match the table columns identifier, however the key must be unique from the key used by other columns.

// NSTableColumn.h
- (void)setSortDescriptorPrototype:(NSSortDescriptor *)sortDescriptor;
- (NSSortDescriptor *)sortDescriptorPrototype;
// A column is considered sortable if it has a sortDescriptorPrototype. This prototype defines several things about the columns sorting. The prototype's ascending value defines the default sorting direction. Its key defines an arbitrary attribute which helps clients identify what to sort, while the selector defines how to sort. Note that, it is not required that the key be the same as the identifier. However, the key must be unique from the key used by other columns. The sortDescriptor is archived.
Given a table with sortable columns, NSTableView will automatically manage the sorting UI. NSTableView automatically displays a sort indicator for the primary sort column. To accomplish this, NSTableView maintains a list of sort descriptors. The first sort descriptor in the list defines the primary sort key, selector, and direction. The array of sort descriptors is archived. Also, the array of sort descriptors will persist along with other column information if an autosave name is set.

// NSTableView.h
- (void)setSortDescriptors:(NSArray *)array;
- (NSArray *)sortDescriptors;
// The array of sort descriptors is archived.
@end
Now, since NSTableView doesn't manage the data, it can't sort if for you. However, it does tell you when the data needs to be re-sorted.

@interface NSObject (NSTableDataSource)
// optional - sorting support
- (void)tableView:(NSTableView *)tableView sortDescriptorsDidChange:(NSArray *)oldDescriptors;
// This is the indication that sorting needs to be done. Typically the data source will sort its data, reload, and adjust selections.
@end

@interface NSObject (NSOutlineDataSource)
// optional - sorting support
- (void)outlineView:(NSOutlineView *)outlineView sortDescriptorsDidChange:(NSArray *)oldDescriptors;
// This is the indication that sorting needs to be done. Typically the data source will sort its data, reload, and adjust selections.
@end
NSTableHeaderCell provides override points for customizing the sorting UI look. -drawSortIndicatorWithFrame:inView:ascending:priori ty: is called for each column that participates in sorting. However, by default NSTableHeaderCell only draws an indicator if priority is 0, that is, if the column is the primary sort column.

@interface NSTableHeaderCell
- (void)drawSortIndicatorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView ascending:(BOOL)ascending priority:(int)priority;
// Draws a sorting indicator given a cellFrame. If priority is 0, this is the primary sort indicator. If ascending is YES, a "^" indicator will be drawn. Override this routine to customimze the sorting UI.
- (NSRect)sortIndicatorRectForBounds:(NSRect)theRect ;
// Returns the location to display the sorting indicator given the cellFrame.
@end
( Last edited by 3R1C; Nov 10, 2003 at 11:56 PM. )
3R1C
     
3R1C
Mac Enthusiast
Join Date: Oct 2001
Status: Offline
Reply With Quote
Jul 1, 2003, 04:33 PM
 
NSCursor
Applications built on Panther or later can now use cursor images of sizes other than 16x16. The cursor size will be defined by the size of the image passed to -initWithImage:hotSpot: or -initWithImage:foregroundColorHint:backgroundColorH int:hotSpot:. Applications can check for an NSAppKitVersionNumber greater than or equal toNSAppKitVersionNumberWithCursorSizeSupport to determine whether this support is available.
we now use CoreCursors for system defined cursors. This means that you'll see new cursors for alias and copy drags, as well as slightly modified cursors for vertical and horizontal resize. We've also added additional public cursors:

+ (NSCursor *)pointingHandCursor;
+ (NSCursor *)closedHandCursor;
+ (NSCursor *)openHandCursor;
+ (NSCursor *)resizeLeftCursor;
+ (NSCursor *)resizeRightCursor;
+ (NSCursor *)resizeLeftRightCursor;
+ (NSCursor *)resizeUpCursor;
+ (NSCursor *)resizeDownCursor;
+ (NSCursor *)resizeUpDownCursor;
+ (NSCursor *)crosshairCursor;

NSToolbar
Toolbar items which have an NSBox as their view used to force the box to use NSNoBorder in the toolbar, and NSLineBorder in the customization palette. NSToolbarItem no longer does this.

NSToolbar now supports displaying the selected toolbar item in toolbars that are used as mode switchers (e.g. inspectors, color panel, etc...). The toolbar delegate must implement -toolbarSelectableItemIdentifiers to indicate which type of toolbar items can be used to indicate mode. Note that, since toolbars are very dynamic in their content, item selection is maintained by "item identifier", not by item. NSToolbar maintains selection automatically for image type items. However the selected item identifier can be explicitly set to anything by calling -setSelectedItemIdentifier:.

Toolbar "Poof" Animation
A new function, NSShowAnimationEffect() has been added to allow developers to use the same item removal animation used by controls such as toolbar and the dock. Although the API is designed as a general mechanism for system animation effects, currently only one animation exists. To run an animation, you specify the type of animation you want, the size and location of the animation, and optional callback information. The NSAnimationEffectDisappearingItemDefault effect is meant to indicate removal from a list, without actually destroying the underlying item. For example, removal from the dock does not delete the file. The NSAnimationEffectPoof simply shows a disappearing cloud, poof effect. Currently NSAnimationEffectDisappearingItemDefault and NSAnimationEffectPoof are the same effect, but they are not guaranteed to be the same in the future.

NSSearchField and NSSearchFieldCell
New subclasses of NSTextField and NSTextFieldCell have been added that create a standard UI for seach fields like the ones in Mail, Safari, and Address Book. This includes a cancel button, search button with menu and the option to send the results while typing or when the user presses return. API for NSSearchField is minimal and forwards to NSSearchFieldCell. You should set the target and action of this control or it's cell to the receiver that is interested in the search request. The border is a round text field.

@interface NSSearchField
- (void) setRecentSearches:(NSArray*)searches;
- (NSArray*) recentSearches;
- (void) setRecentsAutosaveName:(NSString*)string;
- (NSString*) recentsAutosaveName;
NSSearchFieldCell implements searching, recents list, autosave of recents, cancel.

@interface NSSearchFieldCell

- (NSButtonCell*) searchButtonCell;
- (void) setSearchButtonCell:(NSButtonCell*)cell;
This gets and sets the search button cell. In general, you won't need to change this unless you want a custom appearance or behavior. Set to nil to have no search button. By default, this button either displays a menu if a menu template is set or invokes the cell's action when clicked on.

- (NSButtonCell*) cancelButtonCell;
- (void) setCancelButtonCell:(NSButtonCell*)cell;
This gets and sets the cancel button cell. In general, you won't need to change this unless you want a custom appearance or behavior. Set to nil to have no cancel button. The cancel button is hidden if there is no text in the search field.

- (void) resetSearchButtonCell;
- (void) resetCancelButtonCell;
These calls 'reset' the search and cancel buttons by restoring the cell's image, alternate image, target, and action. All other attributes are not changed.

- (NSRect) searchTextRectForBounds:(NSRect)rect;
- (NSRect) searchButtonRectForBounds:(NSRect)rect;
- (NSRect) cancelButtonRectForBounds:(NSRect)rect;
These return the bounds for the buttons and the text field. Override position the items differently though the cell currently assumes that there is a search cell, text field, and cancel button from left to right.

- (void) setSearchMenuTemplate:(NSMenu*)menu;
- (NSMenu*)searchMenuTemplate;
This sets a menu template to use when generating a popup. If you don't want a menu, set this to nil. Special items in the menu should have tags listed below. If set, the search button has a menu indicator and will display the menu on mouse down in the search button. Setting this will change the search button images if you haven't changed them. This menu isn't modified but it is not copied so you shouldn't modify it while in use by the search field.

- (void) setSendWholeSearchString:(BOOL)flag;
- (BOOL) sendWholeSearchString;
By default, the cell's action is invoked during typing after a short delay. If you set this flag to YES, then the action is only send when the user presses the search button or presses Return or Enter on the keyboard.

- (void) setMaximumRecents:(int)maxRecents;
- (int) maximumRecents;
This allows you to set the maximum number of recents from 0 to 254. Setting to a negative value will use the default value. Setting this will trim the recents list if there are more than the new maximum.

- (void) setRecentSearches:(NSArray*)searches;
- (NSArray*) recentSearches;
You can set or get the current list of recent searches. This list may be trimmed if there are more than the allowed maximum recents.

- (void) setRecentsAutosaveName:(NSString*)string;
- (NSString*) recentsAutosaveName;
If set, then the recent search list will be saved to a application preference using the name provided and restored the next time the recents list is needed for the popup. Setting to nil will not clear out any saved lists. Setting to a valid string will discard any current recents and load from the user defaults.

These are special tags that are used by the search menu template.

#define____NSSearchFieldRecentsTitleMenuItemTag 1000
Items tagged with this value are only displayed when there are recent items to list. If there are none, this item is not part of the menu. Use it for titles and for separators that are needed for recents. You can have multiple items with this tag.

#define____NSSearchFieldRecentsMenuItemTag 1001
You should have single item with this tag. This item is copied for each recent item, retaining the appearance of the original. The recents items are listed with the most recent search first.

#define____NSSearchFieldClearRecentsMenuItemTag 1002
If there are recent items, then this item is displayed and has a special target and action set to clear the list of recents. You should only have one item with this tag.

#define____NSSearchFieldNoRecentsMenuItemTag 1003
This item is displayed when there are no recents. You can have multiple items with this tag.
( Last edited by 3R1C; Nov 10, 2003 at 11:55 PM. )
3R1C
     
3R1C
Mac Enthusiast
Join Date: Oct 2001
Status: Offline
Reply With Quote
Jul 1, 2003, 04:36 PM
 
NSSlider
A new style of slider called a circular slider (i.e. dial) is available. You can get it by setting the slider type. You then get a fixed sized slider that goes from minValue to maxValue. minValue is at the top and the value increases as you go up to just below maxValue (e.g. if you set min = 0, max = 360, you can get to 359.999). You can show tick marks and have values limited to just the tick marks the same as a regular slider. You can only have regular and small. There is no mini version.

typedef enum {
NSLinearSlider,
NSCircularSlider
} NSSliderType;

- (void)setSliderType:(NSSliderType)sliderType;
- (NSSliderType)sliderType;

NSSpeechRecognizer / NSSpeechSynthesizer
NSSpeechRecognizer and NSSpeechSynthesizer are two new AppKit classes which provide access to Mac OS X's speech capabilities. There are examples for usage of these classes in /Developer/Examples/Speech.
( Last edited by 3R1C; Nov 10, 2003 at 11:53 PM. )
3R1C
     
Uncle Skeleton
Addicted to MacNN
Join Date: Nov 2002
Location: Rockville, MD
Status: Offline
Reply With Quote
Jul 1, 2003, 06:15 PM
 
Originally posted by 3R1C:

Tables now supports drawing its background using the standard alternating colors used by many applications, such as iTunes. The new flags are saved in old and new style keyed archiver. This feature can be adopted at IB design time, or at runtime using the following new API:

- (void)setUsesAlternatingRowBackgroundColors:(BOOL) useAlternatingRowColors;
- (BOOL)usesAlternatingRowBackgroundColors;
NSTableView now exposes an override point to allow complete background coloring customization. To customize background drawing, override the following new API:

- (void)drawBackgroundInClipRect:(NSRect)clipRect;
I can't tell if it's possible to set the color of the alternating row background colors. Does it always use the iTunes color until you subclass drawBackgroundInClipRect?
     
Michel Fortin
Forum Regular
Join Date: Jul 2001
Location: Qu�bec, Canada
Status: Offline
Reply With Quote
Jul 1, 2003, 08:13 PM
 
Originally posted by Uncle Skeleton:
I can't tell if it's possible to set the color of the alternating row background colors. Does it always use the iTunes color until you subclass drawBackgroundInClipRect?
That would be good for consistency.
     
Wevah
Senior User
Join Date: Nov 2001
Location: State of Denial
Status: Offline
Reply With Quote
Jul 2, 2003, 06:24 PM
 
I'm psyched.
[Wevah setPostCount:[Wevah postCount] + 1];
     
K++
Senior User
Join Date: Jan 2002
Location: NYC
Status: Offline
Reply With Quote
Jul 18, 2003, 02:56 PM
 
Hot Damn! Every single one of these changes directly affects stuff that I have been doing and trying to do on a current project, Since Apple decided to make my life easier I'll just wait for Panther and then re-write my app from scratch to use this stuff.

On second thought, re-writing is a bit drstic, I'll just rip the nibs apart and put em back together while keeping my Model intact, so Controller and View get over-hauled.

P.S. All that's left now is to go bitch about Apple's tab replacement.
     
Diggory Laycock
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Jul 18, 2003, 06:25 PM
 
     
Synotic
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Jul 18, 2003, 07:58 PM
 
Can anyone provide additional information about this speech recognition?
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 06:47 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,