protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); core = new KevinCore(this); // Get our button from the layout resource, // and attach an event to it EditText input = FindViewById <EditText> (Resource.Id.input); output = FindViewById <TextView> (Resource.Id.textView1); input.KeyPress += (object sender, View.KeyEventArgs e) => { e.Handled = false; if (e.Event.Action == KeyEventActions.Down && e.KeyCode == Keycode.Enter) { e.Handled = true; output.Append("you: " + input.Text + "\n"); core.tell(input.Text); input.Text = ""; } }; }
public static void Main(string[] args) { MainClass instance = new MainClass(); core = new KevinCore(instance); if (args.Length == 0) { instance.send("Hello."); instance.Loop(); } core.tell(string.Join(" ", args)); }
public MainWindow() : base(Gtk.WindowType.Toplevel) { Build(); core = new KevinCore(this); kevinTag = new TextTag(null); resultTextView.Buffer.TagTable.Add(kevinTag); kevinTag.Foreground = "#55AA00"; yourTag = new TextTag(null); resultTextView.Buffer.TagTable.Add(yourTag); yourTag.Foreground = "#FF44BB"; send("Hello :D"); }