[Question] Will it work if I use the same for windows ? #26
Answered
by
ParthJadhav
ParthJadhav
asked this question in
Q&A
-
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.
Answered by
ParthJadhav
May 18, 2021
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.
0 replies
-
Then it would function the same if the program was to run on windows right? |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ParthJadhav
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Then it would function the same if the program was to run on windows right?