[futurebasic] Re: [FB] Round Button

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 2009 : Group Archive : Group : All Groups

From: Robert Purves <listrp@...>
Date: Thu, 10 Sep 2009 09:50:48 +1200
Eugen Rosu wrote:

> How can I make a round button, the same in Interface Builder?

'-----------
include "Tlbx ControlDefinitions.incl"
_kControlRoundButtonProc = (31 << 4)

_myRoundBtnNum = 1

dim as Rect       r
dim as ControlButtonContentInfo  content

window 1
SetRect( r, 40, 40, 60, 60 )
appearance button -_myRoundBtnNum,,,,,, @r, _kControlRoundButtonProc
// set content to help icon
long if ( fn GetIconRef( 0, _kSystemIconsCreator, _kHelpIcon,  
@content.u.iconRef ) == _noErr )
content.contentType = _kControlContentIconRef
def SetButtonData( _myRoundBtnNum, _kControlEntireControl,  
_kControlRoundButtonContentTag, sizeof( content ), content )
fn ReleaseIconRef( content.u.iconRef )
end if
appearance button _myRoundBtnNum // make visible

do
HandleEvents
until gFBQuit
'-----------

Robert P.