widget

Can I set the command function for a tkinter scale later on in the code?

Can I set the command function for a tkinter scale later on in the code? Question: I want to define a tk.Scale widget and assing the command function LATER ON. I’m think of something similar to scale.set() but for the command option. Is there a way to do this? Asked By: Mcabrera || Source Answers: …

Total answers: 1

Python / Jupyter Notebook – How to disable text truncation in widgets VBOX/HBOX?

Python / Jupyter Notebook – How to disable text truncation in widgets VBOX/HBOX? Question: I’ve searched in the documentation and in the forums but I didn’t find my answer so I ask it here… enter image description here Here is an line of my code to set my widgets: bankroll_init = wg.IntSlider(min=1000, max=10000, step=500, value=3000, …

Total answers: 1

How to edit widget label's text which is generated in a for loop?

How to edit widget label's text which is generated in a for loop? Question: I’m trying to make a shopping basket/cart which contains items from a dictionary. Dictionary holds item name and its price. The code below displays items from dictionary and multiply quantity to price. There are + and – buttons which should modify …

Total answers: 2

How to clear a window in PySimpleGUI

How to clear a window in PySimpleGUI Question: I am using PySimpleGUI to build a GUI. How do you clear all the widgets on the window? In tkinter you have the code: widget.destroy() If you attempt this in PySimpleGUI you get the error: NameError: name ‘RWG’ is not defined if my widget is called RWG. …

Total answers: 1

Can I define an action on file upload when using ipywidgets FileUpload widget

Can I define an action on file upload when using ipywidgets FileUpload widget Question: I want to create an event off the uploading of a file with widgets.FileUpload same as I would do with an widgets.Button using the .on_click(some_function). Is there a way to do something like this import ipywidgets as widgets def do_something_with_file(fu): content …

Total answers: 2

Entry() Is not showing up in my program

Entry() Is not showing up in my program Question: I am having trouble figuring out why my Entry() is not showing up in my program window. I have looked around the internet and I can not figure out what I am doing wrong. I am trying to place my Entry() field above my main text …

Total answers: 2

Changing the colour of the tk.optionmenu widget

Changing the colour of the tk.optionmenu widget Question: I use this command to create a tk.optionmenu widget but its a grey colour and I want it to be white. optionmenu = tk.OptionMenu(root,variable,*(variables)).place(x=375, y=175) How do I change it to the white colour? I’ve tried this but it doesn’t seem to work. Thanks! optionmenu = tk.OptionMenu(root,variable,*(variables)colour=”White”).place(x=375, …

Total answers: 2

tkinter frame: fix frame height when changing its content

tkinter frame: fix frame height when changing its content Question: I am working on a self written simulation tool with a appropriate GUI. In general there are two main user modes. In the first one the user can enter several values for the desired calculation. After all calculations finshed, the user can switch to “results …

Total answers: 1

Changing ttk widget text color

Changing ttk widget text color Question: I’ve searched all over, but have yet to find a simple example showing how to change a minor element of a ttk widget style and applying it dynamically (after widget creation). I have some ttk checkbuttons representing some configuration items, and a ttk button used to update a remote …

Total answers: 2