I'm having some problems calling a class or method in C# using Mono, can anyone give some help on what I'm doing wrong?
I want this piece of code:
public static void Execute(ScriptHost host) { try { TesteGUI teste = new TesteGUI(); //? TesteGUI(); // ? } catch(Exception e) { } finally { } } To call this piece of code:
public TesteGUI(Gtk.Window parentWindow) : base(Gtk.WindowType.Toplevel) { base.Modal = false; base.TransientFor = parentWindow; base.Decorated = false; base.WindowPosition = WindowPosition.CenterAlways; this.MyBuild(); base.KeyReleaseEvent += delegate(object o, KeyReleaseEventArgs args) { if (args.Event.Key == Gdk.Key.Escape) { this.Destroy(); } }; } What is my doing wrong and how can I make it work?
Thank you
new TesteGUIway. However, you're missing a parameter - you have to pass the parent window to the constructor.