Macos Mac OS X包中的0方法返回值
我在玩——我的第一个SWT应用程序。 当我打包EclipseSWT表java应用程序MacOSX10.6.8时,方法返回值为0。如果我删除.app并执行应用程序可执行文件,它就可以正常工作。它在eclipse中运行良好。它在Windows7中运行良好。“调试”消息框始终包含正确的值。如果我硬编码表clientHeight、headerHeight和itemHeight,则返回值是正确的Macos Mac OS X包中的0方法返回值,macos,package,swt,Macos,Package,Swt,我在玩——我的第一个SWT应用程序。 当我打包EclipseSWT表java应用程序MacOSX10.6.8时,方法返回值为0。如果我删除.app并执行应用程序可执行文件,它就可以正常工作。它在eclipse中运行良好。它在Windows7中运行良好。“调试”消息框始终包含正确的值。如果我硬编码表clientHeight、headerHeight和itemHeight,则返回值是正确的 private int adjustItemsNEEDED(Table tTable) { int i
private int adjustItemsNEEDED(Table tTable) {
int itemsNeeded = 0;
int clientHeight = tTable.getClientArea().height;
int headerHeight = tTable.getHeaderHeight();
int itemHeight = tTable.getItemHeight();
if (itemHeight != 0) {
itemsNeeded = (clientHeight - headerHeight) / itemHeight;
} else {
itemsNeeded = 0;
}
messageTextBoxTop.setText("height=" + clientHeight + " header=" + headerHeight + " item=" + itemHeight + " needed=" + itemsNeeded);
return itemsNeeded;
}
我的可执行文件:
#!/bin/sh
BASEDIR=`dirname $0`
exec java \
-d64 \
-XstartOnFirstThread \
-classpath $BASEDIR/org.eclipse.SWT.cocoa.macosx.x64/swt.jar:$BASEDIR \
-Djava.library.path=$BASEDIR/org.eclipse.SWT.cocoa.macosx.x64 \
MyApp
my info.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>CheckBook</string>
<key>CFBundleGetInfoString</key>
<string>SWTHello 1.0 for Mac OS X</string>
<key>CFBundleIconFile</key>
<string>CheckBook.icns</string>
<key>CFBundleIdentifier</key>
<string>org.eclipse.swt.HelloWorldSWTApplication</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>CheckBook</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>?????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
Cbundlexecutable
支票簿
cfbundlegetingfostring
适用于Mac OS X的SWTHello 1.0
循环流化床锅炉
支票簿
CbundleIdentifier
org.eclipse.swt.helloworldswt应用程序
CbundleInfo字典版本
6
CFBundleName
支票簿
CbundlePackageType
应用
CbundleShortVersionString
1
CFBundleSignature
?????
循环流化床锅炉
1
非主类
不适用
Sorry-first post-my方法是从以下位置调用的:shell.addListener(SWT.Activate,new Listener(){}