You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacExtras/Center Resize Xojo Windows
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
EventHandler Sub Open()
CenterResizeInstallMBS
End EventHandler
End Class
Class Window1 Inherits Window
Control PosX Inherits Label
ControlInstance PosX Inherits Label
End Control
Control PosY Inherits Label
ControlInstance PosY Inherits Label
End Control
Control PosW Inherits Label
ControlInstance PosW Inherits Label
End Control
Control PosH Inherits Label
ControlInstance PosH Inherits Label
End Control
Control Timer1 Inherits Timer
ControlInstance Timer1 Inherits Timer
EventHandler Sub Action()
posx.Text = str(self.left)
posy.Text = str(self.top)
posw.Text = str(self.Width)
posh.Text = str(self.Height)
End EventHandler
End Control
EventHandler Sub Close()
CenterResizeRemoveWindowMBS self
End EventHandler
EventHandler Sub Open()
CenterResizeAddWindowMBS self
End EventHandler
End Class
MenuBar MainMenuBar
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem EditSeparator1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem EditSeparator2 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar