Answer the question
In order to leave comments, you need to log in
How to correctly restore the window size on application startup in Gtk# ?
I am writing an application in C# using GTK#.
There is a small problem, which, upon closer examination, has turned into not at all “small”.
I need to save the application window size and maximize flag between launches.
I save the data in the config, this is not a problem. But when trying to restore the saved window size at application startup, I ran into inadequate difficulties.
Tried the following methods:
this.SetSizeRequest((int)config["windowwidth"], (int)config["windowheight"]);
this.SetDefaultSize((int)config["windowwidth"], (int)config["windowheight"]);
this.Resize((int)config["windowwidth"], (int)config["windowheight"]);
Gdk.Geometry geom = new Gdk.Geometry();
geom.MinWidth = 800;
geom.MinHeight = 400;
this.SetGeometryHints(BoxNotebook, geom, Gdk.WindowHints.MinSize);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question