tkinter-menu

tkinter doesn't open image via function

自作多情 提交于 2021-02-05 10:50:50
问题 Tkinter doesn't open the image. We can ask the opening incorrectly, we need help. I need it to open the image through the menu. be sure to use pil, as the image can be anything. There are no errors in the syntax. Thank you = ) from tkinter import Tk, Frame, Menu, Canvas, PhotoImage import easygui from PIL import Image, ImageFilter, ImageTk def input_file(): a = easygui.fileopenbox(filetypes=["*.jpg"]) original = Image.open(a) original = original.resize((799, 799), Image.ANTIALIAS) photoimg =

Update on the fly a ttk.OptionMenu without affecting its previous callback/command

若如初见. 提交于 2021-01-29 07:26:28
问题 I am doing a large GUI with different ttk.OptionMenu widgets that need to be updated often depending on the interaction with the user. Each time the user selects another value from the menu, there is a function callback by the widget via the command input. The command works fine until I need to update the possible values within the OptionMenu widget. After updating using add_command , my previous callback does not work anymore. Is there any way of updating the possible inputs of a ttk

Is it possible to change the menu border color in tkinter

我的未来我决定 提交于 2021-01-27 20:15:00
问题 I want to change the border color of the drop down menu items. white theme: Using Python 3.7 and tkinter - my GUI app offer both dark and light themes, so I change the background and foreground colors dynamically. I was able to do it for most widgets, but I did not find a way to change the border color for the drop down menu items. Here's a sample snippet of how the file_menu is defined: self.menubar = tk.Menu(self) self.file_menu = tk.Menu(self.menubar, tearoff=0) self.file_menu.add_command

change the label of the radiobutton

半世苍凉 提交于 2020-05-01 05:49:47
问题 I'm creating a menu in Tkinter. After my menu has been created I'd like to be able to change the label of the radiobutton. Something similar to the .configure method. How do I go about this? I want to be able to change the radiobuttons text from "Hello" to "Hello!". Snippet: self.B3Me = Tkinter.Menu(self, tearoff=0, activebackground='grey15', activeforeground='grey95') self.B3MeVar = Tkinter.StringVar() self.B3Me.add_radiobutton(label='Hello', variable=self.B3MeVar, command=self.B3_menu_beh)

change the label of the radiobutton

自古美人都是妖i 提交于 2020-05-01 05:48:50
问题 I'm creating a menu in Tkinter. After my menu has been created I'd like to be able to change the label of the radiobutton. Something similar to the .configure method. How do I go about this? I want to be able to change the radiobuttons text from "Hello" to "Hello!". Snippet: self.B3Me = Tkinter.Menu(self, tearoff=0, activebackground='grey15', activeforeground='grey95') self.B3MeVar = Tkinter.StringVar() self.B3Me.add_radiobutton(label='Hello', variable=self.B3MeVar, command=self.B3_menu_beh)