matplotlib pick_event in tkinter - python

Is there any way to use 'pick_event' while using Tkinter back-end? I can use tk canvas to show my plots but couldn't find any document that handles pick_evet within tkinter.

Related

Module naming overlaps

I'm using Tkinter with a GUI using a button inside the root window.
I also want to use a Button inside a MatplotLib graph that allows me to exit the graph (and potentially for other uses in the future).
The only problem is that they both use the same label Button. These two labels have different syntax so I can only either have Tkinter buttons or Matplotlib buttons.
I'm sure this is a very amateur question but is there a way to specify that this Button is a tkinter button while another Button is a matplotlib button?
Here's an example of the code:
from matplotlib.widgets import Slider, Button, RadioButtons
from tkinter import *
btn = Button(root, text="Plot", command=graph).pack()
Found the answer but this might be helpful to some people
You can instead use
import tkinter as tk
and then everytime you want to you a tkinter function you specify it by writing "tk." before it.
E.g.:
tk.Button
in this case and it will specifically use the tkinter version of the Button

Python - Text widget from tkinter in ttk

I noticed that the Text widget from tkinter is not present in the ttk widgets.
I'm using the ttk instead of tkinter because its interface suits better.
And I need Text widget because it has multiple lines unlikely the Entry widget.
Does anyone have a solution for my problem?
The solution is to use the tkinter text widget. tkinter and ttk are designed to work together.

How to remove window frame from program using Tkinter and Matplotlib

I am writing a graphical program in Python for my Raspberry Pi project. I have started writing it using Tkinter and wish to use the Matplotlib tools.
Due to limited screen space and the purpose of the project, I want it to be fullscreen without a window frame and menubar showing. Normally I use the following command:
app.overrideredirect(1)
This works great until I import Matplotlib. Once I do that, the window frame appears again even with the above line of code.
How can I get Matplotlib to not show the window frame or menubars and be completely fullscreen?
Thanks!
I found the problem. The example code I followed involved using the command canvas.show() along with canvas.get_tk_widget().grid(...). The canvas.show() was not needed and caused it to override the app.overrideredirect(1) command.

can Python Tkinter widget show a thread?

Is there a widget that shows a thread visually for Tkinter?
reason why. I want to open a Vpython window inside a Tkinter window.
I know there is a possibility to open a Vpython thread on the side while Tkinter is active, but can i show it inside Tkinter? (Like in some sort of Frame)
No, there is no widget to do that.

Can I get messagebox's icon="warning" noise on a custom Tkinter Toplevel() window?

I like the warning noise that messagebox provides out of the box (no pun intended), as in the GUI below.
from tkinter import messagebox
messagebox.showinfo("my title", "my message", icon="warning", parent=None)
However, I need more customization than messagebox offers, so I've created my own window. Is there a way to include the same warning noise with a Toplevel() window?
I'm using Python3 and Tkinter 8.5.
I think you would need to manually sound it
import Tkinter
Tkinter.Tk().bell()
or maybe you can just do SomeWindow.bell() (to be honest im not overly familiar with tkinter)

Categories