Ryujinx-GtkSharp/sample/VteTest.cs
John Luke 6a6a552861 change return type of ForkCommand to gint
update sample to use ForkCommand,
still missing signals

svn path=/trunk/gtk-sharp/; revision=22216
2004-01-18 00:54:08 +00:00

62 lines
1.3 KiB
C#

using System;
using Gtk;
using GtkSharp;
using Gnome;
using GnomeSharp;
using Vte;
using VteSharp;
class T
{
Program program;
static void Main (string[] args)
{
new T (args);
}
T (string[] args)
{
program = new Program ("test", "0.0", Modules.UI, args);
App app = new App ("test", "Test for vte widget");
app.SetDefaultSize (600, 450);
app.DeleteEvent += new DeleteEventHandler (OnAppDelete);
ScrolledWindow sw = new ScrolledWindow ();
Terminal term = new Terminal ();
term.CursorBlinks = true;
term.MouseAutohide = true;
term.ScrollOnKeystroke = true;
//term.BackgroundTransparent = true;
term.Encoding = "UTF-8";
Console.WriteLine (term.UsingXft);
Console.WriteLine (term.Encoding);
Console.WriteLine (term.StatusLine);
string argv = Environment.GetCommandLineArgs () [0];
string envv = "";
// FIXME: send the env vars to ForkCommand
Console.WriteLine (Environment.GetEnvironmentVariables ().Count);
int pid = term.ForkCommand ("/bin/bash", argv, envv, "/home/jluke", false, true, true);
Console.WriteLine ("Child pid: " + pid);
sw.AddWithViewport (term);
app.Contents = sw;
app.ShowAll ();
program.Run ();
}
private void OnTextInserted (object o, EventArgs args)
{
}
private void OnAppDelete (object o, DeleteEventArgs args)
{
program.Quit ();
}
}