zoukankan      html  css  js  c++  java
  • mac 窗口置顶的方法

    窗口置顶的方法

    [NSApp activateIgnoringOtherApps:YES];

    窗口一直置顶的方法

    [[preferenceWindowController window] setLevel: kCGStatusWindowLevel];  

    Discussion
    If flag is NO, the application is activated only if no other application is currently active. If flag is YES, the application activates regardless.
    The flag is normally set to NO. When the Finder launches an application, using a value of NO for flag allows the application to become active if the user waits for it to launch, but the application remains unobtrusive if the user activates another application. Regardless of the setting of flag, there may be a time lag before the application activates—you should not assume the application will be active immediately after sending this message.
    You rarely need to invoke this method. Under most circumstances, the Application Kit takes care of proper activation. However, you might find this method useful if you implement your own methods for interapplication communication.
    You don’t need to send this message to make one of the application’s NSWindows key. When you send a makeKeyWindow message to an NSWindow object, you ensure that it is the key window when the application is active.

  • 相关阅读:
    手风琴效果
    开关门
    常用的一些获取尺寸的方法
    话话js中的事件监听
    数组去重
    百度地图 之 热力图
    小程序 之 百度智能小程序(第二章)
    小程序 之 百度智能小程序(第一章)
    javascript 之 继承与闭包
    浅谈prototype与__proto__、constructor三者之间的关系
  • 原文地址:https://www.cnblogs.com/watchdatalearn2012620/p/2978613.html
Copyright © 2011-2022 走看看