Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
User interface 在Mac OS X中为命令行应用程序编写GUI前端_User Interface_Macos_Command Line - Fatal编程技术网

User interface 在Mac OS X中为命令行应用程序编写GUI前端

User interface 在Mac OS X中为命令行应用程序编写GUI前端,user-interface,macos,command-line,User Interface,Macos,Command Line,我想知道是否有关于如何在MacOSX(但不一定是Xcode)中为命令行应用程序开发GUI前端应用程序的信息来源 具体来说,我喜欢GUI前端,它允许我指定要传递给命令行程序的参数 非常感谢。退房: 您有几种选择。为脚本创建GUI“前端”最常用的程序之一是。但是,这不允许用户像您希望的那样传递参数。另一个选项是创建Cocoa应用程序,并使用该类使用用户在or中指定的参数运行脚本。在您的情况下,我认为创建一个用Objective-C编写的完整的Cocoa应用程序是过分的 要想得到想要的并且仍然很

我想知道是否有关于如何在MacOSX(但不一定是Xcode)中为命令行应用程序开发GUI前端应用程序的信息来源

具体来说,我喜欢GUI前端,它允许我指定要传递给命令行程序的参数

非常感谢。

退房:


    • 您有几种选择。为脚本创建GUI“前端”最常用的程序之一是。但是,这不允许用户像您希望的那样传递参数。另一个选项是创建Cocoa应用程序,并使用该类使用用户在or中指定的参数运行脚本。在您的情况下,我认为创建一个用Objective-C编写的完整的Cocoa应用程序是过分的

      要想得到想要的并且仍然很容易,最简单的方法是创建一个用AppleScript编写的脚本。这是一个简单的脚本,可以实现以下功能:

      display dialog "Enter arguments:" default answer "" buttons {"Cancel", "Run"} default button 2
      set scriptArguments to text returned of result
      do shell script "/path/to/script " & scriptArguments
      

      我会使用Python+Tkinter或其他工具。您可以使用带有Platypus的CoLoadDialog[1]来接受用户输入。此外,Pashua[2]允许您创建更复杂的UI。[1] [2]