# Path: kano/gtk3/scrolled_window.py
# class ScrolledWindow(Gtk.ScrolledWindow):
#     NORMAL_CSS_PATH = os.path.join(common_css_dir, 'scrollbar.css')
#     WIDE_CSS_PATH = os.path.join(common_css_dir, 'scrollbar-wide.css')
# 
#     def __init__(self, hexpand=None, vexpand=None, wide_scrollbar=False):
#         Gtk.ScrolledWindow.__init__(self, hexpand=hexpand, vexpand=vexpand)
#         self.set_overlay_scrolling(False)
# 
#     @staticmethod
#     def apply_styling_to_screen(wide=False):
#         if wide:
#             apply_styling_to_screen(ScrolledWindow.WIDE_CSS_PATH)
#         else:
#             apply_styling_to_screen(ScrolledWindow.NORMAL_CSS_PATH)
# 
#     def apply_styling_to_widget(self, wide=False):
#         for bar in [self.get_vscrollbar(), self.get_hscrollbar()]:
#             apply_colours_to_widget(bar)
#             if wide:
#                 apply_styling_to_widget(bar, self.WIDE_CSS_PATH)
#             else:
#                 apply_styling_to_widget(bar, self.NORMAL_CSS_PATH)
# 
# Path: kano/gtk3/apply_styles.py
# def apply_styling_to_screen(css_file, priority="USER"):
#     css = Gtk.CssProvider()
# 
#     if not os.path.exists(css_file):
#         sys.exit(css_file + ' CSS file missing!')
# 
#     css.load_from_path(css_file)
# 
#     screen = Gdk.Screen.get_default()
#     styleContext = Gtk.StyleContext()
# 
#     if priority == "FALLBACK":
#         gtk_priority = Gtk.STYLE_PROVIDER_PRIORITY_FALLBACK
#     elif priority == "THEME":
#         gtk_priority = Gtk.STYLE_PROVIDER_PRIORITY_THEME
#     elif priority == "SETTINGS":
#         gtk_priority = Gtk.STYLE_PROVIDER_PRIORITY_SETTINGS
#     elif priority == "APPLICATION":
#         gtk_priority = Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
#     elif priority == "USER":
#         gtk_priority = Gtk.STYLE_PROVIDER_PRIORITY_USER
# 
#     styleContext.add_provider_for_screen(screen, css, gtk_priority)
# 
# Path: kano/paths.py
# DNS_FILE = '/etc/resolvconf/resolv.conf.d/base'
# DNS_INTERFACES_FILE = '/etc/resolvconf/interface-order'
# DNS_INTERFACES_BACKUP_FILE = '/etc/resolvconf/interface-order.backup'
# SUPPLICANT_LOGFILE = '/var/log/kano_wpa.log'
# SUPPLICANT_CONFIG = '/etc/wpa_supplicant/wpa_supplicant.conf'
# INTERNET_UP_FILE = '/var/run/internet_monitor'
# KANO_CONNECT_PIDFILE = '/var/run/kano-connect.pid'


import os
from gi import require_version
from gi.repository import Gtk, GObject
from kano.gtk3.scrolled_window import ScrolledWindow
from kano.gtk3.apply_styles import apply_styling_to_screen
from kano.paths import common_css_dir
            self, location, new_text, new_length
        )
        return False


class MultilineEntry(Gtk.EventBox):
    __gsignals__ = {
        'changed': (GObject.SIGNAL_RUN_LAST, None, (KanoTextBuffer,)),
    }

    def __init__(self, border_width=2):
        Gtk.EventBox.__init__(self)

        # Very hacky way to get a border (gg GTK): create a grey event box
        # which is a little bigger than the white event box containing the
        # widget
        apply_styling_to_screen(
            os.path.join(common_css_dir, 'multiline_entry.css')
        )
        self.get_style_context().add_class('gray-box')
        widget_box = Gtk.EventBox()
        widget_box.get_style_context().add_class('white-box')
        widget_box.set_margin_left(border_width)    # gray border width (px)
        widget_box.set_margin_right(border_width)
        widget_box.set_margin_top(border_width)
        widget_box.set_margin_bottom(border_width)
        self.add(widget_box)

        # putting the TextView into a ScrolledWindow so it doesn't resize
        # horiz & vert

# Path: kano/gtk3/scrolled_window.py
# class ScrolledWindow(Gtk.ScrolledWindow):
#     NORMAL_CSS_PATH = os.path.join(common_css_dir, 'scrollbar.css')
#     WIDE_CSS_PATH = os.path.join(common_css_dir, 'scrollbar-wide.css')
# 
#     def __init__(self, hexpand=None, vexpand=None, wide_scrollbar=False):
#         Gtk.ScrolledWindow.__init__(self, hexpand=hexpand, vexpand=vexpand)
#         self.set_overlay_scrolling(False)
# 
#     @staticmethod
#     def apply_styling_to_screen(wide=False):
#         if wide:
#             apply_styling_to_screen(ScrolledWindow.WIDE_CSS_PATH)
#         else:
#             apply_styling_to_screen(ScrolledWindow.NORMAL_CSS_PATH)
# 
#     def apply_styling_to_widget(self, wide=False):
#         for bar in [self.get_vscrollbar(), self.get_hscrollbar()]:
#             apply_colours_to_widget(bar)
#             if wide:
#                 apply_styling_to_widget(bar, self.WIDE_CSS_PATH)
#             else:
#                 apply_styling_to_widget(bar, self.NORMAL_CSS_PATH)
# 
# Path: kano/gtk3/apply_styles.py
# def apply_styling_to_screen(css_file, priority="USER"):
#     css = Gtk.CssProvider()
# 
#     if not os.path.exists(css_file):
#         sys.exit(css_file + ' CSS file missing!')
# 
#     css.load_from_path(css_file)
# 
#     screen = Gdk.Screen.get_default()
#     styleContext = Gtk.StyleContext()
# 
#     if priority == "FALLBACK":
#         gtk_priority = Gtk.STYLE_PROVIDER_PRIORITY_FALLBACK
#     elif priority == "THEME":
#         gtk_priority = Gtk.STYLE_PROVIDER_PRIORITY_THEME
#     elif priority == "SETTINGS":
#         gtk_priority = Gtk.STYLE_PROVIDER_PRIORITY_SETTINGS
#     elif priority == "APPLICATION":
#         gtk_priority = Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
#     elif priority == "USER":
#         gtk_priority = Gtk.STYLE_PROVIDER_PRIORITY_USER
# 
#     styleContext.add_provider_for_screen(screen, css, gtk_priority)
# 
# Path: kano/paths.py
# DNS_FILE = '/etc/resolvconf/resolv.conf.d/base'
# DNS_INTERFACES_FILE = '/etc/resolvconf/interface-order'
# DNS_INTERFACES_BACKUP_FILE = '/etc/resolvconf/interface-order.backup'
# SUPPLICANT_LOGFILE = '/var/log/kano_wpa.log'
# SUPPLICANT_CONFIG = '/etc/wpa_supplicant/wpa_supplicant.conf'
# INTERNET_UP_FILE = '/var/run/internet_monitor'
# KANO_CONNECT_PIDFILE = '/var/run/kano-connect.pid'


# Path: kano/gtk3/multiline_entry.py
import os
from gi import require_version
from gi.repository import Gtk, GObject
from kano.gtk3.scrolled_window import ScrolledWindow
from kano.gtk3.apply_styles import apply_styling_to_screen
from kano.paths import common_css_dir

            self, location, new_text, new_length
        )
        return False


class MultilineEntry(Gtk.EventBox):
    __gsignals__ = {
        'changed': (GObject.SIGNAL_RUN_LAST, None, (KanoTextBuffer,)),
    }

    def __init__(self, border_width=2):
        Gtk.EventBox.__init__(self)

        # Very hacky way to get a border (gg GTK): create a grey event box
        # which is a little bigger than the white event box containing the
        # widget
        apply_styling_to_screen(
            os.path.join(common_css_dir, 'multiline_entry.css')
        )
        self.get_style_context().add_class('gray-box')
        widget_box = Gtk.EventBox()
        widget_box.get_style_context().add_class('white-box')
        widget_box.set_margin_left(border_width)    # gray border width (px)
        widget_box.set_margin_right(border_width)
        widget_box.set_margin_top(border_width)
        widget_box.set_margin_bottom(border_width)
        self.add(widget_box)

        # putting the TextView into a ScrolledWindow so it doesn't resize
        # horiz & vert

        scrolled_window = ScrolledWindow()