Inherits from: NSWindow : NSResponder : NSObject
Package: com.apple.yellow.application
A panel is a special kind of window, typically serving an auxiliary function in an application. NSPanel adds a few special behaviors to NSWindow in support of the role panels play:
In addition to these automatic behaviors, NSPanel allows you to configure certain other behaviors common to some kinds of panels:
- Configuring panel behavior
- setFloatingPanel:
- isFloatingPanel
- setBecomesKeyOnlyIfNeeded
- becomesKeyOnlyIfNeeded
- setWorksWhenModal
- worksWhenModal
public NSPanel(NSRect aNSRect, int anInt, int anInt, boolean aBoolean)
public NSPanel(NSRect aNSRect, int anInt, int anInt, boolean aBoolean, NSScreen aNSScreen)
public boolean becomesKeyOnlyIfNeeded()
true
if
the receiver becomes the key window only when the user clicks a
view object that needs to be first responder to receive event and
action messages; for example if it edits text or otherwise accepts
keyboard input. Returns false
if
it becomes the key window whenever clicked. NSPanel by default returns false
,
indicating that panels become key as other windows do.See Also: setBecomesKeyOnlyIfNeeded, - needsPanelToBecomeKey (NSView)
public boolean isFloatingPanel()
true
if
the receiver is set to float above normal windows, false
otherwise. A
floating panel's window level is FloatingWindowLevel
.
NSPanels by default returns false
,
indicating that they inhabit the normal window level.See Also: setFloatingPanel:, - level (NSWindow)
public void setBecomesKeyOnlyIfNeeded(boolean flag)
true
,
the receiver becomes the key window only when keyboard input is
needed; if flag is false
,
it becomes the key window whenever clicked. This behavior is not
set by default. You should consider setting it only if most controls
in the NSPanel aren't text fields, and if the choices that can
be made by entering text can also be made in another way (such as
by clicking an item in a pick list).See Also: becomesKeyOnlyIfNeeded, - needsPanelToBecomeKey (NSView)
public void setFloatingPanel(boolean flag)
true
,
sets the receiver's window level to FloatingWindowLevel
;
if flag is false
,
sets the receiver's window level to NormalWindowLevel
.
The default is false
. It's appropriate for
an NSPanel to float above other windows only if all of the following
conditions are true:See Also: isFloatingPanel, - setLevel: (NSWindow)
public void setWorksWhenModal(boolean flag)
true
,
the application object sends events to the receiver even during
a modal loop or session; if flag is false
,
the receiver gets no events while a modal loop or session is running.
See "Modal Windows" in the NSWindow class specification for
more information on modal windows and panels.See Also: worksWhenModal, - runModalForWindow: (NSApplication) - runModalSession: (NSApplication)
public boolean worksWhenModal()
true
if
the receiver is able to receive keyboard and mouse events even when some
other window is being run modally, false
otherwise. NSPanels
by default return false
, indicating
their ineligibility for events during a modal loop or session. See "Modal
Windows" in the NSWindow class specification for more information
on modal windows and panels.See Also: setWorksWhenModal, - runModalForWindow: (NSApplication) - runModalSession: (NSApplication)