【发布时间】:2012-03-13 08:36:53
【问题描述】:
我在 mac os 上创建了一个 firebreath 插件,它必须弹出一个窗口来获取用户输入(只有一个文本字段和两个按钮)。
这是我当前用于测试的 projectDef.cmake。
file (GLOB XIB RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
Mac/bundle_template/input.xib
)
# Make sure we can find the 'ibtool' program. If we can NOT find it we
# skip generation of this project
find_program(IBTOOL ibtool HINTS "/usr/bin" "${OSX_DEVELOPER_ROOT}/usr/bin")
if (${IBTOOL} STREQUAL "IBTOOL-NOTFOUND")
message(SEND_ERROR "ibtool can not be found and is needed to compile the .xib files. It should have been installed with the Apple developer tools. The default system paths were searched in addition to ${OSX_DEVELOPER_ROOT}/usr/bin")
endif()
# make the compiled nib file to desktop for testing
set (NIBFILE /Users/develop/Desktop/input.nib)
add_custom_command (TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${IBTOOL} --errors --warnings --notices --output-format human-readable-text --compile ${NIBFILE} ${XIB}
COMMENT "Compiling input.xib")
set (SOURCES
${SOURCES}
${PLATFORM}
${XIB}
)
add_custom_command 块对 cmake 没有影响,当我的插件目标构建成功时没有编译 nib 文件,但 ibtool 在终端的命令行中工作。
【问题讨论】:
-
对不起,我是可可新手。也许我不应该使用面板。根据浏览器的当前选项卡窗口,我需要输入对话框为窗口模式。我该如何实现?
-
没有办法直接绑定到标签页;你所能做的就是让它成为模态的,并希望它足够好。您没有参考浏览器的 NSWindow
-
感谢taxulian,我将使用应用程序模式对话框。目前,_window 始终为空,因此我无法显示它。我不知道为什么,我错过了什么?
-
我按照 firebreath wiki 的说明进行操作。首先,从包标识符中获取插件的包名称,然后获取我的 xib 资源的绝对路径。一切似乎都正确,但就是无法加载窗口! :(
-
我还是一头雾水;什么是_window?我在您的代码中的任何地方都没有看到 _window。
标签: xcode xib firebreath