Search code examples
c#monogtkgtk#gtkmm

GTK# Window Non-Resizable Bug


I am trying to make a window not resizable by calling myWindow.Resizable = false;, but when I do that, the window's right edge and bottom snap to the button instead of maintaining the default size that I specify. What gives?

using System;
using Gtk;

class WindowTester
{
    static void Main ()
    {

        Application.Init ();
        Window myWindow = new Window ("This is a window");
        myWindow.DeleteEvent += OnDelete;
        myWindow.Resizable = false;    
        myWindow.SetDefaultSize(600, 400);

        //Put a button in the Window
        Button button = new Button ("Click");
        button.SetSizeRequest(75,30);
        Fixed container = new Fixed();
        container.Put(button, 500, 350);

        myWindow.Add (container);
        myWindow.ShowAll ();
        Application.Run ();
    }

    static void OnDelete (object o, DeleteEventArgs e)
    {
        Application.Quit ();
    }   
}

Solution

  • The workaround that did the trick was adding an empty label to the bottom right corner of the window. They should really fix this though.