Realbasic.Rect.Constructor(X As Integer, Y As Integer, Width As Integer, Height As Integer)

From Xojo Documentation

Constructor
Realbasic.Rect.Constructor(X As Integer, Y As Integer, Width As Integer, Height As Integer)

New in 2011r2

Creates a Realbasic.Rect object at X,Y and the passed width and height.

Sample Code

This example is from the Rects example that is covered in the Notes section of the Rect class. The Open event of the main window contains constructors that appear in the top-left and bottom-right corners of the main window.

// Start by defining our two rectangles. Both will be 100 x 75.
// RectOne will be in the upper left. RectTwo will be in the lower right.
rectOne = New Realbasic.Rect(0, 0, 100, 75)
rectTwo = New Realbasic.Rect(Self.Width - 100, Self.Height - 75, 100, 75)

// Fill our point classes to avoid NilObjectException errors.
mousePosition = New Realbasic.Point(-1, -1)
mouseOffset = New Realbasic.Point(0, 0)