Reputation: 13
I have a tkinter application and want to display some of its buttons in the Mac Touch Bar. For Example
from tkinter import *
root = Tk()
send_button = Button(text = "Send",bg = 'sky blue',fg = 'black',font = "size 15",pady = 5)
send_button.grid()
root.mainloop()
So I want to integrate the send_button
to show up in the Touch Bar, so is there a way to do that in tkinter.
Upvotes: 1
Views: 660
Reputation:
There is a Package called PyTouchBar. I think this would help. https://github.com/Maxmad68/PyTouchBar/wiki
As an Example:
root = Tk()
PyTouchBar.prepare_tk_windows(root)
def function(button):
print('Button clicked!')
button = PyTouchBar.TouchBarItems.Button(title='Click me!', action=function)
PyTouchBar.set_touchbar([button])
root.mainloop()
Upvotes: 0