Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

TouchBar.AssignToApp

Assigns the TouchBar to be the main one for current app.

Component Version macOS Windows Linux Server iOS SDK
TouchBar 6.5 ✅ Yes ❌ No ❌ No ❌ No ❌ No
MBS( "TouchBar.AssignToApp"; TouchBarRef )   More

Parameters

Parameter Description Example
TouchBarRef The reference number for the touch bar. $TouchBar

Result

Returns OK or error.

Description

Assigns the TouchBar to be the main one for current app.

Examples

Build App TouchBar:

#Create a new TouchBar
Set Variable [$t; Value:MBS( "TouchBar.Create" )]
#Add two buttons
Set Variable [$r; Value:MBS( "TouchBar.AddButton"; $t; "AddRecord"; ""; "NSImageNameTouchBarAddTemplate"; "Add"; 0; Get(FileName); "AddRecordTouchBar" )]
Set Variable [$r; Value:MBS( "TouchBar.AddButton"; $t; "DeleteRecord"; ""; "NSImageNameTouchBarDeleteTemplate"; "Delete"; 0; Get(FileName); "DeleteRecordTouchBar" )]
Set Variable [$r; Value:MBS( "TouchBar.AddButton"; $t; "InfoButton"; ""; TouchBar::MBS; "Info"; 0; Get(FileName); "InfoTouchBar" )]
#Set which button show by default:
Set Variable [$r; Value:MBS( "TouchBar.SetDefaultItemIdentifiers"; $t; "AddRecord¶InfoButton¶NSTouchBarItemIdentifierOtherItemsProxy")]
#Set the primary button:
Set Variable [$r; Value:MBS( "TouchBar.SetPrincipalItemIdentifier"; $t; "AddRecord" )]
#Set which buttons can be configured:
Set Variable [$r; Value:MBS( "TouchBar.SetCustomizationAllowedItemIdentifiers"; $t; "AddRecord¶InfoButton¶DeleteRecord")]
#Set this touch bar to be the app one:
Set Variable [$r; Value:MBS( "TouchBar.AssignToApp"; $t )]

See also

Example Databases

This function checks for a license.

Created 1st November 2016, last changed 3th November 2016


TouchBar.AddButton - TouchBar.AssignToWindow