1
votes

just trying to pick up the best cross platform GUI library for a little side project I am building with Mono. Currently I am trying out GTK# and it has been a struggle, not gonna lie. The biggest issue I am experiencing is that my Desing / Source tabs disappear the second I add a new GTK window or restart Visual Studio. I am working on a Mac as well.

Any suggestions how to make these tabs appear again? Could it be that .Net for Mac is sabotaging me or is it the Gtk# that is playing tricks.

Thanks

P.S. I saw a similar question for xamarin but the solution provided doesn't seem to be applicable as I see completely different tools, probably as per the mac

screenshot

1

1 Answers

0
votes

I know this won't solve your issue, but it is better if you learn how to write your frontend without the designer. I understand it is comfortable, but using it you're tied to MonoDevelop/Xamarin Studio/Visual Studio for Mac.

Checkout this tutorial in Gtk# gui creation. With a few steps, you'll be able to create a great user interface and use the editor of your choice the next time you want to work in this project.

public class MainWindow: Gtk.Window {
    public MainWindow()
        : base( Gtk.WindowType.Toplevel )
    {
        this.Build();
    }

    public void Build()
    {
        var vBox = new Gtk.VBox( true, 5 );
        var lblHello = new Gtk.Label( "Hello, world!" );

        vBox.PackStart( lblHello, true, true, 5 );
        this.Add( vBox );
        this.ShowAll();
    }
}

The code above creates a window with a layout box (a vertical box), with a label (text viewer) inside. You can nearly create everything by means of nesting VBox and HBox (they behave the same, just the orientation changes), and packing inside the widgets you need.