#๐ Tkinter button : going through a video frame by frame but i have to press twice on it to work
35 messages ยท Page 1 of 1 (latest)
@hollow plume
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Hey @hollow plume!
It looks like you're trying to paste code into this channel.
Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.
To do this, use the following method:
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
You can **edit your original message** to correct your code block.
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
Can you put it in a pastebin so I can see it all at once?
Yes
So you need to press the buttons twice to get it to go to the previous or next frame?
is it just the frames or does the play/pause have the same issue?
Just the frames pause button works fine
okay, so it's probably either an off-by-one error or needing cv2 to re-render. Let me dig into it a bit
Appreciate
do you have your code that initializes your video class? Mostly asking to speed up my testing
Of course let me send you the remaining
@hollow plume Do you have the Controller code? Just missing that bit to the get the initialization correct
Forgot about it
@hollow plume I'm not getting the behavior you're describing. I can press it once and it'll change frames. What OS are you on?
Windows 11
Hmmm, I'm on Win10. But the changing frames is working just fine with one button press
Damn
While we're at it how can i make such a messagebox ? Tkinter messagebox doesn't work
An exit dialog
Your exit dialog works for me
or do you mean when you try to "X" out of it instead of through the menu?
Yes through the X
You need specifically this under Application:
class Application(tk.Tk):
def __init__(self):
... #all of your code
self.protocol("WM_DELETE_WINDOW", self.on_closing)
def on_closing(self):
if messagebox.askokcancel("Quit", "Do you want to quit?"):
self.destroy()
It's a bit finnicky but you need that base tk.Tk instance to bind a message box function to the WM_DELETE_WINDOW event
Thanks
Is there any way to customize the buttons in tk.messagebox.askyesnocancel ?
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.