Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Tweak example in tip 536 |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
8ecc901f75c676257d12fa4d9f56ec08 |
User & Date: | kevin_walzer 2019-04-18 01:54:23.387 |
Context
2019-04-19
| ||
14:18 | Fix formatting in 411 check-in: 3b25ece3be user: dkf tags: trunk | |
2019-04-18
| ||
01:54 | Tweak example in tip 536 check-in: 8ecc901f75 user: kevin_walzer tags: trunk | |
2019-04-16
| ||
13:31 | TIP 342 is Final check-in: 53c69e3a9d user: dkf tags: trunk | |
Changes
Changes to tip/536.md.
︙ | ︙ | |||
23 24 25 26 27 28 29 | The following commands, which will all be documented in the tk::mac section of the Tk man page, will be added with this TIP: ## ::tk::mac::PerformService Executes a Tcl procedure called from the macOS "Services" menu by another application in the Apple menu item. The "Services" menu item allows for inter-application communication; data from one application, such as selected text, can be sent to another application for processing, for example to Safari as a search item for Google, or to TextEdit to be appended to a file. Tk will includes a stub version of this command that displays a dialog with the data sent. This procedure should be rewritten in an application script for customization, which will allow a Tk application to expose "Service" functionality to other programs: proc ::tk::mac::PerformService {} { | | > | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | The following commands, which will all be documented in the tk::mac section of the Tk man page, will be added with this TIP: ## ::tk::mac::PerformService Executes a Tcl procedure called from the macOS "Services" menu by another application in the Apple menu item. The "Services" menu item allows for inter-application communication; data from one application, such as selected text, can be sent to another application for processing, for example to Safari as a search item for Google, or to TextEdit to be appended to a file. Tk will includes a stub version of this command that displays a dialog with the data sent. This procedure should be rewritten in an application script for customization, which will allow a Tk application to expose "Service" functionality to other programs: proc ::tk::mac::PerformService {} { set w [text .t] pack $w set data [clipboard get] $w insert end $data } Note that the mechanism for retrieving inter-application data is from the clipboard; there is no other supported way to obtain the data. If the Services process is not desired, the NSServices keys can be deleted from the application's Info.plist file. The underlying code supporting this command also allows the text, entry and ttk::entry widgets to access/consume services from other applications via the Services menu. |
︙ | ︙ |