Skip to content
Advertisement

Tag: tkinter

Suppressing other canvas items from reacting to event

I have a rectangle on a canvas listening for events, with a callback function “A”. The blank space in the canvas is also listening to events with a callback function “B”. When the I right-click on the rectangle, both “A” and “B” are executed. I understand why this happens (the rectangle is on the canvas). The behavior I want to

How to select multiple checkbox then store values in a list? python

I have this sample code, I need to make multiple selections in that users list, after I hit OK, it stores checked value into another list named selected_users for later use. For example, when I run this code, a checkbox window pops out, and I tick Anne,Bob, click OK. selected_users is now [‘Anne’,’Bob’]. And Window disappears Answer You can do

tkinter Python GUI Frame Positioning

How can you position the frames (and or elements inside the frames) such that the radio buttons at the bottom are shifted to the left outer edge of the GUI interface and the title is shifted to the center of the GUI interface? GUI Answer To achieve the goal: set columnspan=3 in frame_title.grid(…) set columnspan=2 in frame_fields.grid(…) move frame_scan to

tkinter, pack inside grid and propagation not working

I am trying to create a button with a fixed size. So, I created a Frame (grid) with the size I want and then a child Button (pack) inside of the Frame that takes all the space. Here is a minimal example: Without the commented line above, I expected that it would work (having a rectangle of the specified size),

Advertisement