Exemple #1
0
    def __init__(self, uri=None):
        GObject.Object.__init__(self)
        LogObject.__init__(self)
        self._file = None
        self._name = "Untitled"
        self._mime_type = "text/plain"
        self._icon_name = Gtk.STOCK_FILE
        self._encoding = "UTF-8"
        self._cancellable = Gio.Cancellable()
        self._language = None
        self._state = Document.STATE_NORMAL

        if uri:
            self.set_file_from_uri(uri)
Exemple #2
0
 def __init__(self, uri=None):
     GObject.Object.__init__(self)
     LogObject.__init__(self)
     self._file = None
     self._name = "Untitled"
     self._mime_type = "text/plain"
     self._icon_name = Gtk.STOCK_FILE
     self._encoding = "UTF-8"
     self._cancellable = Gio.Cancellable()
     self._language = None
     self._state = Document.STATE_NORMAL
     
     if uri:
         self.set_file_from_uri(uri)
Exemple #3
0
    def __init__(self):
        LogObject.__init__(self)
        Gtk.Paned.__init__(self)
        self._tabs = []
        self._split_view = False
        self._active_document = None

        # user configuration
        self._font = "Monospace 10"
        self._view_props = {
            "auto-indent": False,
            "draw-spaces": 0,
            "highlight-current-line": False,
            "indent-on-tab": True,
            "insert-spaces-instead-of-tabs": True,
            "show-right-margin": True,
            "right-margin-position": 80,
            "show-line-numbers": True,
            "tab-width": 4,
            "smart-home-end": 0,
        }
        self._buffer_props = {"highlight-syntax": True}
        self._show_line_numbers = True
        self._show_right_margin = True
        self._right_margin_position = 80
        self._tab_width = 4
        self._insert_spaces_instead_of_tabs = True
        self._highlight_current_line = True

        # primary notebook
        self._notebook1 = self._create_notebook()
        self.add1(self._notebook1)

        # secondary notebook
        self._notebook2 = self._create_notebook()
        self._notebook2.hide()
        self.add2(self._notebook2)