示例#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')
示例#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')
 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)
示例#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)
示例#5
0
文件: simple.py 项目: 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))
示例#6
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
示例#7
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
示例#8
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')
示例#9
0
文件: simple.py 项目: 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
示例#10
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))
示例#11
0
文件: simple.py 项目: cool-RR/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
示例#12
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()
示例#13
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)
示例#14
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)
示例#15
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)
示例#16
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)
示例#17
0
文件: controls.py 项目: foxi/miro
 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)
示例#18
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)
示例#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)
示例#20
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)
示例#21
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)
示例#22
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
示例#23
0
文件: tableview.py 项目: cool-RR/Miro
 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
示例#24
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
示例#25
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()
示例#26
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()
示例#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)
     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()
示例#28
0
 def __init__(self):
     Widget.__init__(self)
     Drawable.__init__(self)
     self._gtk_cursor = None
     self._entry_handlers = None
示例#29
0
文件: simple.py 项目: kmshi/miro
 def __init__(self):
     Widget.__init__(self)
     self.set_widget(gtk.HSeparator())
示例#30
0
 def __init__(self):
     Widget.__init__(self)
     BinBaselineCalculator.__init__(self)
     self.set_widget(gtk.RadioButton(label=""))
     self._widget.set_active(False)
     self._buttons = []
示例#31
0
 def __init__(self):
     Widget.__init__(self)
     Drawable.__init__(self)
     self._gtk_cursor = None
     self._entry_handlers = None
示例#32
0
 def __init__(self, spacing=0):
     Widget.__init__(self)
     self.children = set()
     self.set_widget(self.WIDGET_CLASS(spacing=spacing))
示例#33
0
 def __init__(self, label):
     Widget.__init__(self)
     self.set_widget(gtk.CheckButton(label))
     self.create_signal('toggled')
     self.forward_signal('toggled')
示例#34
0
 def __init__(self):
     Widget.__init__(self)
     BinBaselineCalculator.__init__(self)
     self.set_widget(gtk.RadioButton(label=""))
     self._widget.set_active(False)
     self._buttons = []
示例#35
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')
示例#36
0
文件: simple.py 项目: kmshi/miro
 def __init__(self, path):
     Widget.__init__(self)
     self.set_widget(gtk.Image())
     self._widget.set_from_animation(gtk.gdk.PixbufAnimation(path))
示例#37
0
文件: simple.py 项目: kmshi/miro
 def __init__(self):
     Widget.__init__(self)
     self.set_widget(gtk.HSeparator())
示例#38
0
 def __init__(self):
     """Create a new splitter."""
     Widget.__init__(self)
     self.set_widget(gtk.HPaned())
示例#39
0
 def __init__(self):
     Widget.__init__(self)
     Drawable.__init__(self)
     self.set_widget(MiroDrawingArea())
示例#40
0
 def __init__(self, columns, rows):
     Widget.__init__(self)
     self.set_widget(gtk.Table(rows, columns, homogeneous=False))
     self.children = Matrix(columns, rows)
示例#41
0
 def __init__(self):
     """Create a new splitter."""
     Widget.__init__(self)
     self.set_widget(gtk.HPaned())
示例#42
0
文件: simple.py 项目: kmshi/miro
 def __init__(self, image=None):
     Widget.__init__(self)
     self.set_widget(gtk.Image())
     self.set_image(image)
示例#43
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)
示例#44
0
文件: simple.py 项目: cool-RR/Miro
 def __init__(self):
     Widget.__init__(self)
     self.set_widget(gtk.ProgressBar())
     self._timer = None
示例#45
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')
示例#46
0
文件: simple.py 项目: cool-RR/Miro
 def __init__(self, image):
     Widget.__init__(self)
     self.image = image
     self.set_widget(gtk.Image())
     self._widget.set_from_pixbuf(image.pixbuf)
示例#47
0
 def __init__(self, spacing=0):
     Widget.__init__(self)
     self.children = set()
     self.set_widget(self.WIDGET_CLASS(spacing=spacing))
示例#48
0
文件: simple.py 项目: cool-RR/Miro
 def __init__(self, path):
     Widget.__init__(self)
     self.set_widget(gtk.Image())
     self._widget.set_from_animation(gtk.gdk.PixbufAnimation(path))
示例#49
0
文件: simple.py 项目: kmshi/miro
 def __init__(self, image=None):
     Widget.__init__(self)
     self.set_widget(gtk.Image())
     self.set_image(image)
示例#50
0
文件: simple.py 项目: kmshi/miro
 def __init__(self):
     Widget.__init__(self)
     self.set_widget(gtk.ProgressBar())
     self._timer = None
示例#51
0
文件: drawing.py 项目: zjmmjzzjm/miro
 def __init__(self):
     Widget.__init__(self)
     Drawable.__init__(self)
     self.set_widget(MiroDrawingArea())
示例#52
0
 def __init__(self, columns, rows):
     Widget.__init__(self)
     self.set_widget(gtk.Table(rows, columns, homogeneous=False))
     self.children = Matrix(columns, rows)