def __init__(self): WindowBuilder.__init__(self, "preferences") self.dialog.connect("response", self.__on_response) self.dialog.connect("delete-event", self.__on_delete_event) global_settings.watch("editor-font-is-custom", self.__on_notify_editor_font_is_custom) self.__on_notify_editor_font_is_custom() self.editor_font_custom_check_button.connect("toggled", self.__on_editor_font_custom_check_button_toggled) self.__on_editor_font_custom_check_button_toggled() global_settings.watch("editor-font-name", self.__on_notify_editor_font_name) self.__on_notify_editor_font_name() self.editor_font_button.connect("font-set", self.__on_editor_font_set) global_settings.watch("doc-tooltip-font-is-custom", self.__on_notify_doc_tooltip_font_is_custom) self.__on_notify_doc_tooltip_font_is_custom() self.doc_tooltip_font_custom_check_button.connect( "toggled", self.__on_doc_tooltip_font_custom_check_button_toggled ) self.__on_doc_tooltip_font_custom_check_button_toggled() global_settings.watch("doc-tooltip-font-name", self.__on_notify_doc_tooltip_font_name) self.__on_notify_doc_tooltip_font_name() self.doc_tooltip_font_button.connect("font-set", self.__on_doc_tooltip_font_set) global_settings.watch("autocomplete", self.__on_notify_autocomplete) self.__on_notify_autocomplete() self.autocomplete_check_button.connect("toggled", self.__on_autocomplete_check_button_toggled)
def __init__(self, notebook): Editor.__init__(self, notebook) self.buf = ShellBuffer(self.notebook) self.view = ShellView(self.buf) self.config_state = None self.view.connect('notify::sidebar-open', self.on_notify_sidebar_open) global_settings.watch('editor-font-is-custom', self.__update_font) global_settings.watch('editor-font-name', self.__update_font) self.__update_font() self.widget = ViewSidebarLayout() self.widget.set_view(self.view) self.widget.set_sidebar(self.view.sidebar) self.widget.set_sidebar_open(self.view.sidebar_open) self.widget.connect('notify::sidebar-width', self.on_notify_sidebar_width) self.widget.show_all() self.buf.worksheet.sig_filename_changed.connect( lambda *args: self._update_filename() ) self.buf.worksheet.sig_file.connect( lambda *args: self._update_file() ) self.buf.worksheet.sig_code_modified.connect( lambda *args: self._update_modified() ) self.buf.worksheet.sig_state.connect( lambda *args: self._update_state() )
def __init__(self, notebook): Editor.__init__(self, notebook) self.buf = ShellBuffer(self.notebook) self.view = ShellView(self.buf) self.config_state = None self.view.connect('notify::sidebar-open', self.on_notify_sidebar_open) global_settings.watch('editor-font-is-custom', self.__update_font) global_settings.watch('editor-font-name', self.__update_font) self.__update_font() self.widget = ViewSidebarLayout() self.widget.set_view(self.view) self.widget.set_sidebar(self.view.sidebar) self.widget.set_sidebar_open(self.view.sidebar_open) self.widget.connect('notify::sidebar-width', self.on_notify_sidebar_width) self.widget.show_all() self.buf.worksheet.sig_filename_changed.connect( lambda *args: self._update_filename()) self.buf.worksheet.sig_file.connect(lambda *args: self._update_file()) self.buf.worksheet.sig_code_modified.connect( lambda *args: self._update_modified()) self.buf.worksheet.sig_state.connect( lambda *args: self._update_state())
def __init__(self, fixed_height=False, fixed_width=False, max_height=MAX_HEIGHT, can_focus=True): Popup.__init__(self) self.__fixed_height = fixed_height self.__fixed_width = fixed_width self.__max_height = max_height self.__can_focus = can_focus self.__view = gtk.TextView() self.__view.set_editable(False) bg_color = gtk.gdk.Color(0xffff, 0xffff, 0xbfbf) self.__view.modify_base(gtk.STATE_NORMAL, bg_color) self.modify_bg(gtk.STATE_NORMAL, bg_color) self.set_app_paintable(True) self.__view.modify_text(gtk.STATE_NORMAL, gtk.gdk.Color(0, 0, 0)) self.__view.set_parent(self) self.__view.show() self.__view.grab_focus() global_settings.watch('doc-tooltip-font-is-custom', self.__update_font) global_settings.watch('doc-tooltip-font-name', self.__update_font) self.__update_font() self.__scrollbar = gtk.VScrollbar() self.__scrollbar.set_parent(self) self.__scrollbar.show() self.__view.emit('set-scroll-adjustments', None, self.__scrollbar.get_adjustment()) self.__view.connect('scroll-event', self.on_scroll_event) self.__vscrolled = False self.set_resizable(False) buf = self.__view.get_buffer() self.__bold_tag = buf.create_tag(None, weight=pango.WEIGHT_BOLD) self.__heading_type_tag = buf.create_tag(None, weight=pango.WEIGHT_BOLD, pixels_below_lines=5) self.__inline_type_tag = self.__bold_tag self.__value_tag = buf.create_tag(None, family="monospace") self.__target = None self.focused = False self.connect('destroy', self.on_destroy)
def __init__(self, notebook): Editor.__init__(self, notebook) self.buf = ShellBuffer(self.notebook, edit_only=True) self.view = ShellView(self.buf) self.__font_is_custom_connection = global_settings.watch('editor-font-is-custom', self.__update_font) self.__font_name_connection = global_settings.watch('editor-font-name', self.__update_font) self.__update_font() self.widget = gtk.ScrolledWindow() self.widget.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.widget.add(self.view) self.widget.show_all() self.buf.worksheet.sig_filename_changed.connect( lambda *args: self._update_filename() ) self.buf.worksheet.sig_file.connect(lambda *args: self._update_file()) self.buf.worksheet.sig_code_modified.connect(lambda *args: self._update_modified())
def __init__(self): WindowBuilder.__init__(self, 'preferences') self.dialog.connect('response', self.__on_response) self.dialog.connect('delete-event', self.__on_delete_event) global_settings.watch('editor-font-is-custom', self.__on_notify_editor_font_is_custom) self.__on_notify_editor_font_is_custom() self.editor_font_custom_check_button.connect( 'toggled', self.__on_editor_font_custom_check_button_toggled) self.__on_editor_font_custom_check_button_toggled() global_settings.watch('editor-font-name', self.__on_notify_editor_font_name) self.__on_notify_editor_font_name() self.editor_font_button.connect('font-set', self.__on_editor_font_set) global_settings.watch('doc-tooltip-font-is-custom', self.__on_notify_doc_tooltip_font_is_custom) self.__on_notify_doc_tooltip_font_is_custom() self.doc_tooltip_font_custom_check_button.connect( 'toggled', self.__on_doc_tooltip_font_custom_check_button_toggled) self.__on_doc_tooltip_font_custom_check_button_toggled() global_settings.watch('doc-tooltip-font-name', self.__on_notify_doc_tooltip_font_name) self.__on_notify_doc_tooltip_font_name() self.doc_tooltip_font_button.connect('font-set', self.__on_doc_tooltip_font_set) global_settings.watch('autocomplete', self.__on_notify_autocomplete) self.__on_notify_autocomplete() self.autocomplete_check_button.connect( 'toggled', self.__on_autocomplete_check_button_toggled)
def __init__(self, notebook): Editor.__init__(self, notebook) self.buf = ShellBuffer(self.notebook, edit_only=True) self.view = ShellView(self.buf) self.__font_is_custom_connection = global_settings.watch( 'editor-font-is-custom', self.__update_font) self.__font_name_connection = global_settings.watch( 'editor-font-name', self.__update_font) self.__update_font() self.widget = gtk.ScrolledWindow() self.widget.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.widget.add(self.view) self.widget.show_all() self.buf.worksheet.sig_filename_changed.connect( lambda *args: self._update_filename()) self.buf.worksheet.sig_file.connect(lambda *args: self._update_file()) self.buf.worksheet.sig_code_modified.connect( lambda *args: self._update_modified())