本文整理汇总了Python中efl.elementary.button.Button.disabled方法的典型用法代码示例。如果您正苦于以下问题:Python Button.disabled方法的具体用法?Python Button.disabled怎么用?Python Button.disabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类efl.elementary.button.Button
的用法示例。
在下文中一共展示了Button.disabled方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addTab
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import disabled [as 别名]
def addTab(self, widget, tabName, canClose=True, disabled=False):
self.tabs.append(widget)
btn = Button(self.buttonBox, style="anchor", size_hint_align=ALIGN_LEFT)
btn.text = tabName
btn.data["widget"] = widget
btn.disabled = disabled
btn.callback_clicked_add(self.showTab, widget)
btn.show()
icn = Icon(self.buttonBox)
icn.standard_set("gtk-close")
icn.show()
cls = Button(self.buttonBox, content=icn, style="anchor", size_hint_align=ALIGN_LEFT)
cls.data["widget"] = widget
cls.callback_clicked_add(self.closeTab)
cls.disabled = disabled
if canClose:
cls.show()
sep = Separator(self.buttonBox, size_hint_align=ALIGN_LEFT)
sep.show()
self.buttonBox.pack_end(btn)
self.buttonBox.pack_end(cls)
self.buttonBox.pack_end(sep)
#Arguments go: btn, cls, sep
widget.data["close"] = cls
widget.data["button"] = btn
widget.data["sep"] = sep
self.showTab(widget=widget)
示例2: __init__
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import disabled [as 别名]
def __init__(self, win, url=None):
Popup.__init__(self, win)
self.win = win
# title
self.part_text_set('title,text', 'Recent Repositories')
ic = Icon(self, file=theme_resource_get('egitu.png'))
self.part_content_set('title,icon', ic)
# content: recent list
li = List(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
li.callback_activated_add(self.recent_selected_cb)
recents = recent_history_get()
if recents:
for recent_url in recents:
path, name = os.path.split(recent_url)
item = li.item_append(name)
item.data['url'] = recent_url
else:
item = li.item_append('no recent repository')
item.disabled = True
li.show()
# table+rect to respect min size :/
tb = Table(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
r = Rectangle(self.evas, color=(0,0,0,0), size_hint_min=(200,200),
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
tb.pack(r, 0, 0, 1, 1)
tb.pack(li, 0, 0, 1, 1)
self.content = tb
# popup auto-list - not expand well :(
# self.size_hint_weight = EXPAND_BOTH
# self.size_hint_align = FILL_BOTH
# self.size_hint_min = 400, 400
# self.item_append('no recent repos', None)
# self.item_append('asd2', None)
# self.item_append('asd2', None)
# buttons
bt = Button(self, text='Open')
bt.callback_clicked_add(self.load_btn_cb)
self.part_content_set('button1', bt)
bt = Button(self, text='Clone (TODO)')
bt.disabled = True
self.part_content_set('button2', bt)
bt = Button(self, text='Create (TODO)')
bt.disabled = True
self.part_content_set('button3', bt)
if url is not None:
self.try_to_load(url)
else:
self.callback_block_clicked_add(lambda p: p.delete())
self.show()
示例3: header_row_pack
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import disabled [as 别名]
def header_row_pack(self, titles):
"""Takes a list (or a tuple) of tuples (string, bool) and packs them to
the first row of the table."""
assert isinstance(titles, (list, tuple))
for t in titles:
assert isinstance(t, tuple)
assert len(t) == 2
title, sortable = t
assert isinstance(title, basestring)
assert isinstance(sortable, bool)
def sort_btn_cb(button, col):
if self.sort_column == col:
self.reverse()
else:
self.sort_by_column(col)
for count, t in enumerate(titles):
title, sortable = t
btn = Button(self, size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_HORIZ, text=title)
btn.callback_clicked_add(sort_btn_cb, count)
if not sortable:
btn.disabled = True
btn.show()
self.pack(btn, count, 0, 1, 1)
self.header_row.append(btn)
示例4: header_row_pack
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import disabled [as 别名]
def header_row_pack(self, titles):
"""Takes a list (or a tuple) of tuples (string, bool) and packs them to
the first row of the table."""
assert isinstance(titles, (list, tuple))
for t in titles:
assert isinstance(t, tuple)
assert len(t) == 2
title, sortable = t
try:
assert isinstance(title, basestring)
except:
assert isinstance(title, str)
assert isinstance(sortable, bool)
def sort_btn_cb(button, col):
if self.sort_column == col:
self.reverse()
else:
self.sort_by_column(col)
for count, t in enumerate(titles):
title, sortable = t
btn = Button(self, size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_HORIZ, text=title)
btn.callback_clicked_add(sort_btn_cb, count)
if not sortable:
btn.disabled = True
btn.show()
self.header_box.pack_end(btn)
self.header_row.append(btn)
elm_list = ScrollableGenlist(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
elm_list.policy_set(ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_OFF)
elm_list.mode_set(ELM_LIST_EXPAND)
#elm_list.go()
elm_list.show()
self.list_box.pack_end(elm_list)
self.lists.append(elm_list)
sep = Separator(self)
sep.show()
self.header_box.pack_end(sep)
self.header_box.pack_end(sep)
示例5: calendar_clicked
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import disabled [as 别名]
def calendar_clicked(obj, item=None):
win = StandardWindow("calendar", "Calendar", autodel=True)
bx = Box(win, size_hint_weight=EXPAND_BOTH)
win.resize_object_add(bx)
bx.show()
bt = Button(bx, text="Next API function")
bt.callback_clicked_add(api_bt_clicked, api)
bx.pack_end(bt)
if api["state"] == API_STATE_LAST:
bt.disabled = True
bt.show()
the_time = datetime(2010, 12, 31)
cal = Calendar(bx, first_day_of_week=ELM_DAY_MONDAY,
size_hint_weight=EXPAND_BOTH, selected_time=the_time,
min_max_year=(2010,2012))
api["cal"] = cal
bx.pack_end(cal)
cal.show()
win.show()
示例6: header_row_pack
# 需要导入模块: from efl.elementary.button import Button [as 别名]
# 或者: from efl.elementary.button.Button import disabled [as 别名]
def header_row_pack(self, titles):
"""Takes a list (or a tuple) of tuples (string, bool, int) and packs them to
the first row of the table."""
assert isinstance(titles, (list, tuple))
for t in titles:
assert isinstance(t, tuple)
assert len(t) == 2
title, sortable = t
try:
assert isinstance(title, basestring)
except:
assert isinstance(title, str)
assert isinstance(sortable, bool)
def sort_btn_cb(button, col):
if self.sort_column == col:
self.reverse()
else:
self.sort_by_column(col)
titleCount = len(titles)
for count, t in enumerate(titles):
title, sortable = t
btn = Button(self, size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_HORIZ, text=title)
btn.callback_clicked_add(sort_btn_cb, count)
if not sortable:
btn.disabled = True
btn.show()
self.header_row.append(btn)
bx = Box(self, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
bx.show()
if len(self.listPanes) < titleCount:
wdth = 1.0 / (titleCount - count)
self.listPanes[count].part_content_set("left", bx)
self.listPanes[count].content_left_size = wdth
nextList = Panes(self, size_hint_weight=EXPAND_BOTH,
size_hint_align=FILL_BOTH)
nextList.callback_unpress_add(self.paneResized)
nextList.style_set("flush")
nextList.show()
self.listPanes[count].part_content_set("right", nextList)
self.listPanes.append(nextList)
self.headerPanes[count].part_content_set("left", btn)
self.headerPanes[count].content_left_size = wdth
nextHeader = Panes(self, size_hint_weight=EXPAND_HORIZ,
size_hint_align=FILL_HORIZ)
nextHeader.callback_unpress_add(self.paneResized)
nextHeader.show()
self.headerPanes[count].part_content_set("right", nextHeader)
self.headerPanes.append(nextHeader)
nextList.data["related"] = nextHeader
nextHeader.data["related"] = nextList
else:
self.listPanes[count - 1].part_content_set("right", bx)
self.headerPanes[count - 1].part_content_set("right", btn)
self.lists.append(bx)