Frage

Hy all,

I'm playing around with monodevelop and am using gtk for the window. Curently i'm using Windows 7 x64.

The problem that i'm having is that when i'm maximizing the window ( by hand or by program, that doesn't matter ) there's still some space at the top of the page left. And it doesn't connect well at the bottom of the screen. So it looks like the whole program is maximized, and then put down a couple of pixels.

Here's an screenshot of the maximized window: Maximized Windows

As you can see in the second printscreen, it is posible to get the program at that top: small window that can reach the top

So my question is very simple... How can i get the window maximized in a good way that is normal...

EDIT The code in MainWindow.cs ( root/gtk-gui/MainWindow.cs )

// This file has been generated by the GUI designer. Do not modify.
public partial class MainWindow
{
    private global::Gtk.UIManager UIManager;
    private global::Gtk.Action FileAction;
    private global::Gtk.Action stopAction;
    private global::Gtk.HPaned hpaned1;
    private global::Gtk.VBox vbox1;
    private global::Gtk.MenuBar menubar2;
    private global::Gtk.HBox hbox1;
    private global::Gtk.Button button1;
    private global::Gtk.HPaned hpaned3;
    private global::Gtk.ScrolledWindow GtkScrolledWindow;
    private global::Gtk.TreeView treeview1;
    private global::Gtk.ProgressBar progressbar1;

    protected virtual void Build ()
    {
        global::Stetic.Gui.Initialize (this);
        // Widget MainWindow
        this.UIManager = new global::Gtk.UIManager ();
        global::Gtk.ActionGroup w1 = new global::Gtk.ActionGroup ("Default");
        this.FileAction = new global::Gtk.Action ("FileAction", global::Mono.Unix.Catalog.GetString ("File"), null, null);
        this.FileAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("File");
        w1.Add (this.FileAction, null);
        this.stopAction = new global::Gtk.Action ("stopAction", global::Mono.Unix.Catalog.GetString ("Exit"), null, "gtk-stop");
        this.stopAction.ShortLabel = global::Mono.Unix.Catalog.GetString ("Exit");
        w1.Add (this.stopAction, null);
        this.UIManager.InsertActionGroup (w1, 0);
        this.AddAccelGroup (this.UIManager.AccelGroup);
        this.Name = "MainWindow";
        this.Title = global::Mono.Unix.Catalog.GetString ("Maximized Window");
        this.WindowPosition = ((global::Gtk.WindowPosition)(3));
        this.AllowShrink = true;
        this.DefaultWidth = 1024;
        this.DefaultHeight = 768;
        // Container child MainWindow.Gtk.Container+ContainerChild
        this.hpaned1 = new global::Gtk.HPaned ();
        this.hpaned1.CanFocus = true;
        this.hpaned1.Name = "hpaned1";
        this.hpaned1.Position = 1;
        // Container child hpaned1.Gtk.Paned+PanedChild
        this.vbox1 = new global::Gtk.VBox ();
        this.vbox1.Name = "vbox1";
        this.vbox1.Spacing = 6;
        // Container child vbox1.Gtk.Box+BoxChild
        this.UIManager.AddUiFromString ("<ui><menubar name=\'menubar2\'><menu name=\'FileAction\' action=\'FileAction\'><menuite" +
                "m name=\'stopAction\' action=\'stopAction\'/></menu></menubar></ui>");
        this.menubar2 = ((global::Gtk.MenuBar)(this.UIManager.GetWidget ("/menubar2")));
        this.menubar2.Name = "menubar2";
        this.vbox1.Add (this.menubar2);
        global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.menubar2]));
        w2.Position = 0;
        w2.Expand = false;
        w2.Fill = false;
        // Container child vbox1.Gtk.Box+BoxChild
        this.hbox1 = new global::Gtk.HBox ();
        this.hbox1.Name = "hbox1";
        this.hbox1.Spacing = 6;
        // Container child hbox1.Gtk.Box+BoxChild
        this.button1 = new global::Gtk.Button ();
        this.button1.CanFocus = true;
        this.button1.Name = "button1";
        this.button1.UseUnderline = true;
        this.button1.Label = global::Mono.Unix.Catalog.GetString ("GtkButton");
        this.hbox1.Add (this.button1);
        global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.button1]));
        w3.Position = 1;
        w3.Expand = false;
        w3.Fill = false;
        this.vbox1.Add (this.hbox1);
        global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hbox1]));
        w4.Position = 1;
        w4.Expand = false;
        w4.Fill = false;
        // Container child vbox1.Gtk.Box+BoxChild
        this.hpaned3 = new global::Gtk.HPaned ();
        this.hpaned3.CanFocus = true;
        this.hpaned3.Name = "hpaned3";
        this.hpaned3.Position = 91;
        this.hpaned3.BorderWidth = ((uint)(2));
        // Container child hpaned3.Gtk.Paned+PanedChild
        this.GtkScrolledWindow = new global::Gtk.ScrolledWindow ();
        this.GtkScrolledWindow.Name = "GtkScrolledWindow";
        this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
        // Container child GtkScrolledWindow.Gtk.Container+ContainerChild
        this.treeview1 = new global::Gtk.TreeView ();
        this.treeview1.CanFocus = true;
        this.treeview1.Name = "treeview1";
        this.GtkScrolledWindow.Add (this.treeview1);
        this.hpaned3.Add (this.GtkScrolledWindow);
        global::Gtk.Paned.PanedChild w6 = ((global::Gtk.Paned.PanedChild)(this.hpaned3 [this.GtkScrolledWindow]));
        w6.Resize = false;
        this.vbox1.Add (this.hpaned3);
        global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.hpaned3]));
        w7.Position = 2;
        // Container child vbox1.Gtk.Box+BoxChild
        this.progressbar1 = new global::Gtk.ProgressBar ();
        this.progressbar1.Name = "progressbar1";
        this.vbox1.Add (this.progressbar1);
        global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.progressbar1]));
        w8.Position = 3;
        w8.Expand = false;
        w8.Fill = false;
        this.hpaned1.Add (this.vbox1);
        this.Add (this.hpaned1);
        if ((this.Child != null)) {
            this.Child.ShowAll ();
        }
        this.Show ();
        this.DeleteEvent += new global::Gtk.DeleteEventHandler (this.OnDeleteEvent);
        this.stopAction.Activated += new global::System.EventHandler (this.stopProgram);
    }
}
War es hilfreich?

Lösung

I can successfully reproduce this behaviour on my Windows 8 box.

It seems to come from the WindowPosition setted to CenterAlways. Yet the documentation warns us on the usage :

Note that using GTK_WIN_POS_CENTER_ALWAYS is almost always a bad idea. It won't necessarily work well with all window managers or on all windowing systems.

Setting the WindowPosition to None (0) fixed the issue for me.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top