Esempio n. 1
0
 def __init__(self):
     Widget.__init__(self)
     self.set_widget(gtk.VolumeButton())
     self.wrapped_widget_connect('value-changed', self.on_value_changed)
     self._widget.get_popup().connect("hide", self.on_hide)
     self.create_signal('changed')
     self.create_signal('released')
Esempio n. 2
0
 def __init__(self):
     Widget.__init__(self)
     self.set_widget(gtk.VolumeButton())
     self.wrapped_widget_connect('value-changed', self.on_value_changed)
     self._widget.get_popup().connect("hide", self.on_hide)
     self.create_signal('changed')
     self.create_signal('released')
Esempio n. 3
0
 def set_widget(self, drawing_widget):
     if self.is_opaque() and 0:
         box = gtk.EventBox()
         box.add(drawing_widget)
         Widget.set_widget(self, box)
     else:
         Widget.set_widget(self, drawing_widget)
     self.layout_manager = LayoutManager(self._widget)
Esempio n. 4
0
 def __init__(self, xalign=0, yalign=0, xscale=0, yscale=0,
         top_pad=0, bottom_pad=0, left_pad=0, right_pad=0):
     Widget.__init__(self)
     self.set_widget(gtk.Notebook())
     self._widget.set_tab_pos(gtk.POS_TOP)
     self.children = []
     self._page_to_select = None
     self.wrapped_widget_connect('realize', self._on_realize)
Esempio n. 5
0
 def __init__(self, xalign=0, yalign=0, xscale=0, yscale=0,
         top_pad=0, bottom_pad=0, left_pad=0, right_pad=0):
     Widget.__init__(self)
     self.set_widget(gtk.Notebook())
     self._widget.set_tab_pos(gtk.POS_TOP)
     self.children = []
     self._page_to_select = None
     self.wrapped_widget_connect('realize', self._on_realize)
Esempio n. 6
0
 def set_widget(self, drawing_widget):
     if self.is_opaque() and 0:
         box = gtk.EventBox()
         box.add(drawing_widget)
         Widget.set_widget(self, box)
     else:
         Widget.set_widget(self, drawing_widget)
     self.layout_manager = LayoutManager(self._widget)
Esempio n. 7
0
File: simple.py Progetto: k-nut/miro
 def __init__(self, path):
     Widget.__init__(self)
     self.set_widget(gtk.Image())
     self._animation = gtk.gdk.PixbufAnimation(path)
     # Set to animate before we are shown and stop animating after
     # we disappear.
     self._widget.connect("map", lambda w: self._set_animate(True))
     self._widget.connect("unmap-event", lambda w, a: self._set_animate(False))
Esempio n. 8
0
 def __init__(self, initial_text=None, border=False):
     Widget.__init__(self)
     self.set_widget(self.entry_class())
     if initial_text is not None:
         self.set_text(initial_text)
     self._widget.set_wrap_mode(gtk.WRAP_WORD)
     self._widget.set_accepts_tab(False)
     self.border = border
Esempio n. 9
0
 def __init__(self, initial_text=None, border=False):
     Widget.__init__(self)
     self.set_widget(self.entry_class())
     if initial_text is not None:
         self.set_text(initial_text)
     self._widget.set_wrap_mode(gtk.WRAP_WORD)
     self._widget.set_accepts_tab(False)
     self.border = border
Esempio n. 10
0
File: simple.py Progetto: kmshi/miro
 def __init__(self, text=""):
     Widget.__init__(self)
     self.set_widget(gtk.Label())
     self.wrapped_widget_connect('style-set', self.on_style_set)
     if text:
         self.set_text(text)
     self.attr_list = pango.AttrList()
     self.font_description = self._widget.style.font_desc.copy()
     self.scale_factor = 1.0
Esempio n. 11
0
 def __init__(self, text=""):
     Widget.__init__(self)
     self.set_widget(gtk.Label())
     self.wrapped_widget_connect('style-set', self.on_style_set)
     if text:
         self.set_text(text)
     self.attr_list = pango.AttrList()
     self.font_description = self._widget.style.font_desc.copy()
     self.scale_factor = 1.0
Esempio n. 12
0
 def __init__(self, path):
     Widget.__init__(self)
     self.set_widget(gtk.Image())
     self._animation = gtk.gdk.PixbufAnimation(path)
     # Set to animate before we are shown and stop animating after
     # we disappear.
     self._widget.connect('map', lambda w: self._set_animate(True))
     self._widget.connect('unmap-event',
                          lambda w, a: self._set_animate(False))
Esempio n. 13
0
 def __init__(self):
     """Create a new CustomButton.  active_image will be displayed while
     the button is pressed.  The image must have the same size.
     """
     Widget.__init__(self)
     Drawable.__init__(self)
     self.set_widget(CustomButtonWidget())
     self.create_signal('clicked')
     self.forward_signal('clicked')
Esempio n. 14
0
 def __init__(self, text, style='normal'):
     Widget.__init__(self)
     # We just ignore style here, GTK users expect their own buttons.
     self.set_widget(gtk.Button())
     self.create_signal('clicked')
     self.forward_signal('clicked')
     self.label = Label(text)
     self._widget.add(self.label._widget)
     self.label._widget.show()
Esempio n. 15
0
 def __init__(self, initial_text=None):
     Widget.__init__(self)
     self.create_signal('activate')
     self.create_signal('changed')
     self.create_signal('validate')
     self.set_widget(self.entry_class())
     self.forward_signal('activate')
     self.forward_signal('changed')
     if initial_text is not None:
         self.set_text(initial_text)
Esempio n. 16
0
 def __init__(self, initial_text=None):
     Widget.__init__(self)
     self.create_signal('activate')
     self.create_signal('changed')
     self.create_signal('validate')
     self.set_widget(self.entry_class())
     self.forward_signal('activate')
     self.forward_signal('changed')
     if initial_text is not None:
         self.set_text(initial_text)
Esempio n. 17
0
 def __init__(self):
     Widget.__init__(self)
     Drawable.__init__(self)
     self.create_signal('pressed')
     self.create_signal('released')
     self.create_signal('changed')
     self.create_signal('moved')
     if self.is_horizontal():
         self.set_widget(CustomHScaleWidget())
     else:
         self.set_widget(CustomVScaleWidget())
     self.wrapped_widget_connect('move-slider', self.on_slider_move)
Esempio n. 18
0
 def __init__(self, text=None, bold=False):
     Widget.__init__(self)
     BinBaselineCalculator.__init__(self)
     if text is None:
         text = ''
     self.set_widget(gtk.CheckButton())
     self.label = Label(text)
     self._widget.add(self.label._widget)
     self.label._widget.show()
     self.create_signal('toggled')
     self.forward_signal('toggled')
     if bold:
         self.label.set_bold(True)
Esempio n. 19
0
 def __init__(self, text=None, bold=False):
     Widget.__init__(self)
     BinBaselineCalculator.__init__(self)
     if text is None:
         text = ''
     self.set_widget(gtk.CheckButton())
     self.label = Label(text)
     self._widget.add(self.label._widget)
     self.label._widget.show()
     self.create_signal('toggled')
     self.forward_signal('toggled')
     if bold:
         self.label.set_bold(True)
Esempio n. 20
0
    def __init__(self, label, group=None):
        Widget.__init__(self)
        BinBaselineCalculator.__init__(self)
        if group:
            self.group = group
        else:
            self.group = RadioButtonGroup()

        self.set_widget(gtk.RadioButton(group=self.group._widget, label=label))
        self.create_signal('clicked')
        self.forward_signal('clicked')

        group.add_button(self)
Esempio n. 21
0
    def __init__(self, label, group=None):
        Widget.__init__(self)
        BinBaselineCalculator.__init__(self)
        if group:
            self.group = group
        else:
            self.group = RadioButtonGroup()

        self.set_widget(gtk.RadioButton(group=self.group._widget, label=label))
        self.create_signal('clicked')
        self.forward_signal('clicked')

        group.add_button(self)
Esempio n. 22
0
    def __init__(self, options):
        Widget.__init__(self)
        self.create_signal('changed')

        self.set_widget(gtk.ComboBox(gtk.ListStore(str, str)))
        self.cell = gtk.CellRendererText()
        self._widget.pack_start(self.cell, True)
        self._widget.add_attribute(self.cell, 'text', 0)
        if options:
            for option in options:
                self._widget.get_model().append((option, 'booya'))
            self._widget.set_active(0)
        self.options = options
        self.wrapped_widget_connect('changed', self.on_changed)
Esempio n. 23
0
    def __init__(self, options):
        Widget.__init__(self)
        self.create_signal('changed')

        self.set_widget(gtk.ComboBox(gtk.ListStore(str, str)))
        self.cell = gtk.CellRendererText()
        self._widget.pack_start(self.cell, True)
        self._widget.add_attribute(self.cell, 'text', 0)
        if options:
            for option in options:
                self._widget.get_model().append((option, 'booya'))
            self._widget.set_active(0)
        self.options = options
        self.wrapped_widget_connect('changed', self.on_changed)
Esempio n. 24
0
 def __init__(self):
     Widget.__init__(self)
     Drawable.__init__(self)
     self.set_widget(ContinuousCustomButtonWidget())
     self.button_down = False
     self.button_held = False
     self.timeout = None
     self.create_signal('clicked')
     self.create_signal('held-down')
     self.create_signal('released')
     self.wrapped_widget_connect('pressed', self.on_pressed)
     self.wrapped_widget_connect('released', self.on_released)
     self.wrapped_widget_connect('clicked', self.on_clicked)
     self.initial_delay = 0.6
     self.repeat_delay = 0.3
Esempio n. 25
0
 def __init__(self, model):
     Widget.__init__(self)
     self.model = model
     self.set_widget(MiroTreeView(model._model))
     self.selection = self._widget.get_selection()
     self.columns = []
     self.attr_map_for_column = {}
     self.gtk_column_to_wrapper = {}
     self.background_color = None
     self.drag_button_down = False
     self._renderer_xpad = self._renderer_ypad = 0
     self.context_menu_callback = self.drag_source = self.drag_dest = None
     self.hotspot_tracker = None
     self.hover_info = None
     self.in_bulk_change = False
     self.handled_last_button_press = False
     self.delaying_press = False
     self.ignore_selection_changed = False
     self.set_columns_draggable(False)
     self.create_signal('row-expanded')
     self.create_signal('row-collapsed')
     self.create_signal('selection-changed')
     self.create_signal('hotspot-clicked')
     self.create_signal('row-double-clicked')
     self.create_signal('row-activated')
     self.wrapped_widget_connect('row-activated', self.on_row_activated)
     self.wrapped_widget_connect('row-expanded', self.on_row_expanded)
     self.wrapped_widget_connect('row-collapsed', self.on_row_collapsed)
     self.wrapped_widget_connect('button-press-event', self.on_button_press)
     self.wrapped_widget_connect('button-release-event',
         self.on_button_release)
     self.wrapped_widget_connect('motion-notify-event',
         self.on_motion_notify)
     self.wrapped_widget_connect('drag-data-get', self.on_drag_data_get)
     self.wrapped_widget_connect('drag-end', self.on_drag_end)
     self.wrapped_widget_connect('drag-motion', self.on_drag_motion)
     self.wrapped_widget_connect('drag-leave', self.on_drag_leave)
     self.wrapped_widget_connect('drag-data-received',
             self.on_drag_data_received)
     self.wrapped_widget_connect('unrealize', self.on_unrealize)
     weak_connect(self.selection, 'changed', self.on_selection_changed)
     self._connect_hotspot_signals()
     self.layout_manager = LayoutManager(self._widget)
     self.selected = None
     if hasattr(self, 'get_tooltip'):
         self._widget.set_property('has-tooltip', True)
         self.wrapped_widget_connect('query-tooltip', self.on_tooltip)
         self._last_tooltip_place = None
Esempio n. 26
0
    def __init__(self, label, group=None):
        Widget.__init__(self)
        self.set_widget(gtk.RadioButton(label=label))
        self.create_signal('clicked')
        self.forward_signal('clicked')

        if group:
            buttons = group.get_buttons()
            if buttons:
                self._widget.set_group(buttons[0]._widget)
        else:
            group = RadioButtonGroup()

        group.add_button(self)
        oid = id(self)
        radio_button_to_group_mapping[oid] = group
Esempio n. 27
0
 def __init__(self, text, style='normal', width=None):
     Widget.__init__(self)
     BinBaselineCalculator.__init__(self)
     # We just ignore style here, GTK users expect their own buttons.
     self.set_widget(gtk.Button())
     self.create_signal('clicked')
     self.forward_signal('clicked')
     self.label = Label(text)
     # only honor width if its bigger than the width we need to display the
     # label (#18994)
     if width and width > self.label.get_width():
         alignment = layout.Alignment(0.5, 0.5, 0, 0)
         alignment.set_size_request(width, -1)
         alignment.add(self.label)
         self._widget.add(alignment._widget)
     else:
         self._widget.add(self.label._widget)
     self.label._widget.show()
Esempio n. 28
0
 def __init__(self, text, style='normal', width=None):
     Widget.__init__(self)
     BinBaselineCalculator.__init__(self)
     # We just ignore style here, GTK users expect their own buttons.
     self.set_widget(gtk.Button())
     self.create_signal('clicked')
     self.forward_signal('clicked')
     self.label = Label(text)
     if width:
         current_width = self.label.get_width()
         padding = (width - current_width) // 2
         odd = width - current_width - padding * 2
         alignment = layout.Alignment(0.5, 0.5, 0, 0)
         alignment.set_padding(0, 0, padding, padding+odd)
         alignment.add(self.label)
         self._widget.add(alignment._widget)
     else:
         self._widget.add(self.label._widget)
     self.label._widget.show()
Esempio n. 29
0
 def __init__(self, text, style='normal', width=None):
     Widget.__init__(self)
     BinBaselineCalculator.__init__(self)
     # We just ignore style here, GTK users expect their own buttons.
     self.set_widget(gtk.Button())
     self.create_signal('clicked')
     self.forward_signal('clicked')
     self.label = Label(text)
     if width:
         current_width = self.label.get_width()
         padding = (width - current_width) // 2
         odd = width - current_width - padding * 2
         alignment = layout.Alignment(0.5, 0.5, 0, 0)
         alignment.set_padding(0, 0, padding, padding + odd)
         alignment.add(self.label)
         self._widget.add(alignment._widget)
     else:
         self._widget.add(self.label._widget)
     self.label._widget.show()
Esempio n. 30
0
 def __init__(self, initial_text=None):
     Widget.__init__(self)
     self.set_widget(self.entry_class())
     if initial_text is not None:
         self.set_text(initial_text)
     self._widget.set_wrap_mode(gtk.WRAP_WORD)
Esempio n. 31
0
File: simple.py Progetto: kmshi/miro
 def __init__(self):
     Widget.__init__(self)
     self.set_widget(gtk.ProgressBar())
     self._timer = None
Esempio n. 32
0
File: simple.py Progetto: kmshi/miro
 def __init__(self):
     Widget.__init__(self)
     self.set_widget(gtk.HSeparator())
Esempio n. 33
0
 def __init__(self):
     Widget.__init__(self)
     Drawable.__init__(self)
     self.set_widget(MiroDrawingArea())
Esempio n. 34
0
File: simple.py Progetto: kmshi/miro
 def __init__(self, path):
     Widget.__init__(self)
     self.set_widget(gtk.Image())
     self._widget.set_from_animation(gtk.gdk.PixbufAnimation(path))
Esempio n. 35
0
 def __init__(self, spacing=0):
     Widget.__init__(self)
     self.children = set()
     self.set_widget(self.WIDGET_CLASS(spacing=spacing))
Esempio n. 36
0
 def __init__(self, label=None, bold=False):
     Widget.__init__(self)
     BinBaselineCalculator.__init__(self)
     self.set_widget(gtk.CheckButton(label))
     self.create_signal('toggled')
     self.forward_signal('toggled')
Esempio n. 37
0
 def __init__(self, label):
     Widget.__init__(self)
     self.set_widget(gtk.CheckButton(label))
     self.create_signal('toggled')
     self.forward_signal('toggled')
Esempio n. 38
0
 def __init__(self, path):
     Widget.__init__(self)
     self.set_widget(gtk.Image())
     self._widget.set_from_animation(gtk.gdk.PixbufAnimation(path))
Esempio n. 39
0
File: simple.py Progetto: kmshi/miro
 def __init__(self):
     Widget.__init__(self)
     self.set_widget(gtk.HSeparator())
Esempio n. 40
0
File: simple.py Progetto: kmshi/miro
 def __init__(self, image=None):
     Widget.__init__(self)
     self.set_widget(gtk.Image())
     self.set_image(image)
Esempio n. 41
0
 def __init__(self):
     """Create a new splitter."""
     Widget.__init__(self)
     self.set_widget(gtk.HPaned())
Esempio n. 42
0
 def __init__(self):
     """Create a new splitter."""
     Widget.__init__(self)
     self.set_widget(gtk.HPaned())
Esempio n. 43
0
 def __init__(self):
     Widget.__init__(self)
     Drawable.__init__(self)
     self._gtk_cursor = None
     self._entry_handlers = None
Esempio n. 44
0
 def __init__(self, spacing=0):
     Widget.__init__(self)
     self.children = set()
     self.set_widget(self.WIDGET_CLASS(spacing=spacing))
Esempio n. 45
0
 def __init__(self):
     Widget.__init__(self)
     Drawable.__init__(self)
     self._gtk_cursor = None
     self._entry_handlers = None
Esempio n. 46
0
 def __init__(self):
     Widget.__init__(self)
     BinBaselineCalculator.__init__(self)
     self.set_widget(gtk.RadioButton(label=""))
     self._widget.set_active(False)
     self._buttons = []
Esempio n. 47
0
File: simple.py Progetto: kmshi/miro
 def __init__(self, image=None):
     Widget.__init__(self)
     self.set_widget(gtk.Image())
     self.set_image(image)
Esempio n. 48
0
 def __init__(self):
     Widget.__init__(self)
     self.set_widget(gtk.ProgressBar())
     self._timer = None
Esempio n. 49
0
 def __init__(self):
     Widget.__init__(self)
     BinBaselineCalculator.__init__(self)
     self.set_widget(gtk.RadioButton(label=""))
     self._widget.set_active(False)
     self._buttons = []
Esempio n. 50
0
 def __init__(self, label=None, bold=False):
     Widget.__init__(self)
     BinBaselineCalculator.__init__(self)
     self.set_widget(gtk.CheckButton(label))
     self.create_signal('toggled')
     self.forward_signal('toggled')
Esempio n. 51
0
 def __init__(self, image):
     Widget.__init__(self)
     self.image = image
     self.set_widget(gtk.Image())
     self._widget.set_from_pixbuf(image.pixbuf)
Esempio n. 52
0
 def __init__(self):
     Widget.__init__(self)
     Drawable.__init__(self)
     self.set_widget(MiroDrawingArea())
Esempio n. 53
0
 def __init__(self, columns, rows):
     Widget.__init__(self)
     self.set_widget(gtk.Table(rows, columns, homogeneous=False))
     self.children = Matrix(columns, rows)