[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.programming

PC and Mac GUI?

Mark Storkamp

9/4/2014 4:03:00 PM

I have a program written in C that gets run on both a Mac and a Windows
PC. I wrote it to use the command line so I could easily compile for
either environment.

The program has a dozen or so command line switches, then runs
uninterrupted until it finishes its task.

It could really use a GUI front end to select the options on the command
line before it runs. I could easily write that in Objective-C for the
Mac, but then that wouldn't run on the PC. I haven't programmed Windows
since 3.0 and I don't have the tools to it now anymore.

Is there some (probably interpreted) language that can run the same code
on both Mac and PC, present the user with a dialog box for options,
build up a command line, and then execute the existing command line
program?
5 Answers

Ben Bacarisse

9/4/2014 4:20:00 PM

0

Mark Storkamp <mstorkamp@yahoo.com> writes:

> I have a program written in C that gets run on both a Mac and a Windows
> PC. I wrote it to use the command line so I could easily compile for
> either environment.
>
> The program has a dozen or so command line switches, then runs
> uninterrupted until it finishes its task.
>
> It could really use a GUI front end to select the options on the command
> line before it runs. I could easily write that in Objective-C for the
> Mac, but then that wouldn't run on the PC. I haven't programmed Windows
> since 3.0 and I don't have the tools to it now anymore.
>
> Is there some (probably interpreted) language that can run the same code
> on both Mac and PC, present the user with a dialog box for options,
> build up a command line, and then execute the existing command line
> program?

I have found command-line driven dialog programs like zentity to be fine
for simple cases. I've switched to "yad" for my own stuff because it
does a bit more and it does it a bit better but I don't think it's
available for Windows (zenity is).

--
Ben.

Mark Storkamp

9/8/2014 1:18:00 PM

0

In article <87d2bbtl25.fsf@bsb.me.uk>,
Ben Bacarisse <ben.usenet@bsb.me.uk> wrote:

> Mark Storkamp <mstorkamp@yahoo.com> writes:
>
> > I have a program written in C that gets run on both a Mac and a Windows
> > PC. I wrote it to use the command line so I could easily compile for
> > either environment.
> >
> > The program has a dozen or so command line switches, then runs
> > uninterrupted until it finishes its task.
> >
> > It could really use a GUI front end to select the options on the command
> > line before it runs. I could easily write that in Objective-C for the
> > Mac, but then that wouldn't run on the PC. I haven't programmed Windows
> > since 3.0 and I don't have the tools to it now anymore.
> >
> > Is there some (probably interpreted) language that can run the same code
> > on both Mac and PC, present the user with a dialog box for options,
> > build up a command line, and then execute the existing command line
> > program?
>
> I have found command-line driven dialog programs like zentity to be fine
> for simple cases. I've switched to "yad" for my own stuff because it
> does a bit more and it does it a bit better but I don't think it's
> available for Windows (zenity is).

Thanks, I looked into both of those and I don't think they would work
well for me. But while looking into those, I ran across Python and
Tkinter. Since it's already loaded on the Mac, and was easy to load on
the PC, now I just have to learn to use them. Lots of good tutorials to
play with too.

--
Mark

Koneko

9/9/2014 2:59:00 AM

0

Mark Storkamp wrote:
> I have a program written in C that gets run on both a Mac and a Windows
> PC. I wrote it to use the command line so I could easily compile for
> either environment.

I think you should check Qt since it's a multi-platform GUI toolkit. Qt
has quite a bit benefits and only a few disadvantages. Alternatively you
could take the GTK+ and use that. Tools for both of them are readily
available and open source. Both feature biddings to various interpreted
languages too.

Qt allows you to have effortlessly 99.9% native look for both OS X and
Windows. With little effort you can make it behave natively in both
environments too. There are C bindings for Qt. It's reasonably fast and
easy to learn. And it's well documented. Qt is based on C++ but it only
uses a subset of C++. It doesn't force you to use the obscure parts of
C++ although if you want you can do that. Qt projects can become bit
complex thought. But the tools used to build Qt applications are
available for all platforms. And the "Qt Creator" is a very good IDE
used to build Qt applications.

Advantages for GTK+ are that you can use just pure C. There are also C++
biddings for it. It's also really really fast. GTK+ probably is easier
to learn than Qt but problem is that its documentation tends to be a
mess. Disadvantages in a nutshell are that compiling on both Windows and
OS X require extra effort. GTK+ programs also tend to look like GTK+
programs on any given platform unless effort is put into it. However
it's possible to achieve both native look and behavior. GTK+ has bit
better debugging capabilities but it stems for the fact that GTK+ has
many moving parts and it's very easy to write *bad* GTK+ programs that
just vomit "critical warnings" constantly (most of which are perfectly
safe to actually just ignore). Not all GTK+ tools are available for all
platforms but most of them are.

tl;dr: You should use Qt since it's most likely to fit your needs and
purpose. But you might want to consider GTK+ because it's a very capable
lean and mean toolkit.


--
Koneko

Mark Storkamp

9/9/2014 1:20:00 PM

0

In article <A1uPv.58496$SH2.21322@uutiset.elisa.fi>,
Koneko <Koneko@idontwantspamfrom.net> wrote:

> Mark Storkamp wrote:
> > I have a program written in C that gets run on both a Mac and a Windows
> > PC. I wrote it to use the command line so I could easily compile for
> > either environment.
>
> I think you should check Qt since it's a multi-platform GUI toolkit. Qt
> has quite a bit benefits and only a few disadvantages. Alternatively you
> could take the GTK+ and use that. Tools for both of them are readily
> available and open source. Both feature biddings to various interpreted
> languages too.
>

Thanks. I've started putting together a dialog with Python and Tkinter,
but I do like the idea of it all being compiled into the C source so
I'll definitely be looking into Qt as well.

--
Mark.

August Karlstrom

9/14/2014 9:24:00 AM

0

On 2014-09-04 18:02, Mark Storkamp wrote:
> I have a program written in C that gets run on both a Mac and a Windows
> PC. I wrote it to use the command line so I could easily compile for
> either environment.
>
> The program has a dozen or so command line switches, then runs
> uninterrupted until it finishes its task.
>
> It could really use a GUI front end to select the options on the command
> line before it runs. I could easily write that in Objective-C for the
> Mac, but then that wouldn't run on the PC. I haven't programmed Windows
> since 3.0 and I don't have the tools to it now anymore.
>
> Is there some (probably interpreted) language that can run the same code
> on both Mac and PC, present the user with a dialog box for options,
> build up a command line, and then execute the existing command line
> program?
>

Another option is to transcompile the C program to Javascript (via LLVM)
with Emscripten and create the GUI with HTML and CSS. Then it will work
in any browser with Javascript support.

https://developer.mozilla.org/en-US/docs/Mozilla/Projects/...


-- August