On 05-06-2019 00:16, Alex X wrote:

On Tue, 4 Jun 2019 19:34:54 +0200, Mike Wey wrote:

On 04-06-2019 03:00, Alex X wrote:

On Mon, 3 Jun 2019 22:42:05 +0200, Mike Wey wrote:

On 03-06-2019 03:17, Alex X wrote:

int x, y,w, h;
win.getPosition(x,y);
auto pw = win.getAllocatedWidth();
auto ph = win.getAllocatedHeight();
win.getSize(w,h);

win.setDefaultSize(400,400);
win.setSizeRequest(300,300);
win.resize(200,200);

win.move(30,30);

None of this code seems to do anything anywhere I place it. (addOnShow, addOnHide, addOnRealize,

For me it seems to be working when i put move and setDefaultSize in
the constructor for the window. Only move doesn't the the window
decorations in to account when positioning the window.

Unfortunately I do not have access to the constructor ;/ I'm using glade and builder...

I wonder if a callback could be added for the constructors so I could hook in to them before I build so I may be able to get things to work? (would be a static delegate for each constructor taking this and the arguments... same thing might have to happen for destructors. Also, one would want to use an array to allow for multiple entries)

What happens when you call these functions directly on the Window
returned by Builder.getObject?

That is what I'm doing except I do cast it to the Gtk type.

auto win = cast(gtk.Window.Window)builder.getObject("MainWin");

There doesn't appear to be a way to do this when using gtk.Builder, as
these functions need to be called before the window is shown.