I have a canvas where I draw an image
that image contains a console text where I display the last 10 lines or something
I want to change the lines (array index) I display by catching mouse wheel events
there is no scroll bar so I don't have a huge image to scroll, I just redraw the text
here is how I try to setup the scroll function:
def drawConsole(self):
canvas = self.window["CONSOLE-CANVAS"]
canvas.TKCanvas.bind_all("<MouseWheel>", self.vscroll)
def vscroll(self,event):
print( -1 * (event.delta // 120) )
somewhere in my layout, there is a canvas:
[sg.Canvas(size=(1400, 300), background_color='black', key="CONSOLE-CANVAS")],
the vscroll function is never triggered
thanks for helping me on this
[edit : just found out return_keyboard_events but how do I figure over which component I am ?]