Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5    Statistic  

TouchBar.AssignToWindow

Assigns the TouchBar to be the one used with the given window.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
TouchBar 6.5 Yes No No No No

MBS( "TouchBar.AssignToWindow"; TouchBarRef; WindowRef )

Parameters

Parameter Description Example value
TouchBarRef The reference number for the touch bar. $TouchBar
WindowRef Window Reference is the unique OS level window ID. You can obtain this by using the Window.FindByTitle or Window.FindByIndex functions. Pass zero to access the frontmost window. 0

Result

Returns OK or error.

Description

Assigns the TouchBar to be the one used with the given window.

Examples

Build TouchBar for Window:

#Create a new TouchBar
Set Variable [$t; Value:MBS( "TouchBar.Create" )]
#Add two buttons
Set Variable [$r; Value:MBS( "TouchBar.AddButton"; $t; "PrevRecord"; ""; "NSImageNameTouchBarGoBackTemplate"; "Previous"; 0; Get(FileName); "PrevRecordTouchBar" )]
Set Variable [$r; Value:MBS( "TouchBar.AddButton"; $t; "NextRecord"; ""; "NSImageNameTouchBarGoForwardTemplate"; "Previous"; 0; Get(FileName); "NextRecordTouchBar" )]
#Set which button show by default:
Set Variable [$r; Value:MBS( "TouchBar.SetDefaultItemIdentifiers"; $t; "PrevRecord¶NextRecord¶NSTouchBarItemIdentifierOtherItemsProxy")]
#Set the primary button:
Set Variable [$r; Value:MBS( "TouchBar.SetPrincipalItemIdentifier"; $t; "NextRecord" )]
#Set which buttons can be configured:
Set Variable [$r; Value:MBS( "TouchBar.SetCustomizationAllowedItemIdentifiers"; $t; "PrevRecord¶NextRecord")]
#Assign touchbar to current window:
Set Variable [$r; Value:MBS( "TouchBar.AssignToWindow"; $t; 0 )]

See also

Example Databases


TouchBar.AssignToApp   -   TouchBar.Available

Feedback: Report problem or ask question.




Links
MBS Xojo tutorial videos