2014-09-04 17:41:50

Hi, I'm interested in creating GUI interfaces to a couple of cli applications, but am unsure how to go about doing it, as I haven't really explored this kind of stuff before. The two languages I am most familiar with are C++ and bgt. I'm sure there's a way for C++ to do this, I'm just not sure what kind of stuff I should be looking into that will help me get started.
Any advice would be greatly appreciated.
Thanks!

Prier practice and preparation prevents piss poor performance!

2014-09-04 20:12:07

We need more information.
In the simplest case, you build a GUI that builds a string, calls the terminal with that string, and then somehow communicates the result.  But there's not much point, and it will always, always be hacky and easily broken.  More complex cases assume that you have the source code and that it was written with this in mind-many programs are written as a library that you call and a 50-line command line frontend that calls it.
I'd suggest C# for this.  C+++ GUI is difficult, in that QT is inaccessible and WX is hard to set up.  There's C++/CLI, but that's its own brand of special, especially if you're anywhere near new to programming.  C# is the most similar to both of the languages you have mentioned.  You can do it in C++, but I doubt BGT has the stuff you need.  C++ GUI is difficult at the best of times.  Now, if we're just talking about a GUI for the blind-the normal techniques for game menus works for that, I suppose.
But a GUI a in windows with actual buttons and checkboxes is going to overturn how you've probably programmed before.  It's a callback model, not a push model.  That is, the entire thing is done by waiting for things to happen and letting the GUI libraries call functions you provide when they do.  This is as opposed to the traditional while loop and if statements, and is foreign the first time you see it.

My Blog
Twitter: @ajhicks1992

2014-09-04 20:51:36

Hi, the program is open source and is written in python, which I do have a little experience with, although I'm not as familiar with that as I am with the other languages I've mensioned. I've played around with wx python a little though, so the way that kind of thing works does make sense to me, I'm just unsure as to where to start because I've never tried to do something like this before.

Prier practice and preparation prevents piss poor performance!

2014-09-04 22:08:28

The program being open source doesn't quite determine if you're able to add a frontend to it.  It's about architecture.  If the parts of the program that "do work" are pulled out properly, you can use it like a library and build your own.  Otherwise, yeah, build shell commands.  imho, it's not worth it for most command line tools: the effort it takes to do this is grater than the effort to become proficient with the tool.
But if it's open source and in Python, then WXPython is maybe your best bet.  C++ makes GUI programming somewhat painful, to say the least.  The good frameworks are inaccessible, leaving only wx, as far as I know.  I tried to get WX and C++ working at one point; it was basically impossible even though I did succeed in the end, and I'm the one writing a very, very large library for game audio in C++.  BGT doesn't have GUI at all.
But as for where to start? There's no good answer to that, I'm afraid.  Only the stereotypical ones like read tutorials.

My Blog
Twitter: @ajhicks1992

2014-09-04 23:51:56

Hi, thanks for the advice! I can use the tool easily enough, this is just something I thought might be interesting to try. I'll try and take a look at the code to see what I can get from it!

Prier practice and preparation prevents piss poor performance!

2014-09-05 04:04:58

@Dranelement, a good way to do something like this is to create a WXPython window, and add buttons to it that perform actions for the two CLI apps. Then, remove all the print statements, the input statements, etc, and replace them with the WXPython equivalent.
@camlorn, WXWidgets is not a pain to set up. The C++ code is quite simple. The only trouble you'll have is compilation.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github