1

I have a terminal application written in C# which I run with mono. Now, I would like to write a GUI for this application. How can I use buttons to pass commands to this application, and how can I receive output from the terminal window?

Is there any possible way to do this? and if, how?

Thank you very much.

BeMacized
  • 11
  • 3

3 Answers3

2

I think it is possible, but if you have the source code for the application, you would be much better off incorporating that source code into your new application and providing a GUI directly rather than trying to work with the command interface.

competent_tech
  • 44,465
  • 11
  • 90
  • 113
  • I have the source code of the application, but it runs in command line mode in mono since the gui elements it uses are not all compatible with mono. I do not want to write a seperate gui in the application either since i get an ugly windows 95 looking window which mono uses to run the executables. I know this is possible, but i'm looking for the answer **how** to do this. – BeMacized Dec 27 '11 at 09:21
  • You could perhaps use the exe file as a reference (it is just an assembly) If it has public classes you can call them from your gui program. – IanNorton Jan 04 '12 at 20:54
0

Based on your reply to competent_tech what you want to do is create the GUI using MonoMac.

MonoMac, a new foundation for building Cocoa applications on OSX using Mono. MonoMac is the result of years of experimentation in blending .NET with Objective-C and is inspired by the same design principles that we used for MonoTouch. You can use MonoMac to publish applications to the Mac AppStore, to learn about this see the MonoMacPackager page.

What you are describing as a windows 95 looking window, is winforms which is the native .Net API for building GUI applications. With MonoMac you will be able to build a GUI application that uses your current applications source code and looks and feels just like a normal Mac application.

Again trying to call commands on your application is not an ideal way to go about this.

startupsmith
  • 5,554
  • 10
  • 50
  • 71
  • Thank you very much! i am gonna use this :D. Still i need to know how i can pass commands to a terminal application since this is not the only thing i came by to try this. Is there any way i can receive and send input to a terminal application? – BeMacized Dec 27 '11 at 14:34
  • You may want to try something like this http://stackoverflow.com/questions/206323/how-to-execute-command-line-in-c-get-std-out-results or http://stackoverflow.com/questions/4910954/create-run-command-file-programmatically – startupsmith Dec 27 '11 at 21:31
0

If you have a command line program that you cannot modify then you probably want to invoke it directly as a subprocess and capture it's text output.

You can then write whatever GUI you like (MonoMac/GTK#) to drive the app directly.

IanNorton
  • 7,145
  • 2
  • 25
  • 28