本文整理汇总了Python中kivy.uix.screenmanager.Screen.name方法的典型用法代码示例。如果您正苦于以下问题:Python Screen.name方法的具体用法?Python Screen.name怎么用?Python Screen.name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kivy.uix.screenmanager.Screen
的用法示例。
在下文中一共展示了Screen.name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_page
# 需要导入模块: from kivy.uix.screenmanager import Screen [as 别名]
# 或者: from kivy.uix.screenmanager.Screen import name [as 别名]
def add_page(self, id, name):
screen = Screen()
screen.name = id
page = AudiowallPage()
page.name = name
screen.add_widget(page)
self._sm.add_widget(screen)
self.pages.append(page)
self.pages_label.text = 'Page %i of %i' % (self.active_page, len(self.pages))
示例2: create_month_scr
# 需要导入模块: from kivy.uix.screenmanager import Screen [as 别名]
# 或者: from kivy.uix.screenmanager.Screen import name [as 别名]
def create_month_scr(self, month, toogle_today=False):
""" Screen with calendar for one month """
scr = Screen()
m = self.month_names_eng[self.active_date[1] - 1]
scr.name = "%s-%s" % (m, self.active_date[2]) # like march-2015
# Grid for days
grid_layout = ButtonsGrid()
scr.add_widget(grid_layout)
# Days abbrs
for i in range(7):
if i >= 5: # weekends
l = DayAbbrWeekendLabel(text=self.days_abrs[i])
else: # work days
l = DayAbbrLabel(text=self.days_abrs[i])
grid_layout.add_widget(l)
# Buttons with days numbers
for week in month:
for day in week:
if day[1] >= 5: # weekends
tbtn = DayNumWeekendButton(text=str(day[0]))
else: # work days
tbtn = DayNumButton(text=str(day[0]))
tbtn.bind(on_press=self.get_btn_value)
if toogle_today:
# Down today button
if day[0] == self.active_date[0] and day[2] == 1:
tbtn.state = "down"
# Disable buttons with days from other months
if day[2] == 0:
tbtn.disabled = True
grid_layout.add_widget(tbtn)
self.sm.add_widget(scr)