如何创建基本的 osx prefPane?
长期读者,第一次参与 StackOverflow :)
免责声明 我对 Mac 开发世界非常很陌生。
我正在尝试为已经创建的小守护进程创建一个 prefPane。
我希望 prefPane 做两件事:
- 显示守护程序的当前状态(“已启动”或“已停止”)
- 提供一个按钮来启动/停止守护程序。
我可以使用 Interface Builder 来制作界面并以某种方式让 prefPane 使用它吗? (愚蠢的问题?)
感谢您提供有关如何/从哪里开始的任何提示/指示!
ps:我找不到 prefpane
标签。如果有人可以更恰当地标记这个,我不会被冒犯:)
Long time reader, first time participant on StackOverflow :)
disclaimer I am very new to the mac development world.
I am trying to create a prefPane for a small daemon that has already been created.
I would like the prefPane to do two things:
- Show the current status of the daemon ("started" or "stopped")
- Provide a button to start/stop the daemon.
Can I use Interface Builder to make the interface and somehow have the prefPane use it? (Dumb question?)
Thanks for any tip/pointers on how/where to get started!
ps: I couldn't find a prefpane
tag. If someone can tag this more appropriately I won't be offended :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
制作 prefPane 并不是太困难。只需按照此处的示例进行操作即可。是的,您可以使用界面生成器来制作界面。
使用启动守护进程是一项更加困难的任务。对于初学者来说,请查看此主题。您还可以围绕“launchctl”命令创建一个 NSTask 包装器,其中包含动词列表、加载和卸载。
Making a prefPane isn't all too difficult. Just follow the examples here. And yes, you can use interface builder to make the interface.
Working with Launch Daemons is a much more difficult task. Check out this thread for starters. You can also create a NSTask wrapper around the "launchctl" command, with the verbs list, load and unload.