57 lines
1.1 KiB
Python
57 lines
1.1 KiB
Python
|
# Python imports
|
||
|
|
||
|
# Lib imports
|
||
|
import gi
|
||
|
gi.require_version('Gtk', '3.0')
|
||
|
|
||
|
from gi.repository import Gtk
|
||
|
|
||
|
# Application imports
|
||
|
from widgets.button_box import ButtonBox
|
||
|
from widgets.draw_area import DrawArea
|
||
|
|
||
|
|
||
|
class ScrollWindow(Gtk.ScrolledWindow):
|
||
|
def __init__(self):
|
||
|
super(ScrollWindow, self).__init__()
|
||
|
|
||
|
self._setup_styling()
|
||
|
self._setup_signals()
|
||
|
self._load_widgets()
|
||
|
|
||
|
self.show_all()
|
||
|
|
||
|
|
||
|
def _setup_styling(self):
|
||
|
self.set_hexpand(True)
|
||
|
self.set_vexpand(True)
|
||
|
|
||
|
def _setup_signals(self):
|
||
|
...
|
||
|
|
||
|
def _load_widgets(self):
|
||
|
view_port = Gtk.Viewport()
|
||
|
|
||
|
view_port.add( DrawArea() )
|
||
|
self.add(view_port)
|
||
|
|
||
|
class Container(Gtk.Box):
|
||
|
def __init__(self):
|
||
|
super(Container, self).__init__()
|
||
|
|
||
|
self._setup_styling()
|
||
|
self._setup_signals()
|
||
|
self._load_widgets()
|
||
|
|
||
|
self.show()
|
||
|
|
||
|
|
||
|
def _setup_styling(self):
|
||
|
self.set_orientation(Gtk.Orientation.VERTICAL)
|
||
|
|
||
|
def _setup_signals(self):
|
||
|
...
|
||
|
|
||
|
def _load_widgets(self):
|
||
|
self.add( ButtonBox() )
|
||
|
self.add( ScrollWindow() )
|