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:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
TouchBar.AssignToWindow
Assigns the TouchBar to be the one used with the given window.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| TouchBar | 6.5 | Yes | No | No | No | No |
Parameters
| Parameter | Description | Example |
|---|---|---|
| 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
- TouchBar.AddButton
- TouchBar.Create
- TouchBar.SetCustomizationAllowedItemIdentifiers
- TouchBar.SetDefaultItemIdentifiers
- TouchBar.SetPrincipalItemIdentifier
- Window.ClearTouchBar
- Window.FindByIndex
- Window.FindByTitle
Example Databases
Created 1st November 2016, last changed 3th November 2016
TouchBar.AssignToApp - TouchBar.Available
Feedback: Report problem or ask question.
Links
MBS FileMaker blog