开发者

SWT on OS X: menu without window

On OS X if you close the last window, the application still is living and, if focused, shows a menu bar (without any window). What is the simplest 开发者_如何学GoSWT example code demonstrating this behavior? Thanks in advance.


You need to use the new Display.getMenuBar(). It is available since SWT 3.7. See this snippet:

http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet348.java


Hm.. I don't know - does I understand question in correct way. I suppose that you need smt like this: There is some manager that works using two stays - normal and after closing all windows. If it in second state when it focused it must be create window with menu bar. And, of course do smt like this in "main function".

while (thereIsNoSignalToShutdown()) 
    if (!display.readAndDispatch())
        display.sleep();
    }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜