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


Python Dialog.center方法代码示例

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


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

示例1: showAlert

# 需要导入模块: from dialogs import Dialog [as 别名]
# 或者: from dialogs.Dialog import center [as 别名]
def showAlert(button):
   alert = Dialog("Alert", 40, 6, dialogs.ALERT_DIALOG_DECO)
   bOk = Button(1, "Ok", dialogs.ALERT_BUTTON_DECO)
   alert.addComponent(Label("Press 'Ok' button to close alert dialog.", 38), 1, 2)
   alert.addComponent(bOk, 31, 4)
   alert.center()

   def ok(button):
      alert.destroy()
      dialog.focus()
  
   bOk.setCallback(ok)
   dialog.unfocus()
   alert.draw()
   alert.focus()
开发者ID:statgen,项目名称:dialogs,代码行数:17,代码来源:example3.py

示例2: start

# 需要导入模块: from dialogs import Dialog [as 别名]
# 或者: from dialogs.Dialog import center [as 别名]
def start(button):
   progressDialog = Dialog("", 40, 5)
   progress = Progressbar(38, 0, 10)
   progressDialog.addComponent(progress, 1, 2)
   progressDialog.center()

   dialog.unfocus()
   progressDialog.draw()
   progressDialog.focus()

   for i in range(1, 11):
      time.sleep(0.5)
      progress.setValue(i)
   time.sleep(0.5)

   progressDialog.destroy()
   dialog.focus() 
开发者ID:statgen,项目名称:dialogs,代码行数:19,代码来源:example4.py

示例3: ok

# 需要导入模块: from dialogs import Dialog [as 别名]
# 或者: from dialogs.Dialog import center [as 别名]
def ok(button):
   info = Dialog("", 40, 6)
   bInfoOk = Button(1, "Ok")
   label = Label("", 38)
   info.addComponent(label, 1, 2)
   info.addComponent(bInfoOk, 31, 4)
   info.center()

   label.setText("Entered: " + "".join(cmbPath.text))

   def infoOk(button):
      info.destroy()
      dialog.focus()

   bInfoOk.setCallback(infoOk)
   dialog.unfocus()
   info.draw()
   info.focus()
开发者ID:statgen,项目名称:dialogs,代码行数:20,代码来源:example8.py

示例4: ok

# 需要导入模块: from dialogs import Dialog [as 别名]
# 或者: from dialogs.Dialog import center [as 别名]
def ok(button):
   info = Dialog("", 40, 6)
   bInfoOk = Button(1, "Ok")
   label = Label("", 38)
   info.addComponent(label, 1, 2)
   info.addComponent(bInfoOk, 31, 4)
   info.center()

   value = dropdown.getValue()
   label.setText("Selected: " + value['label'] + " (" + value['value'] + ")")

   def infoOk(button):
      info.destroy()
      dialog.focus()

   bInfoOk.setCallback(infoOk)
   dialog.unfocus()
   info.draw()
   info.focus()
开发者ID:statgen,项目名称:dialogs,代码行数:21,代码来源:example9.py

示例5: ok

# 需要导入模块: from dialogs import Dialog [as 别名]
# 或者: from dialogs.Dialog import center [as 别名]
def ok(button):
   info = Dialog("", 40, 6)
   bInfoOk = Button(1, "Ok")
   label = Label("", 38)
   info.addComponent(label, 1, 2)
   info.addComponent(bInfoOk, 31, 4)
   info.center()

   selected = []
   for i in xrange(0, len(checkbox)):
      if checkbox[i].checked:
         selected.append(i + 1)

   label.setText("Selected: " + str(selected))

   def infoOk(button):
      info.destroy()
      dialog.focus()

   bInfoOk.setCallback(infoOk)
   dialog.unfocus()
   info.draw()
   info.focus()
开发者ID:statgen,项目名称:dialogs,代码行数:25,代码来源:example6.py

示例6: cancel

# 需要导入模块: from dialogs import Dialog [as 别名]
# 或者: from dialogs.Dialog import center [as 别名]
   alert.focus()
   
 
def cancel(button):
   dialogs.stop()

if __name__ == '__main__':
   try:
      dialogs.initScreen()
      dialogs.setTitle("DEMO")

      dialog = Dialog("Dialog", 60, 10)
      bShowAlert = Button(1, "Alert")
      bCancel = Button(2, "Cancel")
      bShowAlert.setCallback(showAlert)
      bCancel.setCallback(cancel)
      dialog.addComponent(Label("Press 'Alert' button to show alert dialog.", 58), 1, 2)
      dialog.addComponent(bShowAlert, 36, 8)
      dialog.addComponent(bCancel, 47, 8)
      dialog.center()

      dialog.draw()
      dialog.focus()

      dialogs.start()

      dialogs.closeScreen()
   except:
      dialogs.closeScreen()
      print sys.exc_info()
开发者ID:statgen,项目名称:dialogs,代码行数:32,代码来源:example3.py

示例7: cancel

# 需要导入模块: from dialogs import Dialog [as 别名]
# 或者: from dialogs.Dialog import center [as 别名]
def cancel(button):
   dialogs.stop()

if __name__ == '__main__':
   try:
      dialogs.initScreen()
      dialogs.setTitle("DEMO")

      dialog1 = Dialog("Dialog 1", 60, 8)
      bNext1 = Button(1, "Next")
      bCancel1 = Button(2, "Cancel")
      bNext1.setCallback(next)
      bCancel1.setCallback(cancel)
      dialog1.addComponent(bNext1, 37, 6)
      dialog1.addComponent(bCancel1, 47, 6)
      dialog1.center()

      dialog2 = Dialog("Dialog 2", 60, 8)
      bFinish2 = Button(1, "Finish")
      bBack2 = Button(2, "Back")
      bCancel2 = Button(3, "Cancel")
      bFinish2.setCallback(finish)
      bBack2.setCallback(back)
      bCancel2.setCallback(cancel)
      dialog2.addComponent(bFinish2, 25, 6)
      dialog2.addComponent(bBack2, 37, 6)
      dialog2.addComponent(bCancel2, 47, 6)
      dialog2.center()

      dialog1.draw()
      dialog1.focus()
开发者ID:statgen,项目名称:dialogs,代码行数:33,代码来源:example1.py


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