[Question] Will it work if I use the same for windows ? #26
-
I am creating an app which includes buttons and I wanted to change the bg color of it but it wasn't working so I thought of using it. But will the same code work for Windows System i.e Using TkMacOs |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
If you mean whether tkmacosx is cross-platform then yes, it is. The tkmacosx button will look the same on Windows as well, if you don't want that behaviour then you can check for the sys platform. for ex: import sys
import tkinter as tk
from tkinter import Button
if sys.platform == 'darwin':
from tkmacosx import Button
root = tk.Tk()
b1 = Button(root, text="Hello")
b1.pack()
root.mainloop() |
Beta Was this translation helpful? Give feedback.
-
Then it would function the same if the program was to run on windows right? |
Beta Was this translation helpful? Give feedback.
Then it would function the same if the program was to run on windows right?