mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 05:50:48 +00:00
Add backend support for the NSWindow child mechanism and use it for
popup buttons. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27719 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d07ee5d56f
commit
b32b160823
5 changed files with 38 additions and 2 deletions
|
@ -896,6 +896,12 @@ GSCurrentServer(void)
|
|||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
- (void) setPartentWindow: (int)partentWin
|
||||
forChildWindow: (int)childWin
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
|
|
@ -828,7 +828,10 @@ static NSImage *_pbc_image[5];
|
|||
onScreen: [cvWin screen]
|
||||
preferredEdge: _pbcFlags.preferredEdge
|
||||
popUpSelectedItem: selectedItem];
|
||||
|
||||
|
||||
// Set to be above the main window
|
||||
[cvWin addChildWindow: [mr window] ordered: NSWindowAbove];
|
||||
|
||||
// Last, display the window
|
||||
[[mr window] orderFrontRegardless];
|
||||
|
||||
|
@ -844,11 +847,17 @@ static NSImage *_pbc_image[5];
|
|||
- (void) dismissPopUp
|
||||
{
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
NSMenuView *mr = [_menu menuRepresentation];
|
||||
NSWindow *mWin;
|
||||
|
||||
[nc removeObserver: self
|
||||
name: NSMenuDidSendActionNotification
|
||||
object: _menu];
|
||||
[_menu close];
|
||||
|
||||
// remove from main window
|
||||
mWin = [mr window];
|
||||
[[mWin parentWindow] removeChildWindow: mWin];
|
||||
}
|
||||
|
||||
/* Private method handles all cases after doing a selection from
|
||||
|
|
|
@ -856,6 +856,9 @@ many times.
|
|||
: _styleMask
|
||||
: [_screen screenNumber]];
|
||||
[srv setwindowlevel: [self level] : _windowNum];
|
||||
if (_parent != nil)
|
||||
[srv setPartentWindow: [_parent windowNumber]
|
||||
forChildWindow: _windowNum];
|
||||
|
||||
// Set up context
|
||||
[self _startBackendWindow];
|
||||
|
@ -4741,8 +4744,13 @@ current key view.<br />
|
|||
|
||||
- (void) setParentWindow: (NSWindow *)window
|
||||
{
|
||||
// FIXME
|
||||
_parent = window;
|
||||
|
||||
if (_windowNum)
|
||||
{
|
||||
[GSServerForWindow(self) setPartentWindow: [_parent windowNumber]
|
||||
forChildWindow: _windowNum];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL) allowsToolTipsWhenApplicationIsInactive
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue