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
andsetDefaultSize
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)
Are you implying that the code above fails if it is not in the constructor though?
I don't care too much about the exact position as long as getting and setting it produce the same result.