Geometry 関数
NSBundle
NSDictionary
NSFileManager
NSMutableAttributedString
NSNumber
NSScanner
NSString
NSTimer
Graphic 関数
NSApplication
NSBezierPath
NSCell
NSColor
NSCursor
NSCustomImageRep
NSDocument
NSDocumentController
NSDragging
NSEvent
NSFontManager
NSGraphicsContext
NSImage
NSMenu
NSOutlineView
NSPanel
-パネルをモーダルダイアログの上に表示する
NSPopUpButton
NSResponder
NSScrollView
NSString 追加
NSTableColumn
NSTableView
NSTextStorage
NSTextView
NSToolbar
NSView
NSWindow
NSWorkspace
その他
.nib ウィンドウ
Views パレット
クラス
インスタンス変数
メソッド
CFXML
Carbon Event
Carbon Graphics
Cocoa で日本語
メソッド
その他

- Application Kit-
NSPanel

Application Kit - NSPanel
パネルをモーダルダイアログの上に表示する
Keywords: setWorksWhenModal:, NSModalPanelWindowLevel

Mac OS X ではモーダルダイログってのがある。たとえばオープンダイアログみたいに、それを閉じるまで他のウィンドウが前面にこないダイアログだ。でも、そいつを表示している間に、パネルを出したい状況もあるよね。TextEdit でのエンコーディング設定パネルとかがその例だ。

こういうパネルを作るには setWorksWhenModal: を使う。

Application Kit/NSView.h
- (void)setWorksWhenModal:(BOOL)flag;

普通、モーダルダイアログが表示されている間は他のウィンドウにイベントがいかないんだけど、これを使うとパネルにもイベントがいくようになる。

あと、パネルをモーダルウィンドウよりも前面に持っていかないといけないんで、setLevel:NSModalPanelWindowLevel を設定してやる。これで OK。



[Home] [Download] [Archives] [BBS] [Cocoa Programming Tips 1001] [Core Foundation の秘密] [Safari Developer Center] [はじめてのブラウザのつくり方] [Sketch BP] [スクリーンセイバーを作ろう] [Objective-C 最適化] [Authorization API 完全理解] [Mac OS X Programming Books Review] [オブジェクト指向の言語比較論] [panther-dev]

mailto: mkino@xd5.so-net.ne.jp