当前位置: 首页>>代码示例>>Python>>正文


Python Button.set_size_request方法代码示例

本文整理汇总了Python中dtk.ui.button.Button.set_size_request方法的典型用法代码示例。如果您正苦于以下问题:Python Button.set_size_request方法的具体用法?Python Button.set_size_request怎么用?Python Button.set_size_request使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dtk.ui.button.Button的用法示例。


在下文中一共展示了Button.set_size_request方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: BluetoothReplyDialog

# 需要导入模块: from dtk.ui.button import Button [as 别名]
# 或者: from dtk.ui.button.Button import set_size_request [as 别名]
class BluetoothReplyDialog(DialogBox):
    DIALOG_MASK_SINGLE_PAGE = 0

    def __init__(self, message, default_width=300, default_height=140, is_succeed=True):
        DialogBox.__init__(self, "", default_width, default_height, self.DIALOG_MASK_SINGLE_PAGE)

        self.hbox = gtk.HBox()
        self.image_align = gtk.Alignment()
        self.image_align.set(0, 0, 0, 0)
        self.image_align.set_padding(0, 0, 20, 0)
        self.image_box = ImageBox(app_theme.get_pixbuf("bluetooth/succeed.png"))
        if not is_succeed:
            self.image_box = ImageBox(app_theme.get_pixbuf("bluetooth/failed.png"))
        self.image_align.add(self.image_box)
        self.message_align = gtk.Alignment()
        self.message_align.set(0, 0, 0, 0)
        self.message_align.set_padding(20, 0, 10, 0)
        if not is_succeed:
            self.message_align.set_padding(0, 0, 10, 0)
        self.message_label = Label(message, wrap_width = 200)
        self.message_align.add(self.message_label)
        self.hbox.pack_start(self.image_align)
        self.hbox.pack_start(self.message_align)
        self.confirm_align = gtk.Alignment()
        self.confirm_align.set(0, 0, 0, 0)
        self.confirm_align.set_padding(20, 0, 200, 0)
        self.confirm_button = Button(_("Ok"))
        self.confirm_button.set_size_request(70, WIDGET_HEIGHT)
        self.confirm_button.connect("clicked", lambda widget : self.destroy())
        self.confirm_align.add(self.confirm_button)

        self.body_box.pack_start(self.hbox, False, False)
        self.body_box.pack_start(self.confirm_align, False, False)
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:35,代码来源:bluetooth_dialog.py

示例2: add_button

# 需要导入模块: from dtk.ui.button import Button [as 别名]
# 或者: from dtk.ui.button.Button import set_size_request [as 别名]
    def add_button(self, add_button):
        container_remove_all(self.buttons_align.get_children()[0])

        self.__setup_reset_button()
        button = Button(add_button)
        button.set_size_request(self.button_width, WIDGET_HEIGHT)
        button.connect("clicked", self.__add_button_clicked, add_button)
        self.buttons_list = []
        self.buttons_list.append(button)
        self.buttons_list.append(self.reset_button)
        self.buttons_align = self.__setup_buttons_align(self.buttons_list)        
        self.right_box.pack_start(self.buttons_align)
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:14,代码来源:foot_box.py

示例3: BluetoothProgressDialog

# 需要导入模块: from dtk.ui.button import Button [as 别名]
# 或者: from dtk.ui.button.Button import set_size_request [as 别名]
class BluetoothProgressDialog(DialogBox):
    DIALOG_MASK_SINGLE_PAGE = 0

    def __init__(self, default_width=300, default_height=160, cancel_cb=None):
        DialogBox.__init__(self, "", default_width, default_height, self.DIALOG_MASK_SINGLE_PAGE)

        self.cancel_cb = cancel_cb

        self.message_align = gtk.Alignment()
        self.message_align.set(0, 0, 0, 0)
        self.message_align.set_padding(0, 0, 10, 0)
        self.message_label = Label("", label_width=300)
        self.message_align.add(self.message_label)
        self.progress_align = gtk.Alignment()
        self.progress_align.set(0, 0, 0, 0)
        self.progress_align.set_padding(20, 0, 10, 10)
        self.progress_bar = ProgressBar()
        self.progress_bar.set_size_request(default_width, -1)
        self.progress_align.add(self.progress_bar)
        self.percentage_align = gtk.Alignment()
        self.percentage_align.set(0, 0, 0, 0)
        self.percentage_align.set_padding(10, 0, 140, 0)
        self.percentage_label = Label("0%", label_width=300)
        self.percentage_label.set_size_request(default_width, -1)
        self.percentage_align.add(self.percentage_label)
        self.cancel_align = gtk.Alignment()
        self.cancel_align.set(0, 0, 0, 0)
        self.cancel_align.set_padding(20, 0, 200, 0)
        self.cancel_button = Button(_("Cancel"))
        self.cancel_button.set_size_request(70, WIDGET_HEIGHT)
        self.cancel_button.connect("clicked", self.__on_cancel_button_clicked)
        self.cancel_align.add(self.cancel_button)

        self.body_box.pack_start(self.message_align, False, False)
        self.body_box.pack_start(self.progress_align, False, False)
        self.body_box.pack_start(self.percentage_align, False, False)
        self.body_box.pack_start(self.cancel_align)

    def set_message(self, message):
        self.message_label.set_text(message)

    def set_progress(self, progress):
        self.progress_bar.set_progress(progress)
        self.percentage_label.set_text(_("Sent %d") % progress + "%")

    def __on_cancel_button_clicked(self, widget):
        if self.cancel_cb:
            self.cancel_cb()
            self.destroy()
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:51,代码来源:bluetooth_dialog.py

示例4: Sections

# 需要导入模块: from dtk.ui.button import Button [as 别名]
# 或者: from dtk.ui.button.Button import set_size_request [as 别名]
class Sections(gtk.Alignment):

    def __init__(self, connection, set_button, settings_obj=None):
        gtk.Alignment.__init__(self, 0, 0 ,0, 0)
        self.set_padding(35, 0, 20, 0)

        self.main_box = gtk.VBox()
        self.tab_name = "sfds"
        basic = SettingSection(_("Basic"))

        self.button = Button(_("Advanced"))
        self.button.set_size_request(50, 22)
        self.button.connect("clicked", self.show_more_options)
        self.broadband = SettingSection(_("Broadband"), always_show=True)
        self.ipv4 = SettingSection(_("IPv4 settings"), always_show=True)
        self.ppp = SettingSection(_("PPP"), always_show=True)
        align = gtk.Alignment(0, 0, 0, 0)
        align.set_padding(0, 0, 225, 0)
        align.add(self.button)
        
        self.broadband = Broadband(connection, set_button, settings_obj)
        basic.load([self.broadband, align])
        self.ipv4.load([IPV4Conf(connection, set_button, settings_obj=settings_obj)])
        self.ppp.load([PPPConf(connection, set_button, settings_obj)])

        self.space = gtk.HBox()
        self.space.set_size_request(-1 ,30)

        self.main_box.pack_start(basic, False, False)

        self.add(self.main_box)

    def show_more_options(self, widget):
        widget.destroy()
        #self.main_box.pack_start(self.space, False, False)
        self.main_box.pack_start(self.ipv4, False, False)
        self.main_box.pack_start(self.ppp, False, False, 15)
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:39,代码来源:mobile_config.py

示例5: FaceRecordPage

# 需要导入模块: from dtk.ui.button import Button [as 别名]
# 或者: from dtk.ui.button.Button import set_size_request [as 别名]
class FaceRecordPage(gtk.VBox):
    def __init__(self, account_setting):
        gtk.VBox.__init__(self)
        self.account_setting = account_setting
        
        self.camera_pixbuf = app_theme.get_pixbuf("account/camera.png").get_pixbuf()
        self.error_pixbuf = app_theme.get_pixbuf("account/error.png").get_pixbuf()
        self.success_pixbuf = app_theme.get_pixbuf("account/success.png").get_pixbuf()

        self.camera_box_align = gtk.Alignment(0.5, 0, 0, 0)
        self.camera_box = gtk.VBox()
        self.camera_box.set_size_request(CAMERA_BOX_SIZE, CAMERA_BOX_SIZE)
        self.camera_box.connect("expose-event", self.__camera_box_expose)
        self.camera_box_align.add(self.camera_box)

        self.under_camera_box = gtk.VBox(spacing=10)
        self.under_camera_box_align = gtk.Alignment(0.5, 0, 0, 0)
        self.under_camera_box_align.set_padding(WIDGET_SPACING, 0, 0, 0)
        self.under_camera_box_align.add(self.under_camera_box)
        self.__init_widgets()
        if Webcam.has_device():
            self.under_camera_box.pack_start(self.start_record_button)
        else:
            self.under_camera_box.pack_start(self.no_device_warning)

        self.pack_start(self.camera_box_align, False, False)
        self.pack_start(self.under_camera_box_align, False, False)

    def __init_widgets(self):
        self.start_record_button = Button(_("Start"))
        self.start_record_button.set_size_request(CAMERA_BOX_SIZE, 25)
        self.start_record_button.connect("clicked", self.__start_record_clicked)
        
        self.no_device_warning = Label(_("Please plug in or enable your camera"), label_width=300, text_x_align=pango.ALIGN_CENTER)
        self.keep_few_minutes = Label(_("Please keep still for 5 seconds"), label_width=300, text_x_align=pango.ALIGN_CENTER)
        # self.success = Label(_("Your face has been successfully recorded"), label_width=300, text_x_align=pango.ALIGN_CENTER)
        self.fail = Label(_("Failed to record your face"), label_width=300, text_x_align=pango.ALIGN_CENTER)
        
        self.success = gtk.Alignment(0.5, 0.5, 0, 0)
        self.success.set_size_request(300, -1)
        self.success_img = gtk.Image()
        self.success_img.set_from_pixbuf(self.success_pixbuf)
        self.success_box = gtk.HBox()
        self.success_box.pack_start(self.success_img, False, False, 5)
        self.success_box.pack_start(Label(_("Your face has been successfully recorded")))
        self.success.add(self.success_box)

    def refresh(self):
        container_remove_all(self.camera_box)
        container_remove_all(self.under_camera_box)
        if Webcam.has_device():
            self.under_camera_box.pack_start(self.start_record_button)
        else:
            self.under_camera_box.pack_start(self.no_device_warning)        

    def __start_record_clicked(self, widget):
        container_remove_all(self.under_camera_box)
        self.under_camera_box.pack_start(self.keep_few_minutes)
        
        self.webcam_align = gtk.Alignment(0, 0.5, 0, 0)
        self.webcam_align.set_padding(5, 5, 5, 5)
        if not hasattr(self.account_setting, "record_webcam"):
            self.account_setting.record_webcam = Webcam()
            self.account_setting.record_webcam.set_size_request(WEBCAM_SIZE, min(WEBCAM_SIZE, 240))
            self.account_setting.record_webcam.create_video_pipeline(320, 240)
        self.webcam_align.add(self.account_setting.record_webcam)
        container_remove_all(self.camera_box)
        self.camera_box.add(self.webcam_align)
        self.account_setting.record_webcam.play()
        gobject.timeout_add(2000, self.__do_save_photo, 0)
        gobject.timeout_add(2500, self.__do_save_photo, 1)
        gobject.timeout_add(3000, self.__do_save_photo, 2)
        gobject.timeout_add(3500, self.__do_save_photo, 3)
        
        gobject.timeout_add(4000, self.__do_action)
        
    def __do_save_photo(self, num):
        pixbuf = self.account_setting.record_webcam.get_snapshot()
        path = "/tmp/face_recognition_%s.png" % num
        pixbuf.save(path, "png")
        
    # def __do_detection(self):
        
    #     def recognition_process(pixbuf):
    #         path = "/tmp/face_recognition_%s.png" % thread.get_ident()
    #         pixbuf.save(path, "png")
    #         result = facepp.detection.detect(img=File(path), mode="oneface")
    #         print result
    #         if result["face"]:
    #             try:
    #                 facepp.person.create(person_name=get_person_name())
    #             except:
    #                 pass
    #             facepp.person.add_face(person_name=get_person_name(), face_id=result["face"][0]["face_id"])
        
    #     pixbuf = self.account_setting.record_webcam.get_snapshot()
    #     # gtk.gdk.threads_enter()
    #     # Thread(target=recognition_process, args=[pixbuf]).start()
    #     # gtk.gdk.threads_leave()
    #     recognition_process(pixbuf)
#.........这里部分代码省略.........
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:103,代码来源:face_record_page.py

示例6: DetailPage

# 需要导入模块: from dtk.ui.button import Button [as 别名]
# 或者: from dtk.ui.button.Button import set_size_request [as 别名]
class DetailPage(gtk.VBox):
    """
    class docs
    """

    def __init__(self):
        """
        init docs
        """
        gtk.VBox.__init__(self)

        self.__background_settings = deepin_gsettings.new("com.deepin.dde.background")

        self.draw_title_background = self.draw_tab_title_background
        self.theme = None

        self.wallpaper_box = gtk.VBox()
        self.window_theme_box = gtk.VBox()
        self.wallpaper_view = WallpaperView(padding_x=30, padding_y=ITEM_PADDING_Y)
        self.wallpaper_view_sw = self.wallpaper_view.get_scrolled_window()
        self.wallpaper_view_sw.set_size_request(-1, 426)

        position_group, self.position_combobox = get_combo_group(
            _("Position"), DRAW_COMBO_ITEM, self.on_position_combox_selected
        )
        time_group, self.time_combobox = get_combo_group(_("Duration"), TIME_COMBO_ITEM, self.on_time_combox_selected)

        self.__is_random = True
        if self.__background_settings.get_int("background-duration") == 0:
            self.__is_random = False
        self.unorder_play, self.random_toggle = get_toggle_group(
            _("Random"), self.__on_random_toggled, self.__is_random
        )
        self.button_align = gtk.Alignment()
        self.button_box = gtk.HBox(spacing=5)
        self.select_all_button = Button(_("Select all"))
        self.select_all_button.set_size_request(80, WIDGET_HEIGHT)
        self.select_all_button.connect("clicked", self.__on_select_all)
        self.delete_button = Button(_("Delete"))
        self.delete_button.set_size_request(80, WIDGET_HEIGHT)
        self.delete_button.connect("clicked", self.__on_delete)
        self.button_box.pack_start(self.select_all_button, False, False)
        self.button_box.pack_start(self.delete_button, False, False)
        self.button_align.add(self.button_box)

        self.action_bar = gtk.HBox(spacing=26)
        self.action_bar.pack_start(position_group, False, False)
        self.action_bar.pack_start(time_group, False, False)
        self.action_bar.pack_start(self.unorder_play, False, False)
        self.action_bar.pack_end(self.button_align, False, False)
        action_bar_align = gtk.Alignment()
        action_bar_align.set_size_request(-1, STATUS_HEIGHT)
        action_bar_align.set_padding(5, 5, 50, 20)
        action_bar_align.add(self.action_bar)

        self.wallpaper_box.pack_start(self.wallpaper_view_sw, True, True)
        self.wallpaper_box.pack_start(action_bar_align, False, False)

        self.pack_start(self.wallpaper_box, False, False)

        event_manager.add_callback("select-wallpaper", self.on_wallpaper_select)
        event_manager.add_callback("apply-wallpaper", self.__on_wallpaper_apply)
        event_manager.add_callback("add-wallpapers", self.__on_add_wallpapers)

    def __random_enable(self):
        self.time_combobox.set_sensitive(True)
        self.unorder_play.set_child_visible(True)
        self.random_toggle.set_child_visible(True)
        self.random_toggle.set_active(self.theme.get_background_random_mode())

    def __random_disable(self):
        self.time_combobox.set_sensitive(False)
        self.unorder_play.set_child_visible(False)
        self.random_toggle.set_child_visible(False)
        self.random_toggle.set_active(self.theme.get_background_random_mode())

    def on_wallpaper_select(self, name, obj, select_item):
        if self.wallpaper_view.is_randomable():
            self.__random_enable()
        else:
            self.__random_disable()

        if self.wallpaper_view.is_select_all():
            self.select_all_button.set_label(_("Clear all"))
        else:
            self.select_all_button.set_label(_("Select all"))
        self.select_all_button.set_size_request(80, WIDGET_HEIGHT)

    def __on_wallpaper_apply(self, name, obj, select_item):
        self.__random_disable()

        if self.wallpaper_view.is_select_all():
            self.select_all_button.set_label(_("Clear all"))
        else:
            self.select_all_button.set_label(_("Select all"))
        self.select_all_button.set_size_request(80, WIDGET_HEIGHT)

    def __on_select_all(self, widget):
        self.wallpaper_view.select_all()
        if self.wallpaper_view.is_select_all():
#.........这里部分代码省略.........
开发者ID:martyr-deepin,项目名称:deepin-system-settings,代码行数:103,代码来源:detail_page.py

示例7: Login

# 需要导入模块: from dtk.ui.button import Button [as 别名]
# 或者: from dtk.ui.button.Button import set_size_request [as 别名]
class Login(Window):
    def __init__(self):
        Window.__init__(self, enable_resize=True)
        self.set_position(gtk.WIN_POS_CENTER)
        self.set_default_size(290, 512)
        titlebar = Titlebar(["min", "max", "close"], app_name="Baidu Hi for Linux")
        titlebar.min_button.connect("clicked", lambda w: self.min_window())
        titlebar.max_button.connect("clicked", lambda w: self.toggle_max_window())
        titlebar.close_button.connect("clicked", lambda w: gtk.main_quit())
        self.add_move_event(titlebar.drag_box)
        self.add_toggle_event(titlebar.drag_box)
        
        banner_image = gtk.image_new_from_file(get_banner_image())
        banner_box = set_widget_gravity(banner_image, (0,0,0,0), (10, 0, 0, 0))
        user_box, self.user_entry = self.create_combo_entry("帐号:")
        passwd_box, self.passwd_entry = self.create_combo_entry("密码:")
        self.remember_passwd = CheckButton("记住密码")
        self.automatic_login = CheckButton("自动登录")
        self.status_box, self.status_combo_box = self.create_combo_widget("状态:", 
                                                     [(key, None) for key in "在线 忙碌 离开 隐身".split()],
                                                     0)
        
        check_box = gtk.HBox(spacing=10)
        check_box.pack_start(self.remember_passwd, False, False)
        check_box.pack_start(self.automatic_login, False, False)
        
        body_table = gtk.Table(5, 1)
        body_table.set_row_spacings(10)
        body_table.attach(banner_box, 0, 1, 0, 1, xoptions=gtk.FILL, yoptions=gtk.FILL)
        body_table.attach(user_box, 0, 1, 1, 2, xoptions=gtk.FILL, yoptions=gtk.FILL, xpadding=8)
        body_table.attach(passwd_box, 0, 1, 2, 3, xoptions=gtk.FILL, yoptions=gtk.FILL, xpadding=8)
        # body_table.attach(self.status_box, 0, 1, 3, 4, xoptions=gtk.FILL, yoptions=gtk.FILL, xpadding=8)        
        body_table.attach(check_box, 0, 1, 4, 5, xoptions=gtk.FILL, yoptions=gtk.FILL)
        
        body_box_align = set_widget_gravity(set_widget_center(body_table), 
                                            (1, 1, 0.5, 0.5),
                                            (0, 0, 30, 30))
        
        self.login_button = Button("登录")
        self.login_button.set_size_request(95, 30)
        login_button_align = set_widget_gravity(set_widget_center(self.login_button),
                                                (1, 1, 0.5, 0.5),
                                                (30, 30, 0, 0))
        
        main_box = gtk.VBox()        
        main_box.connect("expose-event", self.draw_border_mask)
        main_box.pack_start(body_box_align, False, True)
        main_box.pack_start(login_button_align, False, True)
        
        self.window_frame.pack_start(titlebar, False, True)
        self.window_frame.pack_start(main_box)
        
        
    def create_combo_entry(self, label_content, entry_content=""):    
        vbox = gtk.VBox()
        vbox.set_spacing(5)
        label = Label(label_content)
        text_entry = TextEntry(entry_content)
        text_entry.set_size(198, 26)
        entry_box = set_widget_center(text_entry)
        vbox.pack_start(label, False, False)
        vbox.pack_start(entry_box, False, False)
        return vbox, text_entry
    
    def draw_border_mask(self, widget, event):    
        cr = widget.window.cairo_create()
        rect = widget.allocation
        draw_vlinear(cr, rect.x + 8, rect.y + 6, rect.width - 16, rect.height - 16,
                     app_theme.get_shadow_color("linearBackground").get_color_info(),
                     4)
        
    def create_combo_widget(self, label_content, items, select_index=0):
        label = Label(label_content)
        combo_box = ComboBox(items, select_index=select_index)
        hbox = gtk.HBox(spacing=5)
        hbox.pack_start(label, False, False)
        hbox.pack_start(combo_box, False, False)
        return hbox, combo_box
开发者ID:GlacierHw,项目名称:GHi,代码行数:80,代码来源:login.py

示例8: DeletePage

# 需要导入模块: from dtk.ui.button import Button [as 别名]
# 或者: from dtk.ui.button.Button import set_size_request [as 别名]
class DeletePage(gtk.VBox):
    '''
    class docs
    '''
	
    def __init__(self):
        '''
        init docs
        '''
        gtk.VBox.__init__(self)

        self.draw_title_background = self.draw_tab_title_background
        self.theme = None
        
        self.delete_view = DeleteView(padding_x=30, padding_y=ITEM_PADDING_Y)
        self.delete_view_sw = self.delete_view.get_scrolled_window()
        
        self.action_align = gtk.Alignment()
        self.action_align.set_padding(5, 5, 510, 5)
        self.action_box = gtk.HBox(spacing = 10)
        self.back_button = Button(_("Back"))
        self.back_button.set_size_request(80, WIDGET_HEIGHT)
        self.back_button.connect("clicked", self.__on_back)
        self.select_all_button = Button(_("Select all"))
        self.select_all_button.set_size_request(80, WIDGET_HEIGHT)
        self.select_all_button.connect("clicked", self.__on_select_all)
        self.delete_button = Button(_("Delete"))
        self.delete_button.set_size_request(80, WIDGET_HEIGHT)
        self.delete_button.connect("clicked", self.__on_delete)
        self.action_box.pack_start(self.select_all_button, False, False)
        self.action_box.pack_start(self.delete_button, False, False)
        self.action_box.pack_start(self.back_button, False, False)
        self.action_align.add(self.action_box)
        
        self.pack_start(self.delete_view_sw, True, True)
        self.pack_start(self.action_align, False, False)

        event_manager.add_callback("select-delete-wallpaper", self.__on_select_delete_wallpaper)

    def __on_back(self, widget):
        event_manager.emit("back-to-detailpage", self.theme)

    def __on_select_delete_wallpaper(self, name, obj, select_item):
        if self.delete_view.is_select_all():                                    
            self.select_all_button.set_label(_("Clear all"))                 
        else:                                                                   
            self.select_all_button.set_label(_("Select all"))
        self.select_all_button.set_size_request(80, WIDGET_HEIGHT)

    def __on_select_all(self, widget):
        self.delete_view.select_all()
        if self.delete_view.is_select_all():
            self.select_all_button.set_label(_("Clear all"))
        else:
            self.select_all_button.set_label(_("Select all"))
        self.select_all_button.set_size_request(80, WIDGET_HEIGHT)

    def __delete_confirm(self):
        self.delete_view.delete_wallpaper()

    def __on_delete(self, widget):
        if self.delete_view.is_deletable():
            dlg = ConfirmDialog(_("Delete Wallpaper"),                                  
                                _("Are you sure delete wallpaper?"), 
                                300,                                                
                                100,                                                
                                lambda : self.__delete_confirm(),                   
                                None,                                               
                                True, 
                                CONTENT_FONT_SIZE)                                               
            dlg.show_all()

    def draw_tab_title_background(self, cr, widget):
        rect = widget.allocation
        cr.set_source_rgb(1, 1, 1)    
        cr.rectangle(0, 0, rect.width, rect.height - 1)
        cr.fill()

    def set_theme(self, theme):
        self.theme = theme
        self.delete_view.set_theme(self.theme)
        self.select_all_button.set_label(_("Select all"))
        self.select_all_button.set_size_request(80, WIDGET_HEIGHT)
        
    def draw_mask(self, cr, x, y, w, h):
        '''
        Draw mask interface.
        
        @param cr: Cairo context.
        @param x: X coordiante of draw area.
        @param y: Y coordiante of draw area.
        @param w: Width of draw area.
        @param h: Height of draw area.
        '''
        cr.set_source_rgb(1, 1, 1)
        cr.rectangle(x, y, w, h)
        cr.fill()
开发者ID:electricface,项目名称:deepin-system-settings,代码行数:99,代码来源:delete_page.py

示例9: Form

# 需要导入模块: from dtk.ui.button import Button [as 别名]
# 或者: from dtk.ui.button.Button import set_size_request [as 别名]

#.........这里部分代码省略.........
            "600 x 1024",
            "640 x 480",
            "720 x 1280",
            "800 x 480",
            "800 x 600",
            "1024 x 600",
            "1024 x 768",
            "1152 x 864",
        ]
        self.ratio_items = []
        for ratio in self.__ratio_list:
            self.ratio_combo.append_text(ratio)
            self.ratio_items.append((ratio, ratio))
        self.ratio_combo.set_active(5)
        # brand_combo.
        brand_items = []
        for brand in self.read_xml.brand_dict.keys():
            brand_po = brand
            if self.brand_dict.has_key(brand):
                brand_po = self.brand_dict[brand]
            brand_items.append((brand_po, brand))

        self.brand_combo.set_items(brand_items, 0)
        # self.brand_combo.add_items(brand_items, 0)

        self.brand_combo.prepend_text(_("No Presets"))
        self.brand_combo.connect("changed", self.brand_combo_item_selected)
        # model_combo.
        self.model_label.set_sensitive(False)
        self.model_combo.set_sensitive(False)
        self.model_combo.prepend_text(_("No Model"))
        self.model_combo.connect("changed", self.model_combo_item_selected)
        #
        self.save_chooser_btn.set_size_request(75, 21)
        self.save_chooser_btn.connect("clicked", self.save_chooser_btn_clicked)

        # path_entry.
        PATH_ENTRY_WIDTH = 240
        PATH_ENTRY_HEIGHT = 22
        self.save_path_entry.set_sensitive(False)
        self.save_path_entry.set_text(self.get_home_path())
        self.save_path_entry.set_size(PATH_ENTRY_WIDTH, PATH_ENTRY_HEIGHT)
        self.close_btn.connect("clicked", lambda w: self.hide_all())
        # higt_set_btn.
        self.higt_set_btn.connect("clicked", self.higt_set_btn_clicked)

        # form body box add main fixed.
        self.body_table_ali = gtk.Alignment()
        self.body_table_ali.set_padding(6, 0, 0, 0)
        self.body_table = gtk.Table(rows=6, columns=4, homogeneous=False)
        self.body_table_ali.add(self.body_table)

        self.brand_model_hbox = gtk.HBox()
        top, bottom = 5, 5
        brand_position = eval(_("('brand_position', 20)"))
        model_position = eval(_("('model_position', 20)"))
        self.brand_hbox_ali, self.brand_hbox = self.create_hbox(
            bottom, top, 15 + int(brand_position[1]), 0, self.brand_label, self.brand_combo
        )
        self.model_hbox_ali, self.model_hbox = self.create_hbox(
            bottom, top, 50 - int(model_position[1]), 0, self.model_label, self.model_combo
        )

        self.brand_model_hbox.pack_start(self.brand_hbox_ali, False, False)
        self.brand_model_hbox.pack_start(self.model_hbox_ali, False, False)
        format_position = eval(_("('format_position', 12)"))
开发者ID:martyr-deepin,项目名称:deepin-media-player,代码行数:70,代码来源:gui.py


注:本文中的dtk.ui.button.Button.set_size_request方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。