AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
How to change mac background with key2/15/2023 Self. Self.button_ace(anchor=anchor,relx=relx,rely=rely)ĭef configure(self,width=width,height=height,text=text,bg=bg,fg=fg,font=font,command=command,bordercolor=bordercolor,bordersize=bordersize): Self.label = tk.Label(self.button_frame,text=self.text,bg=self.bg,width=self.width,height=self.height,fg=self.fg,font=self.font,highlightbackground=self.bordercolor,highlightthickness=self.bordersize) Self.button_frame = tk.Frame(root,width=width,height=height,bg=bg) import tkinter as tkĭef _init_(self,root,width=100,height=20,text="",bg="white",fg="black",font="f 12",command=None,bordercolor="black",bordersize=0): Not sure if anyone is still viewing this thread, but I have created a simple solution to this problem by creating my own Button class. If platform.system() = "Darwin": # if its a Macī = Button(text="Refersh All Windows", highlightbackground="Yellow", fg="Black", highlightthickness=30)ī = Button(text="Refresh All Windows", bg="Yellow", fg="Black") 12:29 AM in response to DrumminFoo92 +im talking about changing the actual color of the backlight+ The only way to change the color would be to swap each LEDs for a different color, putting a gel/film over them would just impact air flow and cooling and is not advisable. If you want your code to be OS independent, you can either add an 'if OS = "Mac"' statement or even add a custom function that modifies the button if its on a Mac but leaves it alone on Windows or Linux. This will be the button with the 'command' on it or the button you bind events to. Next use place to parent a background color button on top of it. However, if you must use grid, you can always hack it.create your colorless grid button. With grid, increasing the border size increases the button size automatically, unfortunately. This works if you are using place, but not if you are using something like grid. This will give your button the appearance of a label. If you increase the size of the border to be huge (the size of the button or greater), you will get a nice, solid background color. Its quite annoying that after years this is still a problem.Īnyways, as others have mentioned, highlightbackground (the border color) can be used in place of background on a Mac.
0 Comments
Read More
Leave a Reply. |