def __init__( self ): gtk.VBox.__init__( self ) self.editingMinMaxRange = False self.minMaxRangeLocked = False self.onValueChangedCallback = None gtk.widget_push_composite_child() builder = gtk.Builder() scriptPath = os.path.dirname( __file__ ) builder.add_from_file( scriptPath + "/glade/MinMaxSlider.glade" ) window = builder.get_object( "winContainer" ) hboxWidget = builder.get_object( "hboxWidget" ) self.tbxMin = builder.get_object( "tbxMin" ) self.tbxMax = builder.get_object( "tbxMax" ) self.sliderValue = builder.get_object( "sliderValue" ) self.adjValue = builder.get_object( "adjValue" ) self.checkTicked = builder.get_object( "checkTicked" ) window.remove( hboxWidget ) self.pack_start( hboxWidget ) builder.connect_signals( self ) gtk.widget_pop_composite_child() # Setup with default values self.setMinAndMaxValues( 0.0, 0.0 )
def __init__(self): gtk.VBox.__init__(self) self.filter = None self.startingFolder = None self.frameIdx = 0 self.numFrames = 1 self.onFrameIdxChangedCallback = None gtk.widget_push_composite_child() builder = gtk.Builder() scriptPath = os.path.dirname(__file__) builder.add_from_file(scriptPath + "/glade/SequenceControl.glade") window = builder.get_object("winContainer") hboxWidget = builder.get_object("hboxWidget") self.tbxFrameNumber = builder.get_object("tbxFrameNumber") self.lblNumFrames = builder.get_object("lblNumFrames") self.lblNumFrames.set_text("/" + str(self.numFrames)) window.remove(hboxWidget) self.pack_start(hboxWidget) builder.connect_signals(self) gtk.widget_pop_composite_child()
def __init__(self, win, editor=None): gtksourceview2.View.__init__(self) gtk.widget_push_composite_child() self.editor = editor self.buffer = gtksourceview2.Buffer() self.set_buffer(self.buffer) self.set_show_line_marks(True) width, height = gtk.icon_size_lookup(gtk.ICON_SIZE_MENU) pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, True, 8, width, height) pixbuf.fill(0) self.set_mark_category_pixbuf('sql-start', pixbuf) self.set_mark_category_pixbuf('sql-end', pixbuf) lang_manager = gtksourceview2.language_manager_get_default() self.buffer.set_language(lang_manager.get_language('sql')) self.app = win.app self._sig_app_config_changed = self.app.config.connect( 'changed', self.on_config_changed) self.update_textview_options() self._buffer_changed_cb = None self.buffer.connect('end-user-action', self.on_buffer_changed) self.buffer.connect('mark-set', self.on_mark_set) if self.editor is not None: self.editor.connect( 'connection-changed', lambda e, c: self.on_buffer_changed(self.buffer)) self.connect('expose-event', self.on_expose) self._sql_marks = set() self.connect('destroy', self.on_destroy)
def __init__(self, win, editor=None): gtksourceview2.View.__init__(self) gtk.widget_push_composite_child() self.editor = editor self.buffer = gtksourceview2.Buffer() self.set_buffer(self.buffer) self.set_show_line_marks(True) width, height = gtk.icon_size_lookup(gtk.ICON_SIZE_MENU) pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, True, 8, width, height) pixbuf.fill(0) self.set_mark_category_pixbuf('sql-start', pixbuf) self.set_mark_category_pixbuf('sql-end', pixbuf) lang_manager = gtksourceview2.language_manager_get_default() self.buffer.set_language(lang_manager.get_language('sql')) self.app = win.app self._sig_app_config_changed = self.app.config.connect( 'changed', self.on_config_changed) self.update_textview_options() self._buffer_changed_cb = None self.buffer.connect('end-user-action', self.on_buffer_changed) self.buffer.connect('mark-set', self.on_mark_set) if self.editor is not None: self.editor.connect('connection-changed', lambda e, c: self.on_buffer_changed(self.buffer)) self.connect('expose-event', self.on_expose) self._sql_marks = set() self.connect('destroy', self.on_destroy)
def _insert_item(self, item, position=None, visible_position=None): assert isinstance(item, DockItem) assert self.item_num(item) is None if position is None or position < 0: position = len(self) # Create composite children for tab gtk.widget_push_composite_child() tab = _DockGroupTab() tab.image = item.get_image() tab.label = gtk.Label() tab.button = CompactButton(has_frame=False) tab.menu_item = gtk.ImageMenuItem() gtk.widget_pop_composite_child() # Configure child widgets for tab tab.item = item tab.item.set_parent(self) tab.item_title_handler = tab.item.connect('notify::title', self._on_item_title_changed, tab) tab.item_title_tooltip_text_handler = tab.item.connect( 'notify::title-tooltip-text', self._on_item_title_tooltip_text_changed, tab) tab.image.set_parent(self) tab.label.set_text(item.get_title()) tab.label.set_parent(self) tab.button.set_icon_name_normal('compact-close') tab.button.set_icon_name_prelight('compact-close-prelight') tab.button.set_parent(self) tab.button.connect('clicked', self._on_tab_button_clicked, item) tab.menu_item.set_image(item.get_image()) tab.menu_item.set_label(item.get_title()) tab.menu_item.connect('activate', self._on_list_menu_item_activated, tab) self._list_menu.append(tab.menu_item) tab.area = gdk.Rectangle() tab.last_focused = time() if self.flags() & gtk.REALIZED: tab.item.set_parent_window(self.window) tab.image.set_parent_window(self.window) tab.label.set_parent_window(self.window) tab.button.set_parent_window(self.window) self._tabs.insert(position, tab) self.emit('item-added', item) # TODO: get rid of this pronto! if visible_position is not None: self._visible_tabs.insert(visible_position, tab) item_num = self.item_num(item) self.set_current_item(item_num) return item_num
def _insert_item(self, item, position=None, visible_position=None): assert isinstance(item, DockItem) assert self.item_num(item) is None if position is None or position < 0: position = len(self) # Create composite children for tab gtk.widget_push_composite_child() tab = _DockGroupTab() tab.image = item.get_image() tab.label = gtk.Label() tab.button = CompactButton(has_frame=False) tab.menu_item = gtk.ImageMenuItem() gtk.widget_pop_composite_child() # Configure child widgets for tab tab.item = item tab.item.set_parent(self) tab.item_title_handler = tab.item.connect("notify::title", self._on_item_title_changed, tab) tab.item_title_tooltip_text_handler = tab.item.connect( "notify::title-tooltip-text", self._on_item_title_tooltip_text_changed, tab ) tab.image.set_parent(self) tab.label.set_text(item.get_title()) tab.label.set_parent(self) tab.button.set_icon_name_normal("compact-close") tab.button.set_icon_name_prelight("compact-close-prelight") tab.button.set_parent(self) tab.button.connect("clicked", self._on_tab_button_clicked, item) tab.menu_item.set_image(item.get_image()) tab.menu_item.set_label(item.get_title()) tab.menu_item.connect("activate", self._on_list_menu_item_activated, tab) self._list_menu.append(tab.menu_item) tab.area = gdk.Rectangle() tab.last_focused = time() if self.flags() & gtk.REALIZED: tab.item.set_parent_window(self.window) tab.image.set_parent_window(self.window) tab.label.set_parent_window(self.window) tab.button.set_parent_window(self.window) self._tabs.insert(position, tab) self.emit("item-added", item) # TODO: get rid of this pronto! if visible_position is not None: self._visible_tabs.insert(visible_position, tab) item_num = self.item_num(item) self.set_current_item(item_num) return item_num
def __init__(self, title=None): self.__title_text = None gtk.widget_push_composite_child() self.__title = gobject.new(gtk.Label, visible=True, xalign=0, yalign=0.5) self.__indent = gobject.new(gtk.Label, visible=True, label=' ') gtk.widget_pop_composite_child() gtk.Bin.__init__(self) self.__title.set_parent(self) self.__indent.set_parent(self) if title is not None: self.props.title = title
def __init__( self ): gtk.VBox.__init__( self ) self.filter = None self.startingFolder = None self.onFilenameChangedCallback = None gtk.widget_push_composite_child() builder = gtk.Builder() scriptPath = os.path.dirname( __file__ ) builder.add_from_file( scriptPath + "/glade/FilePath.glade" ) window = builder.get_object( "window1" ) topBox = builder.get_object( "topBox" ) self.tbxFile = builder.get_object( "tbxFile" ) window.remove( topBox ) self.pack_start( topBox ) builder.connect_signals( self ) gtk.widget_pop_composite_child()
def __init__(self): gtk.Container.__init__(self) # Initialize logging self.log = getLogger("%s.%s" % (self.__gtype_name__, hex(id(self)))) # Internal housekeeping self.set_border_width(2) self._frame_width = 1 self._spacing = 3 self._available_width = 0 self._decoration_area = gdk.Rectangle() self._tabs = [] self._visible_tabs = [] self._current_tab = None self._tab_state = gtk.STATE_SELECTED self.dragcontext = DockDragContext() gtk.widget_push_composite_child() self._list_button = CompactButton("compact-list") self._list_button.set_tooltip_text(_("Show list")) self._list_button.connect("clicked", self._on_list_button_clicked) self._list_button.set_parent(self) self._min_button = CompactButton("compact-minimize") self._min_button.set_tooltip_text(_("Minimize")) self._min_button.connect("clicked", self._on_min_button_clicked) self._min_button.set_parent(self) self._max_button = CompactButton("compact-maximize") self._max_button.set_tooltip_text(_("Maximize")) self._max_button.connect("clicked", self._on_max_button_clicked) self._max_button.set_parent(self) self._tab_menu = gtk.Menu() self._tab_menu.attach_to_widget(self, None) self._list_menu = gtk.Menu() self._list_menu.attach_to_widget(self._list_button, None) gtk.widget_pop_composite_child()
def __init__(self): gtk.Container.__init__(self) # Initialize logging self.log = getLogger('%s.%s' % (self.__gtype_name__, hex(id(self)))) # Internal housekeeping self.set_border_width(2) self._frame_width = 1 self._spacing = 3 self._available_width = 0 self._decoration_area = gdk.Rectangle() self._tabs = [] self._visible_tabs = [] self._current_tab = None self._tab_state = gtk.STATE_SELECTED self.dragcontext = DockDragContext() gtk.widget_push_composite_child() self._list_button = CompactButton('compact-list') self._list_button.set_tooltip_text(_('Show list')) self._list_button.connect('clicked', self._on_list_button_clicked) self._list_button.set_parent(self) self._min_button = CompactButton('compact-minimize') self._min_button.set_tooltip_text(_('Minimize')) self._min_button.connect('clicked', self._on_min_button_clicked) self._min_button.set_parent(self) self._max_button = CompactButton('compact-maximize') self._max_button.set_tooltip_text(_('Maximize')) self._max_button.connect('clicked', self._on_max_button_clicked) self._max_button.set_parent(self) self._tab_menu = gtk.Menu() self._tab_menu.attach_to_widget(self, None) self._list_menu = gtk.Menu() self._list_menu.attach_to_widget(self._list_button, None) gtk.widget_pop_composite_child()