是否可以将窗口大小设置为大于屏幕大小?我打开文本编辑例如我用的是以下几点:设置窗口大于屏幕大小
set bounds of window 1 to {10, 10, 400, 2200}
但高度永远不会到达2200
马克。它仅限于屏幕尺寸。我希望我可以强制超过屏幕尺寸的高度,以便我可以截图全长窗口。
高兴地尝试其他语言,这将工作英寸也许objective-c,可可应用程序?
是否可以将窗口大小设置为大于屏幕大小?我打开文本编辑例如我用的是以下几点:设置窗口大于屏幕大小
set bounds of window 1 to {10, 10, 400, 2200}
但高度永远不会到达2200
马克。它仅限于屏幕尺寸。我希望我可以强制超过屏幕尺寸的高度,以便我可以截图全长窗口。
高兴地尝试其他语言,这将工作英寸也许objective-c,可可应用程序?
是的,这是可能的。
#include <Foundation/Foundation.h>
#include <AppKit/AppKit.h>
@interface MyDelegate : NSObject
{
NSWindow *myWindow;
}
- (void) createMenu;
- (void) createWindow;
- (void) applicationWillFinishLaunching: (NSNotification *)not;
- (void) applicationDidFinishLaunching: (NSNotification *)not;
@end
@implementation MyDelegate : NSObject
- (void) dealloc
{
[myWindow release];
}
- (void) createMenu
{
NSMenu *menu;
menu = [[NSMenu new] autorelease];
[menu addItemWithTitle: @"Quit"
action: @selector (terminate:)
keyEquivalent: @"q"];
[NSApp setMainMenu: menu];
}
- (void) createWindow
{
NSRect rect = NSMakeRect (100, 100, 2000, 2000);
unsigned int styleMask = NSTitledWindowMask
| NSMiniaturizableWindowMask;
myWindow = [NSWindow alloc];
myWindow = [myWindow initWithContentRect: rect
styleMask: styleMask
backing: NSBackingStoreBuffered
defer: NO];
[myWindow setTitle: @"This is a test window"];
}
- (void) applicationWillFinishLaunching: (NSNotification *)not
{
[self createMenu];
[self createWindow];
}
- (void) applicationDidFinishLaunching: (NSNotification *)not;
{
[myWindow makeKeyAndOrderFront: nil];
}
@end
int main (int argc, const char **argv)
{
[NSApplication sharedApplication];
[NSApp setDelegate: [MyDelegate new]];
return NSApplicationMain (argc, argv);
}
为什么你想这样做?如果你想显示的东西,比窗口大,你有UIScrollView的为:
使用它,并调整它的contentSize至{10,10,400,2200}。
你完成了。
您可以编辑笔尖文件并为窗口设置不同的最小尺寸。应用程序为其窗口设置最小尺寸以防止自动调整问题,这可能会导致某些视图消失,并且在窗口大小放大时不显示。从我收集的信息看来,您无法从AppleScript查询或设置最小大小。
Here是一个类似于你的问题,从来没有找到答案,但问题的评论和答案一样好。
这是干什么用的? – gadgetmo