Advertisement
Guest User

wat.

a guest
Dec 15th, 2013
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using Gtk;
  3.  
  4.  
  5. public partial class MainWindow: Gtk.Window
  6. {
  7.     public MainWindow () : base (Gtk.WindowType.Toplevel)
  8.     {
  9.         Build ();
  10.         textview2.Buffer.InsertAtCursor("text\n");  //Works!
  11.     }
  12.  
  13.     protected void OnDeleteEvent (object sender, DeleteEventArgs a)
  14.     {
  15.         Application.Quit ();
  16.         a.RetVal = true;
  17.     }
  18.     public void displayText(string input)
  19.     {
  20.         Console.WriteLine ("Before: "+textview2.Buffer.Text);
  21.         textview2.Buffer.Text = input + "\n";
  22.         Console.WriteLine ("After: "+textview2.Buffer.Text);
  23.     }
  24. }
  25.  
  26. ################################## other file ######################################
  27.  
  28. namespace Launcher
  29. {
  30.     public class MainClass
  31.     {
  32.         public static void Main (string[] args)
  33.         {
  34.             Application.Init ();
  35.             MainWindow win = new MainWindow ();
  36.             win.Show ();
  37.             Application.Run ();
  38.             MainClass run = new MainClass();
  39.             run.start ();
  40.         }
  41.  
  42.         public void start()
  43.         {
  44.             win.displayText ("text"); //Here I call the method!
  45.         }
  46.  
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement