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


Python Button.size_hint_weight方法代码示例

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


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

示例1: __init__

# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import size_hint_weight [as 别名]
 def __init__(self):
     StandardWindow.__init__(self, "ex4", "Align Example", size=(300, 200))
     self.callback_delete_request_add(lambda o: elm.exit())
     
     ourButton = Button(self)
     ourButton.size_hint_weight = EXPAND_BOTH
     ourButton.size_hint_align = (0, 0)
     ourButton.text = "Button 1"
     ourButton.show()
     
     ourButton2 = Button(self)
     ourButton2.size_hint_weight = EXPAND_BOTH
     ourButton2.size_hint_align = FILL_BOTH
     ourButton2.text = "Button 2"
     ourButton2.show()
     
     ourButton3 = Button(self)
     ourButton3.size_hint_weight = EXPAND_BOTH
     ourButton3.size_hint_align = (1, 1)
     ourButton3.text = "Button 3"
     ourButton3.show()
     
     ourBox = Box(self)
     ourBox.size_hint_weight = EXPAND_BOTH
     ourBox.pack_end(ourButton)
     ourBox.pack_end(ourButton2)
     ourBox.pack_end(ourButton3)
     ourBox.show()
     
     self.resize_object_add(ourBox)
开发者ID:JeffHoogland,项目名称:elm-tutorials,代码行数:32,代码来源:ex4-alignment.py

示例2: theme_clicked

# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import size_hint_weight [as 别名]
def theme_clicked(obj, data=None):

    win = StandardWindow("config", "Theme", autodel=True, size=(400,200))
    if obj is None:
        win.callback_delete_request_add(lambda o: elementary.exit())

    box = Box(win)
    box.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
    box.show()
    win.resize_object_add(box)

    bt = Button(win, text = "A button with a custom style")
    bt.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
    bt.style = "my_custom_style"
    bt.show()
    box.pack_end(bt)

    bt = Button(win, text = "A button with default style")
    bt.size_hint_weight = EVAS_HINT_EXPAND, EVAS_HINT_EXPAND
    bt.show()
    box.pack_end(bt)

    sep = Separator(win, horizontal=True)
    sep.show()
    box.pack_end(sep)
    
    hbox = Box(win, horizontal=True)
    hbox.show()
    box.pack_end(hbox)

    bt = Button(win, text = "Add Extension")
    bt.callback_clicked_add(add_ext_clicked_cb)
    bt.show()
    hbox.pack_end(bt)

    bt = Button(win, text = "Remove Extension")
    bt.callback_clicked_add(del_ext_clicked_cb)
    bt.show()
    hbox.pack_end(bt)

    bt = Button(win, text = "Add Overlay")
    bt.callback_clicked_add(add_ovr_clicked_cb)
    bt.show()
    hbox.pack_end(bt)

    bt = Button(win, text = "Remove Overlay")
    bt.callback_clicked_add(del_ovr_clicked_cb)
    bt.show()
    hbox.pack_end(bt)

    win.show()
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:53,代码来源:test_theme.py

示例3: __init__

# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import size_hint_weight [as 别名]
    def __init__(self):
        StandardWindow.__init__(self, "ex7", "Naviframe", size=(300, 200))
        self.callback_delete_request_add(lambda o: elm.exit())

        staticImage = staticImage = Image(self)
        staticImage.size_hint_weight = EXPAND_BOTH
        staticImage.file_set("images/logo.png")
        staticImage.tooltip_text_set("A picture!")
        staticImage.show()
        
        ourLabel = ourLabel = Label(self)
        ourLabel.size_hint_weight = EXPAND_BOTH
        ourLabel.text = "Hey look some text!"
        ourLabel.show()
        
        self.nf = Naviframe(self)
        self.nf.size_hint_weight = EXPAND_BOTH
        self.nf.size_hint_align = FILL_BOTH
        self.nf.show()
        
        buttonOne = Button(self)
        buttonOne.size_hint_weight = EXPAND_BOTH
        buttonOne.text = "Show image"
        buttonOne.callback_clicked_add(self.buttonPressed, staticImage)
        buttonOne.show()
        
        buttonTwo = Button(self)
        buttonTwo.size_hint_weight = EXPAND_BOTH
        buttonTwo.text = "Show label"
        buttonTwo.callback_clicked_add(self.buttonPressed, ourLabel)
        buttonTwo.show()
        
        buttonBox = Box(self)
        buttonBox.size_hint_weight = EXPAND_HORIZ
        buttonBox.horizontal_set(True)
        buttonBox.pack_end(buttonOne)
        buttonBox.pack_end(buttonTwo)
        buttonBox.show()
        
        mainBox = Box(self)
        mainBox.size_hint_weight = EXPAND_BOTH
        mainBox.pack_end(self.nf)
        mainBox.pack_end(buttonBox)
        mainBox.show()
        
        self.nf.item_simple_push(staticImage)
        
        self.resize_object_add(mainBox)
开发者ID:JeffHoogland,项目名称:elm-tutorials,代码行数:50,代码来源:ex7-naviframe.py

示例4: __init__

# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import size_hint_weight [as 别名]
    def __init__(self):
        StandardWindow.__init__(self, "ex2", "Hello Elementary", size=(300, 200))
        self.callback_delete_request_add(lambda o: elm.exit())

        ourLabel = Label(self)
        ourLabel.size_hint_weight = EXPAND_BOTH
        ourLabel.text = "Hello Elementary!"
        ourLabel.show()
        
        ourButton = Button(self)
        ourButton.size_hint_weight = EXPAND_BOTH
        ourButton.text = "Goodbye Elementary"
        ourButton.callback_clicked_add(self.buttonPressed)
        ourButton.show()
        
        ourBox = Box(self)
        ourBox.size_hint_weight = EXPAND_BOTH
        ourBox.pack_end(ourLabel)
        ourBox.pack_end(ourButton)
        ourBox.show()
        
        self.resize_object_add(ourBox)
开发者ID:JeffHoogland,项目名称:elm-tutorials,代码行数:24,代码来源:ex2-helloelementary.py

示例5: __init__

# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import size_hint_weight [as 别名]
    def __init__(self,
                 command=None, win=None,
                 start_callback=None, end_callback=None,
                 *args, **kwargs):
        if not win:
            nowindow = True
            win = self.win = Window("esudo", ELM_WIN_DIALOG_BASIC)
            win.title = "eSudo"
            win.borderless = True
            win.size_hint_weight = evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND
            win.size_hint_align = evas.EVAS_HINT_FILL, evas.EVAS_HINT_FILL
            win.resize(300, 200)
            win.callback_delete_request_add(lambda o: elementary.exit())
            win.layer_set(11)
            #~ win.fullscreen = True
            win.show()
            win.activate()

            bg = Background(win)
            bg.size_hint_weight = 1.0, 1.0
            win.resize_object_add(bg)
            bg.show()

            self.embedded = False
        else:
            nowindow = False
            self.embedded = True

        self.cmd = command
        self.start_cb = start_callback if callable(start_callback) else None
        self.end_cb = end_callback if callable(end_callback) else None
        self.args = args
        self.kwargs = kwargs

#--------eSudo Window
        bz = Box(win)
        if nowindow:
            bz.size_hint_weight = evas.EVAS_HINT_EXPAND, 0.0
        else:
            bz.size_hint_weight = evas.EVAS_HINT_EXPAND, evas.EVAS_HINT_EXPAND
        bz.size_hint_align = evas.EVAS_HINT_FILL, 0.0
        bz.show()

        if nowindow:
            lbl = Label(win)
            lbl.style = "marker"
            lbl.color = 170, 170, 170, 255
            lbl.size_hint_align = 0.5, 0.0
            lbl.scale = 2.0
            lbl.text = "<b>eSudo</b>"
            bz.pack_end(lbl)
            lbl.show()

            sep = Separator(win)
            sep.horizontal = True
            bz.pack_end(sep)
            sep.show()

        fr = Frame(win)
        fr.text = "Command:"
        fr.size_hint_align = evas.EVAS_HINT_FILL, 0.0
        bz.pack_end(fr)
        fr.show()

        if nowindow:
            sep = Separator(win)
            sep.horizontal = True
            bz.pack_end(sep)
            sep.show()

        self.cmdline = cmdline = Entry(win)
        cmdline.elm_event_callback_add(self.entry_event)
        cmdline.single_line = True
        if self.cmd:
            cmdline.text = self.cmd
            cmdline.editable = False
        fr.content = cmdline
        cmdline.scrollable_set(True)
        cmdline.show()

        if nowindow:
            fr = Frame(win)
            fr.text = "Password:"
            fr.size_hint_align = evas.EVAS_HINT_FILL, 0.0
            bz.pack_end(fr)
            fr.show()
        else:
            bz1 = Box(win)
            bz.pack_end(bz1)
            bz1.show()

            lb = Label(win)
            lb.text = "<b>Password:</b>"
            lb.size_hint_align = 0.0, 0.5
            bz1.pack_end(lb)
            lb.show()

        en = self.en = Entry(win)
        en.name = "password"
        en.elm_event_callback_add(self.entry_event)
#.........这里部分代码省略.........
开发者ID:JeffHoogland,项目名称:esudo,代码行数:103,代码来源:esudo.py


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