Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 12.1   12.2   12.3   12.4   12.5   13.0   13.1   13.2   13.3   13.4    Statistic    FMM    Blog  

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

💬 Ask a question or report a problem