none
Mono C# gtk# GUI Gnome-terminal RRS feed

  • Question

  • I'm trying do an Gui terminal on MonoDevelop using Gtk project and c# (csharp), but I cant find a sample that works on mono so i start building my own. this is my actual code:

    using System;
    using System.Diagnostics;
    
    using Gtk;
    
    public partial class MainWindow : Gtk.Window
    {
        public MainWindow() : base(Gtk.WindowType.Toplevel)
        {
            Build();
        }
    
        protected void OnDeleteEvent(object sender, DeleteEventArgs a)
        {
            Application.Quit();
            a.RetVal = true;
        }
    
        protected void OnEntry3KeyReleaseEvent(object o, KeyReleaseEventArgs args)
        {
        }
    
        protected void OnButton1Clicked(object sender, EventArgs e)
        {
            //ExecuteCommand("gnome-terminal -x bash -ic 'cd $HOME; ls; bash'");
    
            ExecuteCommand(entry3.Text.ToString());
            //textview1.Buffer.Text = textview1.Buffer.Text + "\r\n" +     entry3.Text.ToString();
            entry3.Text = "";
    
        }
    
        protected void ExecuteCommand(string command)
        {
            Process proc = new System.Diagnostics.Process();
            proc.StartInfo.FileName = "gnome-terminal";
            //proc.StartInfo.Arguments = "-c \" " + command + " \"";
            proc.StartInfo.UseShellExecute = false;
            proc.StartInfo.RedirectStandardOutput = true;
            proc.Start();
    
    
            while (!proc.StandardOutput.EndOfStream)
            {
                textview1.Buffer.Text = proc.StandardOutput.ReadToEnd();
            }
        }
    }

    The Idea is have a gui terminal with text input and output.

    Can you help?

    Thanks

    Tuesday, June 11, 2019 7:22 AM

Answers

  • Hi DedeTuga,

    Thank you for posting here.

    Since this thread is related to Gtk, It is a third-party product. I suggest that you could post in the following link.

    https://csharpforums.net/forums/third-party-products.89/​​​​​​​

    The Visual C# forum discusses and asks questions about the C# programming language, IDE, libraries, samples, and tools.

    Note:This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Tuesday, June 11, 2019 8:22 AM
    Moderator

All replies

  • Hi DedeTuga,

    Thank you for posting here.

    Since this thread is related to Gtk, It is a third-party product. I suggest that you could post in the following link.

    https://csharpforums.net/forums/third-party-products.89/​​​​​​​

    The Visual C# forum discusses and asks questions about the C# programming language, IDE, libraries, samples, and tools.

    Note:This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Tuesday, June 11, 2019 8:22 AM
    Moderator
  • Thanks

    For further reference if someone is looking for it too 

    https://csharpforums.net/threads/mono-c-gtk-gui-gnome-terminal.4568/

    Tuesday, June 11, 2019 9:11 AM