コード例 #1
0
ファイル: volume_button.py プロジェクト: Jiarui315/deepin-ui
 def value(self, value):        
     if 0 <= value <= self.__volume_max_value:
         Tooltip.text(self, str(value))
         temp_padding = (float(self.__volume_max_value) / self.__volume_width)
         temp_padding_x = float(value) / temp_padding            
         self.__point_padding_x = temp_padding_x + ((self.__fg_padding_x))
         self.queue_draw()
コード例 #2
0
 def value(self, value):
     if 0 <= value <= self.__volume_max_value:
         Tooltip.text(self, str(value))
         temp_padding = (float(self.__volume_max_value) /
                         self.__volume_width)
         temp_padding_x = float(value) / temp_padding
         self.__point_padding_x = temp_padding_x + ((self.__fg_padding_x))
         self.queue_draw()
コード例 #3
0
ファイル: tooltip_test.py プロジェクト: masums/deepin-ui
def gen_control(widget):
    box = gtk.VBox()
    t = gtk.CheckButton("NeedShadow")
    t.set_active(True)
    t.connect('toggled', lambda w: TT.has_shadow(widget, w.get_active()))
    box.pack_start(t, False, False)
    TT.text(t, "toggle the shadow")

    winfo = TT.WidgetInfo.get_info(widget)
    t1 = gtk.Entry()
    t1.set_text(winfo.text or "")
    t1.connect('activate', lambda w: TT.text(widget, w.get_text()))
    box.pack_start(t1, False, False)

    t2 = gtk.SpinButton()
    t2.set_range(0, 10)
    t2.set_value((winfo.show_delay / 1000))
    t2.connect(
        'value-changed',
        lambda w: TT.show_delay(widget,
                                w.get_value_as_int() * 1000 + 100))
    box.pack_start(t2, False, False)

    t3 = ColorButton()
    t3.set_color(str(winfo.background))
    t3.connect(
        'color-select',
        lambda w, e: TT.background(widget, gtk.gdk.Color(w.get_color())))
    box.pack_start(t3)

    t4 = gtk.SpinButton()
    t4.set_range(0, 100)
    t4.set_value(winfo.padding_r)
    t4.connect('value-changed',
               lambda w: TT.padding(widget, -1, -1, -1, w.get_value()))
    box.pack_start(t4, False, False)

    t5 = gtk.CheckButton("disable")
    t5.set_active(False)
    t5.connect('toggled', lambda w: TT.disable(widget, w.get_active()))
    box.pack_start(t5, False, False)

    #----------------------------------------------------------------------#
    TT.text(t1, "The text value if tooltip didn't has custom property")\
           (t2, "The show delay value")\
           (t3, "The background color")\
           (t4, "The pading right value")\
           (t5, "tmp disable tooltip")\
       .show_delay([t1,t2,t3,t4,t5], 200)\
       .background([t1,t2], gdk.Color("red"))\
       .set_value([t1,t2,t3,t4,t5], {'text_kargs': {"text_size":15}})
    #_____________________________________________________________________#
    return box
コード例 #4
0
ファイル: tooltip_test.py プロジェクト: Jiarui315/deepin-ui
def gen_control(widget):
    box = gtk.VBox()
    t = gtk.CheckButton("NeedShadow")
    t.set_active(True)
    t.connect('toggled', lambda w: TT.has_shadow(widget, w.get_active()))
    box.pack_start(t, False, False)
    TT.text(t, "toggle the shadow")

    winfo = TT.WidgetInfo.get_info(widget)
    t1 = gtk.Entry()
    t1.set_text(winfo.text or "")
    t1.connect('activate', lambda w: TT.text(widget, w.get_text()))
    box.pack_start(t1, False, False)

    t2 = gtk.SpinButton()
    t2.set_range(0, 10)
    t2.set_value((winfo.show_delay / 1000))
    t2.connect('value-changed', lambda w: TT.show_delay(widget, w.get_value_as_int() * 1000 + 100))
    box.pack_start(t2, False, False)

    t3 = ColorButton()
    t3.set_color(str(winfo.background))
    t3.connect('color-select', lambda w, e: TT.background(widget, gtk.gdk.Color(w.get_color())))
    box.pack_start(t3)

    t4 = gtk.SpinButton()
    t4.set_range(0, 100)
    t4.set_value(winfo.padding_r)
    t4.connect('value-changed', lambda w: TT.padding(widget, -1, -1, -1, w.get_value()))
    box.pack_start(t4, False, False)

    t5 = gtk.CheckButton("disable")
    t5.set_active(False)
    t5.connect('toggled', lambda w: TT.disable(widget, w.get_active()))
    box.pack_start(t5, False, False)

    #----------------------------------------------------------------------#
    TT.text(t1, "The text value if tooltip didn't has custom property")\
           (t2, "The show delay value")\
           (t3, "The background color")\
           (t4, "The pading right value")\
           (t5, "tmp disable tooltip")\
       .show_delay([t1,t2,t3,t4,t5], 200)\
       .background([t1,t2], gdk.Color("red"))\
       .set_value([t1,t2,t3,t4,t5], {'text_kargs': {"text_size":15}})
    #_____________________________________________________________________#
    return box
コード例 #5
0
ファイル: titlebar.py プロジェクト: electricface/deepin-ui
    def __init__(self, 
                 button_mask=["theme", "menu", "max", "min", "close"],
                 icon_path=None,
                 app_name=None,
                 title=None,
                 add_separator=False,
                 height=26,
                 show_title=True,
                 enable_gaussian=True,
                 name_size=DEFAULT_FONT_SIZE,
                 title_size=DEFAULT_FONT_SIZE,
                 ):
        '''
        Initialize the title bar.

        @param button_mask: A string list. Each item of it indicates that there is a corresponding button on the title bar. By default, it's ["theme", "menu", "max", "min", "close"], which means theme button, menu button, max button, min button and close button, respectively.
        @param icon_path: The path of icon image.
        @param app_name: Application name string. It will be displayed just next to the icon_dpixbuf. By default, it's None.
        @param title: Title string of the application. It will be displayed on the center of the title bar. By default, it's None.
        @param add_separator: If True, add a separation line between the title bar and the body of the window. By default, it's False.
        @param height: The height of the title bar. By default, it's 26 pixels.
        @param show_title: If False, the title bar will not be displayed. By default, it's True.
        @param enable_gaussian: Whether enable gaussian on title, default is True.
        @param name_size: The size of name, default is DEFAULT_FONT_SIZE.
        @param title_size: The size of title, default is DEFAULT_FONT_SIZE.
        '''
        # Init.
        EventBox.__init__(self)
        self.set_size_request(-1, height)
        self.v_layout_box = gtk.VBox()
        self.h_layout_box = gtk.HBox()
        self.add(self.v_layout_box)
        self.v_layout_box.pack_start(self.h_layout_box, True, True)
        
        # Init separator.
        if add_separator:
            self.separator = gtk.HBox()
            self.separator.set_size_request(-1, 1)
            self.separator.connect("expose-event", self.expose_titlebar_separator)
            self.v_layout_box.pack_start(self.separator, True, True)
        
        # Add drag event box.
        self.drag_box = EventBox()
        self.h_layout_box.pack_start(self.drag_box, True, True)
        
        # Init left box to contain icon and title.
        self.left_box = gtk.HBox()
        self.drag_box.add(self.left_box)
        
        if show_title:
            # Add icon.
            if icon_path != None:
                self.icon_image_box = gtk.image_new_from_pixbuf(gtk.gdk.pixbuf_new_from_file(icon_path))
                self.icon_align = gtk.Alignment()
                self.icon_align.set(0.5, 0.5, 0.0, 0.0)
                self.icon_align.set_padding(5, 5, 5, 0)
                self.icon_align.add(self.icon_image_box)
                self.left_box.pack_start(self.icon_align, False, False)
                        
            # Add app name.
            if app_name == None:
                app_name_label = ""
            else:
                app_name_label = app_name
            self.app_name_box = Label(
                app_name_label,
                text_color=ui_theme.get_color("title_text"),
                enable_gaussian=enable_gaussian, text_size=name_size,
                )
            self.app_name_align = gtk.Alignment()
            self.app_name_align.set(0.5, 0.5, 0.0, 0.0)
            self.app_name_align.set_padding(2, 0, 5, 0)
            self.app_name_align.add(self.app_name_box)
            self.left_box.pack_start(self.app_name_align, False, False)
            
            # Add title.
            if title == None:
                title_label = ""
            else:
                title_label = title
            self.title_box = Label(
                title_label,
                text_color=ui_theme.get_color("title_text"),
                enable_gaussian=enable_gaussian, 
                text_x_align=pango.ALIGN_CENTER,
                text_size=title_size,
                )
            self.title_align = gtk.Alignment()
            self.title_align.set(0.5, 0.5, 0.0, 0.0)
            self.title_align.set_padding(2, 0, 30, 30)
            self.title_align.add(self.title_box)
            self.left_box.pack_start(self.title_align, True, True)
            
        # Add button box.
        self.button_box = gtk.HBox()
        self.button_align = gtk.Alignment()
        self.button_align.set(1.0, 0.0, 0.0, 0.0)
        self.button_align.set_padding(0, 0, 0, 0)
        self.button_align.add(self.button_box)
        self.right_box = gtk.VBox()
        self.right_box.pack_start(self.button_align, False, False)
        self.h_layout_box.pack_start(self.right_box, False, False)
        
        # Add theme button.
        if "theme" in button_mask:
            self.theme_button = ThemeButton()
            self.button_box.pack_start(self.theme_button, False, False, 1)
            Tooltip.text(self.theme_button, _("Change skin")).show_delay(self.theme_button, 2000)

        # Add menu button.
        if "menu" in button_mask:
            self.menu_button = MenuButton()
            self.button_box.pack_start(self.menu_button, False, False, 1)
            Tooltip.text(self.menu_button, _("Main menu")).show_delay(self.menu_button, 2000)
        
        # Add min button.
        if "min" in button_mask:
            self.min_button = MinButton()
            self.button_box.pack_start(self.min_button, False, False, 1)
            Tooltip.text(self.min_button, _("Minimum")).show_delay(self.min_button, 2000)        
            
        # Add max button.
        if "max" in button_mask:
            self.max_button = MaxButton()
            self.button_box.pack_start(self.max_button, False, False, 1)
            Tooltip.text(self.max_button, _("Maximize")).show_delay(self.max_button, 2000)        

        # Add close button.
        if "close" in button_mask:
            self.close_button = CloseButton()
            self.button_box.pack_start(self.close_button, False, False)
            Tooltip.text(self.close_button, _("Close")).show_delay(self.close_button, 2000)        
        
        # Show.
        self.show_all()
コード例 #6
0
ファイル: titlebar.py プロジェクト: liuhuan520/deepin-ui
    def __init__(self, 
                 button_mask=["theme", "menu", "max", "min", "close"],
                 icon_dpixbuf=None,
                 app_name=None,
                 title=None,
                 add_separator=False,
                 height=26,
                 show_title=True,
                 ):
        """
        Initialize the title bar.

        @param button_mask: A string list. Each item of it indicates that there is a corresponding button on the title bar. By default, it's ["theme", "menu", "max", "min", "close"], which means theme button, menu button, max button, min button and close button, respectively.
        @param icon_dpixbuf: A pixbuf of type dtk.ui.theme.DynamicPixbuf. It will be displayed at the top left of the window. By default, it's None.
        @param app_name: Application name string. It will be displayed just next to the icon_dpixbuf. By default, it's None.
        @param title: Title string of the application. It will be displayed on the center of the title bar. By default, it's None.
        @param add_separator: If True, add a separation line between the title bar and the body of the window. By default, it's False.
        @param height: The hight of the title bar. By default, it's 26 pixels.
        @param show_title: If False, the title bar will not be displayed. By default, it's True.
        """
        # Init.
        EventBox.__init__(self)
        self.set_size_request(-1, height)
        self.v_layout_box = gtk.VBox()
        self.h_layout_box = gtk.HBox()
        self.add(self.v_layout_box)
        self.v_layout_box.pack_start(self.h_layout_box, True, True)
        
        # Init separator.
        if add_separator:
            self.separator = gtk.HBox()
            self.separator.set_size_request(-1, 1)
            self.separator.connect("expose-event", self.expose_titlebar_separator)
            self.v_layout_box.pack_start(self.separator, True, True)
        
        # Add drag event box.
        self.drag_box = EventBox()
        self.h_layout_box.pack_start(self.drag_box, True, True)
        
        # Init left box to contain icon and title.
        self.left_box = gtk.HBox()
        self.drag_box.add(self.left_box)
        
        if show_title:
            # Add icon.
            if icon_dpixbuf != None:
                self.icon_image_box = ImageBox(icon_dpixbuf)
                self.icon_align = gtk.Alignment()
                self.icon_align.set(0.5, 0.5, 0.0, 0.0)
                self.icon_align.set_padding(5, 5, 5, 0)
                self.icon_align.add(self.icon_image_box)
                self.left_box.pack_start(self.icon_align, False, False)
                        
            # Add app name.
            if app_name != None:
                self.app_name_box = Label(app_name, enable_gaussian=True)
                self.app_name_align = gtk.Alignment()
                self.app_name_align.set(0.5, 0.5, 0.0, 0.0)
                self.app_name_align.set_padding(2, 0, 5, 0)
                self.app_name_align.add(self.app_name_box)
                self.left_box.pack_start(self.app_name_align, False, False)
            
            # Add title.
            if title != None:
                self.title_box = Label(title, enable_gaussian=True, text_x_align=pango.ALIGN_CENTER)
                self.title_align = gtk.Alignment()
                self.title_align.set(0.5, 0.5, 0.0, 0.0)
                self.title_align.set_padding(2, 0, 30, 30)
                self.title_align.add(self.title_box)
                self.left_box.pack_start(self.title_align, True, True)
            
        # Add button box.
        self.button_box = gtk.HBox()
        self.button_align = gtk.Alignment()
        self.button_align.set(1.0, 0.0, 0.0, 0.0)
        self.button_align.set_padding(0, 0, 0, 0)
        self.button_align.add(self.button_box)
        self.h_layout_box.pack_start(self.button_align, False, False)
        
        # Add theme button.
        if "theme" in button_mask:
            self.theme_button = ThemeButton()
            self.button_box.pack_start(self.theme_button, False, False, 1)
            Tooltip.text(self.theme_button, _("Change skin")).show_delay(self.theme_button, 2000)

        # Add menu button.
        if "menu" in button_mask:
            self.menu_button = MenuButton()
            self.button_box.pack_start(self.menu_button, False, False, 1)
            Tooltip.text(self.menu_button, _("Main menu")).show_delay(self.menu_button, 2000)
        
        # Add min button.
        if "min" in button_mask:
            self.min_button = MinButton()
            self.button_box.pack_start(self.min_button, False, False, 1)
            Tooltip.text(self.min_button, _("Minimum")).show_delay(self.min_button, 2000)        
            
        # Add max button.
        if "max" in button_mask:
            self.max_button = MaxButton()
            self.button_box.pack_start(self.max_button, False, False, 1)
            Tooltip.text(self.max_button, _("Maximize")).show_delay(self.max_button, 2000)        

        # Add close button.
        if "close" in button_mask:
            self.close_button = CloseButton()
            self.button_box.pack_start(self.close_button, False, False)
            Tooltip.text(self.close_button, _("Close")).show_delay(self.close_button, 2000)        
        
        # Show.
        self.show_all()
コード例 #7
0
ファイル: label_utils.py プロジェクト: Jiarui315/deepin-ui
def set_label_tooltip_hook(label, label_width, expect_label_width):
    if expect_label_width < label_width:
        tooltip.disable(label, False)
        tooltip.text(label, label.text)
    else:
        tooltip.disable(label, True)
コード例 #8
0
def set_label_tooltip_hook(label, label_width, expect_label_width):
    if expect_label_width < label_width:
        tooltip.disable(label, False)
        tooltip.text(label, label.text)
    else:
        tooltip.disable(label, True)
コード例 #9
0
    def __init__(
        self,
        button_mask=["theme", "menu", "max", "min", "close"],
        icon_path=None,
        app_name=None,
        title=None,
        add_separator=False,
        height=26,
        show_title=True,
        enable_gaussian=True,
        name_size=DEFAULT_FONT_SIZE,
        title_size=DEFAULT_FONT_SIZE,
    ):
        '''
        Initialize the title bar.

        @param button_mask: A string list. Each item of it indicates that there is a corresponding button on the title bar. By default, it's ["theme", "menu", "max", "min", "close"], which means theme button, menu button, max button, min button and close button, respectively.
        @param icon_path: The path of icon image.
        @param app_name: Application name string. It will be displayed just next to the icon_dpixbuf. By default, it's None.
        @param title: Title string of the application. It will be displayed on the center of the title bar. By default, it's None.
        @param add_separator: If True, add a separation line between the title bar and the body of the window. By default, it's False.
        @param height: The height of the title bar. By default, it's 26 pixels.
        @param show_title: If False, the title bar will not be displayed. By default, it's True.
        @param enable_gaussian: Whether enable gaussian on title, default is True.
        @param name_size: The size of name, default is DEFAULT_FONT_SIZE.
        @param title_size: The size of title, default is DEFAULT_FONT_SIZE.
        '''
        # Init.
        EventBox.__init__(self)
        self.set_size_request(-1, height)
        self.v_layout_box = gtk.VBox()
        self.h_layout_box = gtk.HBox()
        self.add(self.v_layout_box)
        self.v_layout_box.pack_start(self.h_layout_box, True, True)

        # Init separator.
        if add_separator:
            self.separator = gtk.HBox()
            self.separator.set_size_request(-1, 1)
            self.separator.connect("expose-event",
                                   self.expose_titlebar_separator)
            self.v_layout_box.pack_start(self.separator, True, True)

        # Add drag event box.
        self.drag_box = EventBox()
        self.h_layout_box.pack_start(self.drag_box, True, True)

        # Init left box to contain icon and title.
        self.left_box = gtk.HBox()
        self.drag_box.add(self.left_box)

        if show_title:
            # Add icon.
            if icon_path != None:
                self.icon_image_box = gtk.image_new_from_pixbuf(
                    gtk.gdk.pixbuf_new_from_file(icon_path))
                self.icon_align = gtk.Alignment()
                self.icon_align.set(0.5, 0.5, 0.0, 0.0)
                self.icon_align.set_padding(5, 5, 5, 0)
                self.icon_align.add(self.icon_image_box)
                self.left_box.pack_start(self.icon_align, False, False)

            # Add app name.
            if app_name == None:
                app_name_label = ""
            else:
                app_name_label = app_name
            self.app_name_box = Label(
                app_name_label,
                text_color=ui_theme.get_color("title_text"),
                enable_gaussian=enable_gaussian,
                text_size=name_size,
            )
            self.app_name_align = gtk.Alignment()
            self.app_name_align.set(0.5, 0.5, 0.0, 0.0)
            self.app_name_align.set_padding(2, 0, 5, 0)
            self.app_name_align.add(self.app_name_box)
            self.left_box.pack_start(self.app_name_align, False, False)

            # Add title.
            if title == None:
                title_label = ""
            else:
                title_label = title
            self.title_box = Label(
                title_label,
                text_color=ui_theme.get_color("title_text"),
                enable_gaussian=enable_gaussian,
                text_x_align=pango.ALIGN_CENTER,
                text_size=title_size,
            )
            self.title_align = gtk.Alignment()
            self.title_align.set(0.5, 0.5, 0.0, 0.0)
            self.title_align.set_padding(2, 0, 30, 30)
            self.title_align.add(self.title_box)
            self.left_box.pack_start(self.title_align, True, True)

        # Add button box.
        self.button_box = gtk.HBox()
        self.button_align = gtk.Alignment()
        self.button_align.set(1.0, 0.0, 0.0, 0.0)
        self.button_align.set_padding(0, 0, 0, 0)
        self.button_align.add(self.button_box)
        self.right_box = gtk.VBox()
        self.right_box.pack_start(self.button_align, False, False)
        self.h_layout_box.pack_start(self.right_box, False, False)

        # Add theme button.
        if "theme" in button_mask:
            self.theme_button = ThemeButton()
            self.button_box.pack_start(self.theme_button, False, False, 1)
            Tooltip.text(self.theme_button,
                         _("Change skin")).show_delay(self.theme_button, 2000)

        # Add menu button.
        if "menu" in button_mask:
            self.menu_button = MenuButton()
            self.button_box.pack_start(self.menu_button, False, False, 1)
            Tooltip.text(self.menu_button,
                         _("Main menu")).show_delay(self.menu_button, 2000)

        # Add min button.
        if "min" in button_mask:
            self.min_button = MinButton()
            self.button_box.pack_start(self.min_button, False, False, 1)
            Tooltip.text(self.min_button,
                         _("Minimize")).show_delay(self.min_button, 2000)

        # Add max button.
        if "max" in button_mask:
            self.max_button = MaxButton()
            self.button_box.pack_start(self.max_button, False, False, 1)
            Tooltip.text(self.max_button,
                         _("Maximize")).show_delay(self.max_button, 2000)

        # Add close button.
        if "close" in button_mask:
            self.close_button = CloseButton()
            self.button_box.pack_start(self.close_button, False, False)
            Tooltip.text(self.close_button,
                         _("Close")).show_delay(self.close_button, 2000)

        # Show.
        self.show_all()
コード例 #10
0
ファイル: titlebar.py プロジェクト: netphi/deepin-ui
    def __init__(self, 
                 button_mask=["theme", "menu", "max", "min", "close"],
                 icon_dpixbuf=None,
                 app_name=None,
                 title=None,
                 add_separator=False,
                 height=26
                 ):
        '''Init titlebar.'''
        # Init.
        EventBox.__init__(self)
        self.set_size_request(-1, height)
        self.v_layout_box = gtk.VBox()
        self.h_layout_box = gtk.HBox()
        self.add(self.v_layout_box)
        self.v_layout_box.pack_start(self.h_layout_box, True, True)
        
        # Init separator.
        if add_separator:
            self.separator = gtk.HBox()
            self.separator.set_size_request(-1, 1)
            self.separator.connect("expose-event", self.expose_titlebar_separator)
            self.v_layout_box.pack_start(self.separator, True, True)
        
        # Add drag event box.
        self.drag_box = EventBox()
        self.h_layout_box.pack_start(self.drag_box, True, True)
        
        # Init left box to contain icon and title.
        self.left_box = gtk.HBox()
        self.drag_box.add(self.left_box)
        
        # Add icon.
        if icon_dpixbuf != None:
            self.icon_image_box = ImageBox(icon_dpixbuf)
            self.icon_align = gtk.Alignment()
            self.icon_align.set(0.5, 0.5, 0.0, 0.0)
            self.icon_align.set_padding(5, 5, 5, 0)
            self.icon_align.add(self.icon_image_box)
            self.left_box.pack_start(self.icon_align, False, False)
                    
        # Add app name.
        if app_name != None:
            self.app_name_box = Label(app_name, enable_gaussian=True)
            self.app_name_align = gtk.Alignment()
            self.app_name_align.set(0.5, 0.5, 0.0, 0.0)
            self.app_name_align.set_padding(2, 0, 5, 0)
            self.app_name_align.add(self.app_name_box)
            self.left_box.pack_start(self.app_name_align, False, False)
        
        # Add title.
        if title != None:
            self.title_box = Label(title, enable_gaussian=True, text_x_align=pango.ALIGN_CENTER)
            self.title_align = gtk.Alignment()
            self.title_align.set(0.5, 0.5, 0.0, 0.0)
            self.title_align.set_padding(2, 0, 30, 30)
            self.title_align.add(self.title_box)
            self.left_box.pack_start(self.title_align, True, True)
            
        # Add button box.
        self.button_box = gtk.HBox()
        self.button_align = gtk.Alignment()
        self.button_align.set(1.0, 0.0, 0.0, 0.0)
        self.button_align.set_padding(0, 0, 0, 0)
        self.button_align.add(self.button_box)
        self.h_layout_box.pack_start(self.button_align, False, False)
        
        # Add theme button.
        if "theme" in button_mask:
            self.theme_button = ThemeButton()
            self.button_box.pack_start(self.theme_button, False, False, 1)
            Tooltip.text(self.theme_button, _("Change skin")).show_delay(self.theme_button, 2000)

        # Add menu button.
        if "menu" in button_mask:
            self.menu_button = MenuButton()
            self.button_box.pack_start(self.menu_button, False, False, 1)
            Tooltip.text(self.menu_button, _("Main menu")).show_delay(self.menu_button, 2000)
        
        # Add min button.
        if "min" in button_mask:
            self.min_button = MinButton()
            self.button_box.pack_start(self.min_button, False, False, 1)
            Tooltip.text(self.min_button, _("Minimum")).show_delay(self.min_button, 2000)        
            
        # Add max button.
        if "max" in button_mask:
            self.max_button = MaxButton()
            self.button_box.pack_start(self.max_button, False, False, 1)
            Tooltip.text(self.max_button, _("Maximize")).show_delay(self.max_button, 2000)        

        # Add close button.
        if "close" in button_mask:
            self.close_button = CloseButton()
            self.button_box.pack_start(self.close_button, False, False)
            Tooltip.text(self.close_button, _("Close")).show_delay(self.close_button, 2000)        
        
        # Show.
        self.show_all()