1

How can I can a function and create a function for the icon context menu? I want to make the iconic Open New Window function pop-up when you right click on the icon menu in the taskbar/dock. See this question for more info on this kind of question.

Places I have looked but found nothing:

TRCK
  • 231
  • 3
  • 12

1 Answers1

1

While there are a tiny subset of apple events that you can benefit from the DockMenu is not accessible directly via tkinter. Turns out mac is not really open for modifications and even smaller tasks can be hard. You could consider to use a system tray icon instead.

Thingamabobs
  • 7,274
  • 5
  • 21
  • 54
  • Very interesting. There is no functionality for this in tk itself? I am intrigued by the idea of a system tray icon but and wondering if I can call on the DockMenu using pyobjc. What are your thoughts? – TRCK Jul 02 '22 at 14:26
  • @TRCK I have no experience with mac and cant help you further more to gain progress. I just was interested in the tkinter relationship. But I can tell that I use win32 to make similar *extensions* to my applications, it can be frustrating and hard, but in the end it is your app. Hope you will find a way, happy codeing. – Thingamabobs Jul 02 '22 at 14:44
  • 1
    @TRCK [Found you something](https://stackoverflow.com/a/1517639/13629335) – Thingamabobs Jul 02 '22 at 14:51
  • 1
    @TRCK just came across [here](https://docs.python.org/3/using/mac.html#gui-programming-on-the-mac) where quote: *PyObjC is a Python binding to Apple’s Objective-C/Cocoa framework, which is the foundation of most modern Mac development. Information on PyObjC is available from https://pypi.org/project/pyobjc/.* thought it would be interesting for you. Also would be nice if you accept this answer. – Thingamabobs Jul 03 '22 at 03:44