View difference between Paste ID: 0YKvYtFH and WUub83e3
SHOW: | | - or go back to the newest paste.
1
using System;
2
using Gtk;
3
4
5
using System;
6
using Gtk;
7
8
9
public partial class MainWindow: Gtk.Window
10-
		textview2.Buffer.InsertAtCursor("text\n");	//Works!
10+
11
	public MainWindow () : base (Gtk.WindowType.Toplevel)
12
	{
13
		Build ();
14
		//textview2.Buffer.InsertAtCursor ("Fungerar!\n"); //Fungerar
15
	}
16
17
	protected void OnDeleteEvent (object sender, DeleteEventArgs a)
18-
	public void displayText(string input)
18+
19
		Application.Quit ();
20
		a.RetVal = true;
21-
		textview2.Buffer.Text = input + "\n";
21+
22
	public void displayText(string input) //Min metod <-----------------
23
	{
24
		Console.WriteLine ("Before: "+textview2.Buffer.Text);
25
		textview2.Buffer.InsertAtCursor(input + "\n");
26
		Console.WriteLine ("After: "+textview2.Buffer.Text);
27
	}
28
}
29
30
################################## other file ######################################
31
32
namespace Launcher
33
{
34
	public class MainClass
35
	{
36
		public static void Main (string[] args)
37
		{
38
			Application.Init ();
39
			MainWindow win = new MainWindow ();
40
			win.Show ();
41
			Application.Run ();
42
			MainClass run = new MainClass();
43
			run.start ();
44
		}
45
46
		public void start()
47
		{
48
			win.displayText ("text"); //Here I call the method!
49
		}
50
51
	}
52
}