[futurebasic] Re: [FB] help tags

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : March 2005 : Group Archive : Group : All Groups

From: Robert Purves <robert.purves@...>
Date: Mon, 7 Mar 2005 13:06:36 +1300
Steve Crossman wrote:

> I have my help tags working everywhere but palette windows in OS X 
> with FB4 r2.  I am presuming its because I am not correctly getting 
> the window's wndref pointer when setting it up in this statement
>
> err = fn HMSetWindowHelpContent( g_WindowPtr, helpRec )
>
> I have used everything I can think of for g_WindowPtr but to no avail. 
>  Anyone have any insight?


This works for me for _kFloatingWindowClass and _kDocumentWindowClass 
windows:


'--------------
include "Tlbx MacHelp.Incl"
end globals


local mode
local fn BuildWindow
'~'1
dim as HMHelpContent       helpText
dim as HMHelpContentRec    helpRec
dim as WindowRef         @ wRef
dim as OSStatus            err

appearance window 1,,, _kFloatingWindowClass // or _kDocumentWindowClass
get window 1, wRef
helpText.contentType = _kHMPascalStrContent
helpText.tagString   = "Hello"

SetRect( helpRec.absHotRect, 0, 0, 0, 0 ) // null rect
// see Tlbx MacHelp.Incl for other display locations
helpRec.tagSide    = _kHMInsideTopCenterAligned
helpRec.content[0] = helpText
helpRec.content[1] = helpText

// ensure that help will be shown
err = fn HMSetHelpTagsDisplayed( _true )

// set time delay (300 ms)
err = fn HMSetTagDelay( 300 )

err = fn HMSetWindowHelpContent( wRef, helpRec )

// how to turn off help for the window
//err = fn HMSetWindowHelpContent( wRef, #0 )

end fn

// main program
fn BuildWindow
do
HandleEvents
until 0
'--------------


Robert P.