阅读:2426回复:4
linux 下是不是不支持launch功能阿?
var nsIFilePicker = Components.interfaces.nsIFilePicker;
var fp = Components.classes["@mozilla.org/filepicker;1"] .createInstance(nsIFilePicker); fp.init(window, "Select a File", nsIFilePicker.modeOpen); var res = fp.show(); if (res == nsIFilePicker.returnOK){ var thefile = fp.file; thefile.launch(); } 打开一个.txt文件后并不像windows下能launch。 问各位高手,linux下launch应用程序应该怎么办?谢谢谢谢 |
|
1楼#
发布于:2006-09-26 13:37
抱歉,没有认真读楼主的帖,
察看了下lxr 注释说到 135 /** 136 * launch 137 * 138 * Ask the operating system to attempt to open the file. 139 * this really just simulates "double clicking" the file on your platform. 140 * This routine only works on platforms which support this functionality. 141 */ 142 void launch(); Firefox Download mgr 的代码是这样写的 348 try { 349 f.launch(); 350 } catch (ex) { 351 // if launch fails, try sending it through the system's external 352 // file: URL handler 353 openExternal(f.path); 354 } 希望能有些帮助。 |
|
2楼#
发布于:2006-09-26 13:37
那个Lauchy和我说的问题好像不是一回事阿。我现在想将我自己写的应用程序嵌在我的xul页面里,就像是html页面里嵌入一个播放器那样的效果,请问该怎么弄啊?谢谢谢谢
|
|
3楼#
发布于:2006-09-26 13:37
移动到扩展区
|
|
4楼#
发布于:2006-09-26 13:37
按照作者主页上的说法除了自动检测功能只能在Windows下使用,其他的都是可以在所有OS上使用的。
可以自己编写Launchy.xml文件 The autodetection of applications is a Windows only feature. You can use the launchy.xml feature on all OSes. |
|