FutureBasic Logo

<<    Index    >> FutureBasic 5

FBGetControlRect   function



Syntax:
ignored = fn FBGetControlRect(cHndl&, rect)

Description:
Before MacOS X, we were able to extract the content rectangle of a button using the following code:
// rem does not work in MacOS X
dim @t,l,b,r
BlockMove button&(_btnRefNum)+_contrlrect,@t,8

Carbon programs do not offer the ability to peek into structures like control records. FutureBasic provides this utility function for use in any program so that you may extract the rectangle regardless of the current version of system software.
dim @t,l,b,r // old style rectangle
fn FBGetControlRect(button&(_thebutton), t)

or...
dim r as Rect // new style rectangle
fn FBGetControlRect(button&(_thebutton), r)