When I try to create a form from the mono C# REPL I cant get access to System.Windows.Forms classes
I can use other .net libraries from REPL with no problem.
Any thoughts?
When I try to create a form from the mono C# REPL I cant get access to System.Windows.Forms classes
I can use other .net libraries from REPL with no problem.
Any thoughts?
You can use LoadAssembly and LoadPackage as needed inside of the REPL:
Example:
csharp> LoadAssembly("System.Windows.Forms")
csharp> using System.Windows.Forms
csharp> LoadAssembly("System.Drawing")
csharp> using System.Drawing
csharp> class MyApp : System.Windows.Forms.Form
{
public MyApp()
{
Label label;
ClientSize = new System.Drawing.Size(250, 250);
label = new Label();
label.Text = "A Mono CSharp REPL Window";
label.Dock = DockStyle.Fill;
label.TextAlign = ContentAlignment.MiddleCenter;
this.Controls.Add(label);
Text = "Hello, StackOverFlow";
}
public static void Main()
{
Application.Run(new MyApp());
}
}
MyApp.Main()
FYI: If you are trying to generate dynamic GUIs, I would look at gsharp (from mono-tools) since it has a GTK pane and you can add/remove widgets to that pane.