CustomTkinter icon indicating copy to clipboard operation
CustomTkinter copied to clipboard

CTkSlider bind <Button-1> <ButtonRelease-1> <Double-Button-1> possible?

Open onyx-and-iris opened this issue 3 years ago • 0 comments
trafficstars

Hello. I'm trying to create custom mouse1 event binds for a CTkSlider but it doesn't seem to be working. I'm simply trying to determine if I'm dragging a slider in the current moment or not.

        self.slider.bind("<Button-1>", partial(self.set_dragging, val=True))
        self.slider.bind("<ButtonRelease-1>", partial(self.set_dragging, val=False))

        ...

        def set_dragging(self, *args, val=False):
            self.slider_clicked= val
            if self.slider_clicked:
                print("clicked")
            else:
                print("unclicked")

I noticed the sliders already do respond to mouse clicks so does this mean I can't define my own mouse1 event as well?

I also wanted to set a mouse1 double click and that didn't work either, perhaps its related?

Any help or info would be greatly appreciated.

Thank you for your time.

onyx-and-iris avatar Jul 12 '22 01:07 onyx-and-iris