本文整理汇总了Python中urwid.BigText方法的典型用法代码示例。如果您正苦于以下问题:Python urwid.BigText方法的具体用法?Python urwid.BigText怎么用?Python urwid.BigText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类urwid
的用法示例。
在下文中一共展示了urwid.BigText方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: build
# 需要导入模块: import urwid [as 别名]
# 或者: from urwid import BigText [as 别名]
def build(self):
menulist = []
# big title
bt = urwid.BigText("Storage Editor", urwid.HalfBlock5x4Font())
bt = urwid.Padding(bt, "center", None)
# primary tables for editing
self.primlist = [TableItemWidget(s) for s in self._PRIMARY_TABLES]
for b in self.primlist:
urwid.connect_signal(b, 'activate', self._select)
pmenu = urwid.GridFlow(self.primlist, 20, 2, 1, "left")
# heading blurbs
subhead = urwid.AttrMap(urwid.Text("Select an object type to view or edit."), "subhead")
supportsubhead = urwid.AttrMap(urwid.Text("Select a supporting object to view or edit."), "subhead")
# secondary/support tables
self.seclist = [TableItemWidget(s) for s in self._SUPPORT_TABLES]
for b in self.seclist:
urwid.connect_signal(b, 'activate', self._select)
smenu = urwid.GridFlow(self.seclist, 25, 1, 0, "left")
divider = urwid.Divider("-", top=1, bottom=1)
menulist = [bt, divider, subhead, pmenu, divider, supportsubhead, smenu]
listbox = urwid.ListBox(urwid.SimpleListWalker(menulist))
return urwid.Frame(listbox)
示例2: build_intro
# 需要导入模块: import urwid [as 别名]
# 或者: from urwid import BigText [as 别名]
def build_intro(self):
font = urwid.font.Thin6x6Font()
# NB: Padding with width="clip" will convert the fixed BigText widget
# to a flow widget so it can be used in a Pile.
big_text = "Toot {}".format(__version__)
big_text = urwid.BigText(("intro_bigtext", big_text), font)
big_text = urwid.Padding(big_text, align="center", width="clip")
intro = urwid.Pile([
big_text,
urwid.Divider(),
urwid.Text([
"Maintained by ",
("intro_smalltext", "@ihabunek"),
" and contributors"
], align="center"),
urwid.Divider(),
urwid.Text(("intro_smalltext", "Loading toots..."), align="center"),
])
return urwid.Filler(intro)
示例3: build
# 需要导入模块: import urwid [as 别名]
# 或者: from urwid import BigText [as 别名]
def build(self):
bt = urwid.BigText("Test Case Manager", urwid.HalfBlock5x4Font())
bt = urwid.Padding(bt, "center", None)
# Primary functions
menulist = [
widgets.MenuItemWidget("Run Test Code", self.do_run),
widgets.MenuItemWidget("Run Test Job", self.do_job),
]
pmenu = urwid.GridFlow(menulist, 20, 2, 1, "left")
# heading blurb
subhead = urwid.AttrMap(urwid.Text("Choose your desired activity."), "subhead")
divider = urwid.Divider(u"-", top=1, bottom=1)
formlist = [bt, divider, subhead, pmenu]
listbox = urwid.ListBox(urwid.SimpleListWalker(formlist))
return urwid.Frame(listbox)
示例4: __init__
# 需要导入模块: import urwid [as 别名]
# 或者: from urwid import BigText [as 别名]
def __init__(self, exit=lambda _:True):
bt = urwid.BigText('WELCOME TO TILDEMUSH', urwid.font.HalfBlock5x4Font())
bt = urwid.Padding(bt, 'center', None)
bt = urwid.Filler(bt, 'middle', None, 7)
ftr = ColorText('~ press any key to jack in ~', align='center')
self.base = urwid.Frame(body=bt, footer=ftr)
super().__init__(self.base, exit=exit)
示例5: setup_view
# 需要导入模块: import urwid [as 别名]
# 或者: from urwid import BigText [as 别名]
def setup_view(self):
self.logger_box = urwid.SimpleListWalker([])
self._state_overview = urwid.Text("Starting")
# ListBox
self.job_box = urwid.ListBox(urwid.SimpleListWalker([]))
w = urwid.Pile([urwid.AttrWrap(self.job_box, 'body')])
# Frame
hdr = urwid.Text("Sisyphus | CWD: %s | Call: %s | Press h for help | press q or esc to quit" %
(os.path.abspath('.'), ' '.join(sys.argv)), wrap='clip')
self.header = hdr = urwid.AttrWrap(hdr, 'header')
hdr = urwid.Pile([hdr,
(10, urwid.AttrWrap(urwid.ListBox(self.logger_box), 'body')),
urwid.AttrWrap(self._state_overview, 'note'),
])
self.setup_menu_view()
self.main_view = self.menu_view
self.job_view = urwid.Frame(header=hdr, body=w)
# Exit message
exit = urwid.BigText(('exit', " Quit? "), font=urwid.Thin6x6Font())
self.exit_view = urwid.Overlay(exit, w, 'center', None, 'middle', None)
self.question_text = urwid.Text(" ")
self.question_queue = Queue()
self.question_sem = Semaphore()
self.question_view = urwid.Overlay(self.question_text, self.main_view,
'center', ('relative', 80), 'middle', None)
help = urwid.Text(help_text)
self.help_view = urwid.Frame(header=self.header, body=urwid.ListBox([help]))
self.setup_object_view()
self.history = []
self.stop_job_view_update = False
self.current_jobs = []
示例6: test_overlay
# 需要导入模块: import urwid [as 别名]
# 或者: from urwid import BigText [as 别名]
def test_overlay(self):
self.wstest(urwid.Overlay(
urwid.BigText("hello",urwid.Thin6x6Font()),
urwid.SolidFill(),
'center', None, 'middle', None))
self.wstest(urwid.Overlay(
urwid.Text("hello"), urwid.SolidFill(),
'center', ('relative', 100), 'middle', None))