def __init__(self, parent_mode, title, width_req=0, height_req=0, align=ALIGN.DEFAULT, close_cb=None, additional_formatting=True, immediate_action=False): Popup.__init__(self, parent_mode, title, width_req=width_req, height_req=height_req, align=align, close_cb=close_cb) self.inputs = [] self.lines = [] self.current_input = 0 self.additional_formatting = additional_formatting self.immediate_action = immediate_action #We need to replicate some things in order to wrap our inputs self.encoding = parent_mode.encoding
def __init__(self, view): Popup.__init__(self) self.set_size_request(WIDTH, HEIGHT) self.__view = view sw = gtk.ScrolledWindow() self.add(sw) sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.__tree_model = gtk.ListStore(str, str, object) self.__tree = gtk.TreeView(self.__tree_model) self.__tree.set_headers_visible(False) self.__tree.get_selection().connect('changed', self.__on_selection_changed) cell = gtk.CellRendererText() column = gtk.TreeViewColumn(None, cell, text=0) self.__tree.append_column(column) sw.add(self.__tree) sw.show_all() self.set_default_size(WIDTH, HEIGHT) # A small amount of background shows between the scrollbar and the list; # which looks ugly if it is the only gray thing in the window, so change # the window background to white self.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(65535, 65535, 65535)) self.__doc_popup= DocPopup(fixed_width=True, fixed_height=True, max_height=HEIGHT, can_focus=False) self._in_change = False self.showing = False
def __init__(self, parent_mode, title, width_req=-1, height_req=-1, close_cb=None): Popup.__init__(self, parent_mode, title, width_req, height_req, close_cb) self.inputs = [] self.spaces = [] self.current_input = 0
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,parent_mode,title,width_req=0,height_req=0, align=ALIGN.DEFAULT, close_cb=None, additional_formatting=True, immediate_action=False): Popup.__init__(self,parent_mode,title, width_req=width_req, height_req=height_req, align=align, close_cb=close_cb) self.inputs = [] self.lines = [] self.current_input = 0 self.additional_formatting = additional_formatting self.immediate_action = immediate_action #We need to replicate some things in order to wrap our inputs self.encoding = parent_mode.encoding
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.__font = pango.FontDescription("Sans 9") 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.__view.modify_text(gtk.STATE_NORMAL, gtk.gdk.Color(0, 0, 0)) self.__view.modify_font(self.__font) self.__view.set_parent(self) self.__view.show() self.__view.grab_focus() self.__scrollbar = gtk.VScrollbar() self.__scrollbar.set_parent(self) self.__scrollbar.show() self.__view.emit('set-scroll-adjustments', None, self.__scrollbar.get_adjustment()) 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
def __init__(self, view): Popup.__init__(self) self.set_size_request(WIDTH, HEIGHT) self.__view = view sw = gtk.ScrolledWindow() self.add(sw) sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.__tree_model = gtk.ListStore(str, str, object) self.__tree = gtk.TreeView(self.__tree_model) self.__tree.set_headers_visible(False) self.__tree.get_selection().connect('changed', self.__on_selection_changed) self.__tree.connect('row-activated', self.__on_row_activated) cell = gtk.CellRendererText() column = gtk.TreeViewColumn(None, cell, text=0) self.__tree.append_column(column) sw.add(self.__tree) sw.show_all() self.set_default_size(WIDTH, HEIGHT) # A small amount of background shows between the scrollbar and the list; # which looks ugly if it is the only gray thing in the window, so change # the window background to white self.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(65535, 65535, 65535)) self.__doc_popup= DocPopup(fixed_width=True, fixed_height=True, max_height=HEIGHT, can_focus=False) self._in_change = False self.spontaneous = False self.showing = False self.connect('destroy', self.on_destroy)
def __init__(self,parent_mode,title,width_req=-1,height_req=-1,close_cb=None): Popup.__init__(self,parent_mode,title,width_req,height_req,close_cb) self.inputs = [] self.spaces = [] self.current_input = 0