user1776158
user1776158

Reputation: 13

Programming simple GUI applications? A couple considerations

I am wanting to start programming some simple applications that I can use as tools and such. I am hoping these applications will allow me to simplify certain terminal processes I use often. They interact with my local files lots as well as other applications (db2 for example). I have started learning C a little bit for this.

I thought I would use C with embedded bash commands. I was wondering if that was the best/most common method of programming these applications? Is there a better way of doing this? Also, I will need to be able to display the terminal output. Will this be possible? My only issue with this method is that it is not very transferable to non Linux operation system.

Any insight or a push in the general direction would be greatly appreciated.

Upvotes: 1

Views: 263

Answers (3)

Chrismit
Chrismit

Reputation: 1518

I would recommend using Qt over wxWidgets. For portability to Linux, Qt from my experiences works better. I've had a few projects work great on mac/windows, but seg fault on linux due to nuances in running a particular wxWidget build. Using Qt also allows you to use plenty of efficient and fast data structures specific to Qt.

Upvotes: 0

hyde
hyde

Reputation: 62848

If you want cross-platform, consider Qt or WxWidgets. I'd go with Qt, but that is only because I don't know WxWidgets ;)

If you want simple things quickly, use Qt with PyQt or PySide (also see this SO question). WxWidgets has Python bindings too, according to it's webpage. Learning Python is generally fun, useful, and an order of magnitude faster and easier than learning C++.

Forget C for GUI programming, GUIs are inherently object-based, and much easier to work with on languages which support objects naturally.

For child process handling, a quick search for Python and Qt found this example at www.qtforum.org.

Upvotes: 1

Aniket Inge
Aniket Inge

Reputation: 25725

Besides the mentioned toolkits such as PyQt and wxPython, standard python itself comes with a cross platform GUI kit called Tkinter.

Also if you're on Linux you can try(for C) Gtk.

For C++ I would suggest Qt or wxWidgets

Or try Java if you don't mind installing a heavy-weight virtual machine. It comes with Swing.

Apart from all these Toolkits for Graphical User Interface, interfacing a graphical user program with command line program is .. well .. nevermind. You will need to open pipes to the subprocess(the command line process), read output from it, write into the subprocess's input stream, and show appropriate message to the user.

Upvotes: 0

Related Questions