Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using Gtk;
- using System;
- using Gtk;
- public partial class MainWindow: Gtk.Window
- {
- public MainWindow () : base (Gtk.WindowType.Toplevel)
- {
- Build ();
- //textview2.Buffer.InsertAtCursor ("Fungerar!\n"); //Fungerar
- }
- protected void OnDeleteEvent (object sender, DeleteEventArgs a)
- {
- Application.Quit ();
- a.RetVal = true;
- }
- public void displayText(string input) //Min metod <-----------------
- {
- Console.WriteLine ("Before: "+textview2.Buffer.Text);
- textview2.Buffer.InsertAtCursor(input + "\n");
- Console.WriteLine ("After: "+textview2.Buffer.Text);
- }
- }
- ################################## other file ######################################
- namespace Launcher
- {
- public class MainClass
- {
- public static void Main (string[] args)
- {
- Application.Init ();
- MainWindow win = new MainWindow ();
- win.Show ();
- Application.Run ();
- MainClass run = new MainClass();
- run.start ();
- }
- public void start()
- {
- win.displayText ("text"); //Here I call the method!
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement