# Path: pyDEA/core/gui_modules/custom_canvas_gui.py
# class StyledCanvas(Canvas):
#     ''' Implements Canvas object with a custom background colour.
# 
#         Args:
#             parent (Tk object): parent of this widget.
#     '''
#     def __init__(self, parent, *args, **kw):
#         super().__init__(parent, *args, **kw)
#         self.configure(background=bg_color)
# 
# Path: pyDEA/core/utils/dea_utils.py
# def on_canvas_resize(canvas):
#     ''' This function updates scroll region of the canvas.
#         It should be called on canvas resize.
# 
#         Args:
#             canvas (Canvas): canvas
#     '''
#     canvas.update_idletasks()
#     yscroll = 0
#     xscroll = 0
#     if canvas.bbox(ALL)[2] > canvas.winfo_width():
#         yscroll = canvas.bbox(ALL)[2]
#     if canvas.bbox(ALL)[3] > canvas.winfo_height():
#         xscroll = canvas.bbox(ALL)[3]
#     canvas['scrollregion'] = (0, 0, yscroll, xscroll)


from tkinter import VERTICAL, Y, RIGHT, LEFT, BOTH, N, W
from tkinter.ttk import Frame, Scrollbar
from pyDEA.core.gui_modules.custom_canvas_gui import StyledCanvas
from pyDEA.core.utils.dea_utils import on_canvas_resize
import platform
                    active_scrollbar_on_mouse_wheel.onMouseWheel)

        for scrollbar in (xscrollbar, yscrollbar):
            if scrollbar:
                scrollbar.bind(
                    '<Enter>', lambda event,
                    scrollbar=scrollbar: self.mouseWheel_bind(scrollbar))
                scrollbar.bind('<Leave>',
                               lambda event: self.mouseWheel_unbind())


class VerticalScrolledFrame(Frame):
        ''' A pure Tkinter scrollable frame that actually works!
            Use the 'interior' attribute to place widgets inside the scrollable
            frame Construct and pack/place/grid normally
            This frame only allows vertical scrolling.

            Attributes:
                canvas (StyledCanvas): canvas.
                interior (frame): frame where all widgets are palced.

            Args:
                parent (Tk object): parent of this widget.
        '''
        def __init__(self, parent, *args, **kw):
            Frame.__init__(self, parent, *args, **kw)

            # create a canvas object and a vertical scrollbar for scrolling it
            vscrollbar = Scrollbar(self, orient=VERTICAL)
            vscrollbar.pack(fill=Y, side=RIGHT, expand=False)

# Path: pyDEA/core/gui_modules/custom_canvas_gui.py
# class StyledCanvas(Canvas):
#     ''' Implements Canvas object with a custom background colour.
# 
#         Args:
#             parent (Tk object): parent of this widget.
#     '''
#     def __init__(self, parent, *args, **kw):
#         super().__init__(parent, *args, **kw)
#         self.configure(background=bg_color)
# 
# Path: pyDEA/core/utils/dea_utils.py
# def on_canvas_resize(canvas):
#     ''' This function updates scroll region of the canvas.
#         It should be called on canvas resize.
# 
#         Args:
#             canvas (Canvas): canvas
#     '''
#     canvas.update_idletasks()
#     yscroll = 0
#     xscroll = 0
#     if canvas.bbox(ALL)[2] > canvas.winfo_width():
#         yscroll = canvas.bbox(ALL)[2]
#     if canvas.bbox(ALL)[3] > canvas.winfo_height():
#         xscroll = canvas.bbox(ALL)[3]
#     canvas['scrollregion'] = (0, 0, yscroll, xscroll)


# Path: pyDEA/core/gui_modules/scrollable_frame_gui.py
from tkinter import VERTICAL, Y, RIGHT, LEFT, BOTH, N, W
from tkinter.ttk import Frame, Scrollbar
from pyDEA.core.gui_modules.custom_canvas_gui import StyledCanvas
from pyDEA.core.utils.dea_utils import on_canvas_resize
import platform

                    active_scrollbar_on_mouse_wheel.onMouseWheel)

        for scrollbar in (xscrollbar, yscrollbar):
            if scrollbar:
                scrollbar.bind(
                    '<Enter>', lambda event,
                    scrollbar=scrollbar: self.mouseWheel_bind(scrollbar))
                scrollbar.bind('<Leave>',
                               lambda event: self.mouseWheel_unbind())


class VerticalScrolledFrame(Frame):
        ''' A pure Tkinter scrollable frame that actually works!
            Use the 'interior' attribute to place widgets inside the scrollable
            frame Construct and pack/place/grid normally
            This frame only allows vertical scrolling.

            Attributes:
                canvas (StyledCanvas): canvas.
                interior (frame): frame where all widgets are palced.

            Args:
                parent (Tk object): parent of this widget.
        '''
        def __init__(self, parent, *args, **kw):
            Frame.__init__(self, parent, *args, **kw)

            # create a canvas object and a vertical scrollbar for scrolling it
            vscrollbar = Scrollbar(self, orient=VERTICAL)
            vscrollbar.pack(fill=Y, side=RIGHT, expand=False)

            self.canvas = canvas = StyledCanvas(