Find the answer to your Linux question:
Results 1 to 7 of 7
Hello, everyone. I want to write simple graphical front-ends (I'd rather say, GUI wrappers) for some command-line programs. What combination of programming/scripting language + GUI library could you recommend? Necessary: ...
  1. #1
    Just Joined!
    Join Date
    Jul 2008
    Location
    Russia, Novosibirsk
    Posts
    3

    Writing GUI front-ends: what language + what GUI library?

    Hello, everyone.

    I want to write simple graphical front-ends (I'd rather say, GUI wrappers) for some command-line programs.

    What combination of programming/scripting language + GUI library could you recommend?

    Necessary:
    1. Support for both Linux and Windows without modification of code.
    2. Easy call of command-line programs without showing their output to the user but with a possibility of processing the output in the program.

    Preferably:
    1. Support for MacOS.
    2. Simpleness and high speed of development.
    3. Good documentation and large enough community.
    4. Object-oriented GUI library.
    5. High speed of GUI on PC with slow CPU and primitive video card.

  2. #2
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    Portability and speed are kind of mutually exclusive.

    GTK+ can be used on all three OS and it has acceptable performance. But it is not the easiest to work with.

    wxWidgets has broad support but it is hard to feature specific controls of the particular operating system it runs on.

    If point 5 is of the least importance, you might want to look at Java.

  3. #3
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    Alrighty...

    On Linux, the two primary widget toolkits are Gtk+ and Qt. There are of course others, but these are the main ones. Both are OO, so no worries there, and both have rather extensive documentation.

    Gtk+ is native to C, which is not an OO language, so it kind of fakes an OO design. You can also use gtkmm, a C++ wrapper for Gtk+. There are also Perl modules to use Gtk+, and wrappers for many other languages.

    Qt is native to C++, and I don't know as much about it, but I'm sure that it has wrappers in all sorts of other languages as well.

    So this has not helped you at all. And that was rather intentional. Because I think that your question is flawed.

    Let's see what your points are:
    1. Support for both Linux and Windows without modification of code.
    Are you actually intending a single program to run on both Windows and Linux? If you're writing a commandline wrapper, it's rather unlikely that you will have the same commands on both (unless you're running Cygwin or something), and the system calls that you make will be entirely different.

    2. Easy call of command-line programs without showing their output to the user but with a possibility of processing the output in the program.
    This is entirely unrelated to your GUI toolkit. You will invoke the program by popen()ing or fork() + exec()ing, and it is entirely a non-GUI thing.

    1. Support for MacOS.
    Assuming that you mean OS X, I believe that Gtk+ is available for Mac.

    2. Simpleness and high speed of development.
    Both Gtk+ and Qt have WYSIWYG GUI designers available, which is about as simple as you get. However, no cross-platform app will be "simple".

    3. Good documentation and large enough community.
    Any option you choose will be documented and thousands of people will have used it.

    5. High speed of GUI on PC with slow CPU and primitive video card.
    I can't imagine that this will be a majorly limiting factor.

    GNU-Fan's suggestion of Java may be a good one, as Swing is cross-platform and it's a very popular language. As far of ease of development, it would definitely win for a cross-platform app. However, I'm not sure that the cross-platformness is super achievable in a useful manner, so it's up to you.
    DISTRO=Arch
    Registered Linux User #388732

  4. #4
    Just Joined!
    Join Date
    Jul 2008
    Location
    Russia, Novosibirsk
    Posts
    3
    Thanks for your replies.

    Quote Originally Posted by Cabhan View Post
    Are you actually intending a single program to run on both Windows and Linux? If you're writing a commandline wrapper, it's rather unlikely that you will have the same commands on both (unless you're running Cygwin or something), and the system calls that you make will be entirely different.
    Yes, the target Windows machine has Cygwin and all necessary console apps are cross-platform.

    Quote Originally Posted by Cabhan View Post
    This is entirely unrelated to your GUI toolkit. You will invoke the program by popen()ing or fork() + exec()ing, and it is entirely a non-GUI thing.
    Sure it is not GUI related thing, but probably language and its libraries one. I hope to find a language in which calls to command-line apps may be high-level enough for programs/scripts to be cross-platform.

    Quote Originally Posted by Cabhan View Post
    Both Gtk+ and Qt have WYSIWYG GUI designers available, which is about as simple as you get. However, no cross-platform app will be "simple".
    I think I forgot to add one preference to my points: it is desirably that GUI will be created dynamically (somehow structurally/logically, not by hand).

  5. #5
    Just Joined! esquiso's Avatar
    Join Date
    Jul 2008
    Location
    Oporto, Portugal
    Posts
    10
    Why don't you try PyGTK or PyQt? Both of them are cross-platform.

  6. #6
    Just Joined!
    Join Date
    Jul 2008
    Location
    Russia, Novosibirsk
    Posts
    3
    I think I'll try tk + Python or Tcl.

  7. #7
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by pineapple View Post
    Hello, everyone.

    I want to write simple graphical front-ends (I'd rather say, GUI wrappers) for some command-line programs.

    What combination of programming/scripting language + GUI library could you recommend?

    Necessary:
    1. Support for both Linux and Windows without modification of code.
    2. Easy call of command-line programs without showing their output to the user but with a possibility of processing the output in the program.

    Preferably:
    1. Support for MacOS.
    2. Simpleness and high speed of development.
    3. Good documentation and large enough community.
    4. Object-oriented GUI library.
    5. High speed of GUI on PC with slow CPU and primitive video card.
    I would say that the only one I know that comply with MOST of these premises is probably QT 4.x (not 3.x). Of course 5 is very relative, but if you are considering Java as an option, I doubt that any other toolkit can perform worse.

    There are binding for many languages... The natural option is c++ though.

    QT 4 is portable enough, but if you do system calls, as someone else stated above, then you are bound to OS peculiarities. Most code will be portable, but OS specific code is unavoidable when making frontends, plust you are not going to be able to use the same commands in all OS'es.

    About 4, it all depends on how picky are you about "what's an OOP language". Most purists believe that OOP does not exist at all. It depends on who you ask.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...