How to use the pygubu.ApplicationLevelBindManager.init_mousewheel_binding function in pygubu

To help you get started, we’ve selected a few pygubu examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alejandroautalan / pygubu / pygubu / widgets / tkscrollbarhelper.py View on Github external
def _configure_mousewheel(self):
            cwidget = self.cwidget
            if self.usemousewheel:
                BindManager.init_mousewheel_binding(self)

                if self.hsb and not hasattr(self.hsb, 'on_mousewheel'):
                    self.hsb.on_mousewheel = BindManager.make_onmousewheel_cb(cwidget, 'x', 2)
                if self.vsb and not hasattr(self.vsb, 'on_mousewheel'):
                    self.vsb.on_mousewheel = BindManager.make_onmousewheel_cb(cwidget, 'y', 2)

                main_sb = self.vsb or self.hsb
                if main_sb:
                    cwidget.on_mousewheel = main_sb.on_mousewheel
                    bid = cwidget.bind('',
                                       lambda event: BindManager.mousewheel_bind(cwidget),
                                       add='+')
                    self._bindingids.append((cwidget, bid))
                    bid = cwidget.bind('',
                                       lambda event: BindManager.mousewheel_unbind(),
                                       add='+')
github alejandroautalan / pygubu / pygubu / widgets / tkscrolledframe.py View on Github external
def _configure_mousewheel(self):
            if self.usemousewheel:
                BindManager.init_mousewheel_binding(self)

                if self.hsb and not hasattr(self.hsb, 'on_mousewheel'):
                    self.hsb.on_mousewheel = BindManager.make_onmousewheel_cb(self, 'x', 2)
                if self.vsb and not hasattr(self.vsb, 'on_mousewheel'):
                    self.vsb.on_mousewheel = BindManager.make_onmousewheel_cb(self, 'y', 2)

                main_sb = self.vsb or self.hsb
                if main_sb:
                    self.on_mousewheel = main_sb.on_mousewheel
                    bid = self.bind('',
                                    lambda event: BindManager.mousewheel_bind(self),
                                    add='+')
                    self._bindingids.append((self, bid))
                    bid = self.bind('',
                                    lambda event: BindManager.mousewheel_unbind(),
                                    add='+')