[futurebasic] Re: [FB] Popup title justification

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : February 2004 : Group Archive : Group : All Groups

From: Bernie Wylde <bernie.w@...>
Date: Fri, 20 Feb 2004 13:45:05 +0000
I wrote:

> In OS X, when a popup menu's title width is specified, is it possible
> to set the justification of the title?

So... I expected the following would create a popup button with a right 
justified title... Not so.

I'll bet there's someone in here who's just the bloke to show me where 
I'm going wrong.

Bernie

'-----------
#define Style as unsigned char
toolbox fn CreatePopupButtonControl(WindowRef inWindow,¬
                                     const Rect * inBoundsRect,¬
                                     CFStringRef inTitle,¬
                                     SInt16 inMenuID,¬
                                     Boolean inVariableWidth,¬
                                     SInt16 inTitleWidth,¬
                                     SInt16 inTitleJustification,¬
                                     Style inTitleStyle,¬
                                     ControlRef * outControl) = OSStatus

dim as Rect          r
dim as ControlRef  @ c
dim as CFStringRef   cfTitle

window 1

cfTitle = fn CFStringCreateWithPascalString(0, "PopUp:", 
_kCFStringEncodingMacRoman)
SetRect(r, 100, 100, 250, 120)
fn CreatePopupButtonControl(window(_wndRef), r, cfTitle,¬
                             1, _false, 80, _popupTitleRightJust,¬
                             _popupTitleNoStyle, c)
CFRelease(cfTitle)

do
HandleEvents
until 0
'-----------