當前位置: 首頁>>代碼示例>>Python>>正文


Python gtk.STATE_NORMAL屬性代碼示例

本文整理匯總了Python中gtk.STATE_NORMAL屬性的典型用法代碼示例。如果您正苦於以下問題:Python gtk.STATE_NORMAL屬性的具體用法?Python gtk.STATE_NORMAL怎麽用?Python gtk.STATE_NORMAL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在gtk的用法示例。


在下文中一共展示了gtk.STATE_NORMAL屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: add_box_hardware

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import STATE_NORMAL [as 別名]
def add_box_hardware(self, title, text):
        vboxframe = gtk.Frame()
        vboxframe.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("white"))
        vboxchild = gtk.Fixed()
        vboxevent = gtk.EventBox()
        vboxevent.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("white"))
        vboxevent.add(vboxchild)
        vboxframe.add(vboxevent)
        vboxchildlabel1 = gtk.Label()
        vboxchildlabel1.set_selectable(True)
        vboxchildlabel1.set_markup("<b>" + title + "</b>")
        vboxchild.put(vboxchildlabel1, 5, 5)
        vboxchildlabel2 = gtk.Label()
        vboxchildlabel2.set_selectable(True)
        vboxchildlabel2.set_text('\n'.join(text) + "\n")
        vboxchild.put(vboxchildlabel2, 5, 35)
        self.wine.builder.get_object("hosttablehw").add(vboxframe)
        self.wine.builder.get_object("hosttablehw").show_all() 
開發者ID:OpenXenManager,項目名稱:openxenmanager,代碼行數:20,代碼來源:oxcSERVER_host.py

示例2: set_status_display

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import STATE_NORMAL [as 別名]
def set_status_display(self,
            id=None, title=None, details=None, icon=None, color=None):
        status = self.status_display.get(id)
        if not status:
            return
        if icon:
            self._set_status_display_icon(
                status, icon, status.get('icon_size', 32))
        if title:
            status['title'].set_markup(title)
        if details:
            status['details'].set_markup(details)
        if color:
            color = gtk.gdk.color_parse(color)
            for which in ('title', 'details'):
                status[which].modify_fg(gtk.STATE_NORMAL, color)
                status[which].modify_text(gtk.STATE_NORMAL, color) 
開發者ID:mailpile,項目名稱:gui-o-matic,代碼行數:19,代碼來源:gtkbase.py

示例3: do_realize

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import STATE_NORMAL [as 別名]
def do_realize(self):
        self.set_flags(self.flags() | gtk.REALIZED)

        self.window = gdk.Window(self.get_parent_window(),
                                 width=20,
                                 height=self.allocation.height,
                                 window_type=gdk.WINDOW_CHILD,
                                 wclass=gdk.INPUT_OUTPUT,
                                 event_mask=self.get_events() | gdk.EXPOSURE_MASK | gdk.BUTTON_PRESS_MASK
                                 )
        self.window.set_user_data(self)
        self.style.attach(self.window)
        self.style.set_background(self.window, gtk.STATE_NORMAL) 
開發者ID:joxeankoret,項目名稱:nightmare,代碼行數:15,代碼來源:__init__.py

示例4: __init__

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import STATE_NORMAL [as 別名]
def __init__(self, tagtable=None):
        VView.__init__(self)
        self.textview = gtk.TextView()
        self.textview.connect("populate_popup", self.vwGetPopup)
        self.add(self.textview)

        if tagtable == None:
            tagtable = gtk.TextTagTable()

        self.vwSetTagTable(tagtable)

        style = gtk.Style()

        style.base[gtk.STATE_NORMAL] = gdk.Color(0,0,0)
        style.text[gtk.STATE_NORMAL] = gdk.Color(0,0,0xff)

        style.base[gtk.STATE_INSENSITIVE] = gdk.Color(0,0,0)
        style.text[gtk.STATE_INSENSITIVE] = gdk.Color(20,20,20)

        self.textview.set_style(style)

        self.tagcfg = ConfigParser()

        self.curtag = None # Is a current tag selected?
        #self.deftag = 
        self.vwInitTag(VTextTag("default"))

        start,end = self.textbuf.get_bounds()
        self.textbuf.create_mark("insertend", end) 
開發者ID:joxeankoret,項目名稱:nightmare,代碼行數:31,代碼來源:views.py

示例5: area_expose_cb

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import STATE_NORMAL [as 別名]
def area_expose_cb(self, area, event):
        self.style = self.area.get_style()
        self.gc = self.style.fg_gc[gtk.STATE_NORMAL]
        self.draw_text()
        return True 
開發者ID:ActiveState,項目名稱:code,代碼行數:7,代碼來源:recipe-576820.py

示例6: fill_custom_fields_table

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import STATE_NORMAL [as 別名]
def fill_custom_fields_table(self, add=False):
        pool_ref = self.xc_servers[self.selected_host].all['pool'].keys()[0]
        self.vboxchildtext = {}
        if "XenCenter.CustomFields" in self.xc_servers[self.selected_host].all['pool'][pool_ref]["gui_config"]:
            for ch in self.builder.get_object("vboxcustomfields").get_children():
                self.builder.get_object("vboxcustomfields").remove(ch)

            dom = xml.dom.minidom.parseString(
                self.xc_servers[self.selected_host].all['pool'][pool_ref]["gui_config"]["XenCenter.CustomFields"])
            for node in dom.getElementsByTagName("CustomFieldDefinition"):
                name = node.attributes.getNamedItem("name").value
                if name not in self.vboxchildtext:
                    vboxframe = gtk.Frame()
                    vboxframe.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("white"))
                    vboxframe.set_size_request(500, 30)
                    vboxchild = gtk.Fixed()
                    vboxchild.set_size_request(500, 30)
                    vboxevent = gtk.EventBox()
                    vboxevent.add(vboxchild)
                    vboxchildlabel = gtk.Label()
                    vboxchildlabel.set_selectable(True)
                    vboxchildlabel.set_label(name)
                    vboxchild.put(vboxchildlabel, 5, 5)
                    self.vboxchildtext[name] = gtk.Entry()
                    self.vboxchildtext[name].set_size_request(200, 20)
                    vboxchild.put(self.vboxchildtext[name], 300, 5)
                    vboxevent.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("white"))
                    self.builder.get_object("vboxcustomfields").pack_start(vboxevent, False, False, 0)
                    self.builder.get_object("vboxcustomfields").show_all()
        if add:
            self.set_custom_fields_values() 
開發者ID:OpenXenManager,項目名稱:openxenmanager,代碼行數:33,代碼來源:window_properties.py

示例7: on_tabboximport_switch_page

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import STATE_NORMAL [as 別名]
def on_tabboximport_switch_page(self, widget, data=None, data2=None):
        """
        Function called when you change the page in "import vm" process
        """
        # Set colors..
        white = gtk.gdk.color_parse("white")
        blue = gtk.gdk.color_parse("#d5e5f7")
        for i in range(0,5):
             self.builder.get_object("eventimport" + str(i)).modify_bg(gtk.STATE_NORMAL, white)
        self.builder.get_object("eventimport" + str(data2)).modify_bg(gtk.STATE_NORMAL, blue)
        # If page is the first, you cannot go to previous page
        self.builder.get_object("previousvmimport").set_sensitive(data2 != 0) 
開發者ID:OpenXenManager,項目名稱:openxenmanager,代碼行數:14,代碼來源:window_vm.py

示例8: console

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import STATE_NORMAL [as 別名]
def console(self, message):
        self.set_point(self.get_length())
        self.freeze()
        previous_kind = None
        style = self.get_style()
        style_cache = {}
        try:
            for element in message:
                if element[0] == 'exception':
                    s = traceback.format_list(element[1]['traceback'])
                    s.extend(element[1]['exception'])
                    s = string.join(s, '')
                else:
                    s = element[1]

                if element[0] != previous_kind:
                    style = style_cache.get(element[0], None)
                    if style is None:
                        gtk.rc_parse_string(
                            'widget \"Manhole.*.Console\" '
                            'style \"Console_%s\"\n'
                            % (element[0]))
                        self.set_rc_style()
                        style_cache[element[0]] = style = self.get_style()
                # XXX: You'd think we'd use style.bg instead of 'None'
                # here, but that doesn't seem to match the color of
                # the backdrop.
                self.insert(style.font, style.fg[gtk.STATE_NORMAL],
                            None, s)
                previous_kind = element[0]
            l = self.get_length()
            diff = self.maxBufSz - l
            if diff < 0:
                diff = - diff
                self.delete_text(0,diff)
        finally:
            self.thaw()
        a = self.get_vadjustment()
        a.set_value(a.upper - a.page_size) 
開發者ID:kenorb-contrib,項目名稱:BitTorrent,代碼行數:41,代碼來源:pywidgets.py

示例9: _unassign_placeholder_text

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import STATE_NORMAL [as 別名]
def _unassign_placeholder_text(self):
    if self._has_placeholder_text_assigned:
      self._has_placeholder_text_assigned = False
      self._modify_font_for_placeholder_text(gtk.STATE_NORMAL, pango.STYLE_NORMAL)
      self._do_assign_text(b"")
      self._popup.save_last_value() 
開發者ID:khalim19,項目名稱:gimp-plugin-export-layers,代碼行數:8,代碼來源:entries.py

示例10: _modify_font_for_placeholder_text

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import STATE_NORMAL [as 別名]
def _modify_font_for_placeholder_text(self, state_for_color, style):
    self.modify_text(gtk.STATE_NORMAL, self.style.fg[state_for_color])
    
    font_description = self.get_pango_context().get_font_description()
    font_description.set_style(style)
    self.modify_font(font_description) 
開發者ID:khalim19,項目名稱:gimp-plugin-export-layers,代碼行數:8,代碼來源:entries.py

示例11: _set_background_image

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import STATE_NORMAL [as 別名]
def _set_background_image(self, container, image):
        themed_image = self._theme_image(image)
        img = gtk.gdk.pixbuf_new_from_file(themed_image)
        def draw_background(widget, ev):
            alloc = widget.get_allocation()
            pb = img.scale_simple(alloc.width, alloc.height,
                                  gtk.gdk.INTERP_BILINEAR)
            widget.window.draw_pixbuf(
                widget.style.bg_gc[gtk.STATE_NORMAL],
                pb, 0, 0, alloc.x, alloc.y)
            if (hasattr(widget, 'get_child') and
                    widget.get_child() is not None):
                widget.propagate_expose(widget.get_child(), ev)
            return False
        container.connect('expose_event', draw_background) 
開發者ID:mailpile,項目名稱:gui-o-matic,代碼行數:17,代碼來源:gtkbase.py

示例12: get_splash

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import STATE_NORMAL [as 別名]
def get_splash():
    splash = gtk.Window(gtk.WINDOW_TOPLEVEL)
    splash.set_events(splash.get_events() | gtk.gdk.BUTTON_PRESS_MASK)
    def f(widget, data=None):
        splash.destroy()
    splash.connect('button_press_event', f)

    eb = gtk.EventBox()
    eb.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("white"))
    image = gtk.Image()
    image.show()
    image.set_from_file(os.path.join(rpy2.__path__[0], "images", "rpy2_logo.png"))
    splashVBox = gtk.VBox()

    splashVBox.pack_start(image, True, True, 0)
    splashVBox.pack_start(gtk.Label("A GTK+ toy user interface"), 
                          True, True, 0)
    eb.add(splashVBox)
    splash.add(eb)
    splash.realize()
    splash.window.set_type_hint (gtk.gdk.WINDOW_TYPE_HINT_SPLASHSCREEN)
    # needed on Win32
    splash.set_decorated (False)
    splash.set_position (gtk.WIN_POS_CENTER)
    return splash 
開發者ID:rpy2,項目名稱:rpy2,代碼行數:27,代碼來源:radmin.py

示例13: on_txtSearch_focus

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import STATE_NORMAL [as 別名]
def on_txtSearch_focus(self, widget, *args):
        if widget.get_text() == _('buscar...'):
            widget.modify_text(gtk.STATE_NORMAL, gtk.gdk.Color('black'))
            widget.set_text('')
    #-- Wmain.on_txtSearch_focus }

    #-- Wmain.on_txtSearch_focus_out_event { 
開發者ID:mjun,項目名稱:gnome-connection-manager,代碼行數:9,代碼來源:gnome_connection_manager.py

示例14: on_txtSearch_focus_out_event

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import STATE_NORMAL [as 別名]
def on_txtSearch_focus_out_event(self, widget, *args):
        if widget.get_text() == '':
            widget.modify_text(gtk.STATE_NORMAL, gtk.gdk.Color('darkgray'))
            widget.set_text(_('buscar...'))
    #-- Wmain.on_txtSearch_focus_out_event }

    #-- Wmain.on_btnSearchBack_clicked { 
開發者ID:mjun,項目名稱:gnome-connection-manager,代碼行數:9,代碼來源:gnome_connection_manager.py

示例15: change_color

# 需要導入模塊: import gtk [as 別名]
# 或者: from gtk import STATE_NORMAL [as 別名]
def change_color(self, color):
        self.eb.modify_bg(gtk.STATE_ACTIVE, color)
        self.eb2.modify_bg(gtk.STATE_ACTIVE, color)
        self.eb.modify_bg(gtk.STATE_NORMAL, color)
        self.eb2.modify_bg(gtk.STATE_NORMAL, color) 
開發者ID:mjun,項目名稱:gnome-connection-manager,代碼行數:7,代碼來源:gnome_connection_manager.py


注:本文中的gtk.STATE_NORMAL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。