2004-07-05 John Luke <jluke@cfl.rr.com>
* sample/VteTest.cs: improve the scrolling in the sample and pass on the Environment variables svn path=/trunk/gtk-sharp/; revision=30770
This commit is contained in:
parent
f21f0ab050
commit
6b279784d4
2 changed files with 28 additions and 14 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2004-07-05 John Luke <jluke@cfl.rr.com>
|
||||||
|
|
||||||
|
* sample/VteTest.cs: improve the scrolling in the sample
|
||||||
|
and pass on the Environment variables
|
||||||
|
|
||||||
2004-07-02 Mike Kestner <mkestner@ximian.com>
|
2004-07-02 Mike Kestner <mkestner@ximian.com>
|
||||||
|
|
||||||
* configure.in : dist the HACKING file from now on.
|
* configure.in : dist the HACKING file from now on.
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections;
|
||||||
using Gtk;
|
using Gtk;
|
||||||
using Gnome;
|
using Gnome;
|
||||||
using Vte;
|
using Vte;
|
||||||
|
@ -17,7 +18,7 @@ class T
|
||||||
app.SetDefaultSize (600, 450);
|
app.SetDefaultSize (600, 450);
|
||||||
app.DeleteEvent += new DeleteEventHandler (OnAppDelete);
|
app.DeleteEvent += new DeleteEventHandler (OnAppDelete);
|
||||||
|
|
||||||
ScrolledWindow sw = new ScrolledWindow ();
|
HBox hbox = new HBox ();
|
||||||
Terminal term = new Terminal ();
|
Terminal term = new Terminal ();
|
||||||
term.EncodingChanged += new EventHandler (OnEncodingChanged);
|
term.EncodingChanged += new EventHandler (OnEncodingChanged);
|
||||||
term.CursorBlinks = true;
|
term.CursorBlinks = true;
|
||||||
|
@ -30,6 +31,10 @@ class T
|
||||||
term.TextDeleted += new EventHandler (OnTextDeleted);
|
term.TextDeleted += new EventHandler (OnTextDeleted);
|
||||||
term.ChildExited += new EventHandler (OnChildExited);
|
term.ChildExited += new EventHandler (OnChildExited);
|
||||||
|
|
||||||
|
VScrollbar vscroll = new VScrollbar (term.Adjustment);
|
||||||
|
hbox.PackStart (term);
|
||||||
|
hbox.PackStart (vscroll);
|
||||||
|
|
||||||
Gdk.Color white = new Gdk.Color ();
|
Gdk.Color white = new Gdk.Color ();
|
||||||
Gdk.Color.Parse ("white", ref white);
|
Gdk.Color.Parse ("white", ref white);
|
||||||
// FIXME: following line is broken
|
// FIXME: following line is broken
|
||||||
|
@ -41,23 +46,27 @@ class T
|
||||||
//term.ColorForeground = black;
|
//term.ColorForeground = black;
|
||||||
term.SetColors (black, white, white, 16);
|
term.SetColors (black, white, white, 16);
|
||||||
|
|
||||||
Console.WriteLine (term.UsingXft);
|
//Console.WriteLine (term.UsingXft);
|
||||||
Console.WriteLine (term.Encoding);
|
//Console.WriteLine (term.Encoding);
|
||||||
Console.WriteLine (term.StatusLine);
|
//Console.WriteLine (term.StatusLine);
|
||||||
|
|
||||||
string[] argv = Environment.GetCommandLineArgs ();
|
string[] argv = Environment.GetCommandLineArgs ();
|
||||||
|
// seems to want an array of "variable=value"
|
||||||
|
string[] envv = new string [Environment.GetEnvironmentVariables ().Count];
|
||||||
|
int i = 0;
|
||||||
|
foreach (DictionaryEntry e in Environment.GetEnvironmentVariables ())
|
||||||
|
{
|
||||||
|
if (e.Key == "" || e.Value == "")
|
||||||
|
continue;
|
||||||
|
string tmp = String.Format ("{0}={1}", e.Key, e.Value);
|
||||||
|
envv[i] = tmp;
|
||||||
|
i ++;
|
||||||
|
}
|
||||||
|
|
||||||
string[] envv = new string[] {""};
|
int pid = term.ForkCommand (Environment.GetEnvironmentVariable ("SHELL"), argv, envv, Environment.CurrentDirectory, false, true, true);
|
||||||
// FIXME: send the env vars to ForkCommand
|
Console.WriteLine ("Child pid: {0}", pid);
|
||||||
Console.WriteLine (Environment.GetEnvironmentVariables ().Count);
|
|
||||||
Console.WriteLine (Environment.CurrentDirectory);
|
|
||||||
|
|
||||||
int pid = term.ForkCommand ("/bin/bash", argv, envv, Environment.CurrentDirectory, false, true, true);
|
app.Contents = hbox;
|
||||||
Console.WriteLine ("Child pid: " + pid);
|
|
||||||
|
|
||||||
sw.AddWithViewport (term);
|
|
||||||
|
|
||||||
app.Contents = sw;
|
|
||||||
app.ShowAll ();
|
app.ShowAll ();
|
||||||
program.Run ();
|
program.Run ();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue