Re: Tcl::pTk overwrite About [macOS]

[email protected] (Christopher Chavez) Tue, 14 Aug 2018 03:55:21 -0500
Newsgroups perl.tcltk
Message-ID <[email protected]>

> On Aug 13, 2018, at 1:22 PM, welle Ozean via tcltk <[email protected]> =
wrote:
>=20
> Hello,
>=20
> I have a Tk application for macOS written with Tcl::pTk and packed as =
a normal macOS bundle. In the macOS menu, under the name of the =
application bundle there is a menu item called "About + Name of =
application". This is created auotmatically and contains the Tcl =
version. In this About menu, I would like to replace/integrate the =
default values with information about my App. Is this possible? If yes, =
how? I couldn't find any information online.
>=20
> Best,
> Welle

Hi Welle,

I have been curious about this feature myself, but I have yet to figure =
out how exactly to use it from Perl (whether through Tcl::pTk, Tkx, =
etc.). The Tcl/Tk widget demo is able to set its own About entry, so the =
capability in Tcl/Tk should be working and available for our use from =
Perl.

The main idea is to add an About entry to a special `apple` menu. For =
some background on this feature, there=E2=80=99s Tk=E2=80=99s =
documentation of using it: https://www.tcl.tk/man/tcl/TkCmd/menu.htm#M21 =
. Perl/Tk had adapted that verbiage in =
https://metacpan.org/pod/distribution/Tk/pod/Menu.pod#SPECIAL-MENUS-IN-MEN=
UBARS but clearly that=E2=80=99s not been updated since Mac OS classic. =
TkDocs also explains how this feature works and how to use it from other =
languages besides Tk (Ruby, Perl using Tkx, and Python using Tkinter): =
https://tkdocs.com/tutorial/menus.html

However none of the Tkx examples had an effect when I tried it (they =
still had the default About dialog), whether from TkDocs=E2=80=99 =
example or the examples included with Tkx (tkx-ed and menu scripts). I =
was hoping to adapt the Tkx usage to Tcl::pTk syntax once I got it =
working.

Note that the windowingsystem should be checked prior to using the =
`apple` menu, i.e. placed in something like `if($widget->windowing =
system eq 'aqua') { =E2=80=A6 }`.=