Answer the question
In order to leave comments, you need to log in
How to bring a window to the front programmatically?
Created a CheckBox to enable / disable the display of the program in the Dock, but when the program is hidden, all windows disappear.
I put Sent Action deminiaturize on the item in the bar menu: and the window appears when you click on this item,
but when you try to call [[self window] deminiaturize: self]; in the code - nothing happens.
-(void)changeDockVisible:(id)sender {
if ([NSApp activationPolicy] == NSApplicationActivationPolicyRegular) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:NVHideDockIcon];
[NSApp setActivationPolicy:NSApplicationActivationPolicyAccessory];
// Здесь окна программы исчезают, пока не нажму на пункт в меню баре
} else {
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:NVHideDockIcon];
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question