Probably I haven’t understood well what Language Reference says, but I though that this line of code
self.Bounds.Center = wGHC.Bounds.Center
would centre the window (“self”) on the wGHC window. But it only centers it vertically but not horizontally.
Is it a bug or I misunderstood it?
It was really my fault. This can be found in Language Refrence
To set the bounds, do not modify the Bounds properly directly. This does not work because you will be modifying a temporary object. Instead set the bounds in your own Realbasic.Rect instance and assign that to bounds:
Var myBounds As New Rect
myBounds.Left = 100
myBounds.Top = 100
myBounds.Height = Self.Height
myBounds.Width = Self.Width
Self.Bounds = myBounds