本文整理汇总了Python中dialog.Dialog.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Dialog.__init__方法的具体用法?Python Dialog.__init__怎么用?Python Dialog.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dialog.Dialog
的用法示例。
在下文中一共展示了Dialog.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import __init__ [as 别名]
def __init__(self,scr,title = "Chat"):
""" takes the curses window to pop up over, title to display, will dynamically size to parent window """
self.current_buddy = None
self.current_server = None
self.chat_connection = None
self.win = None
self.buddys = None
self.messages = None
self.reply = None
self.reply_border = None
self.config_button = None
self.cancel = None
self.config = {}
self.status = {}
self.children = []
self.myname = None
self.event_time = time.clock()
self.title = title
# load the config right away
self.load_config()
self.setparent(scr)
self.resize()
max_y,max_x = self.getparent().getmaxyx()
min_y,min_x = self.getparent().getbegyx()
Dialog.__init__(self,scr,"ChatDialog", max_y, max_x, [ Frame(title),
self.buddys,
self.messages,
self.reply_border,
self.reply,
self.config_button,
self.cancel], min_y, min_x)
self.start_chat_thread()
示例2: __init__
# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import __init__ [as 别名]
def __init__(self, path=os.getcwd(), extensions=[], title="Select File",
width=540, height=300, window=None, batch=None, group=None,
anchor=ANCHOR_CENTER, offset=(0, 0),
theme=None, movable=True, on_select=None, on_escape=None):
self.path = path
self.extensions = extensions
self.title = title
self.on_select = on_select
self.selected_file = None
self._set_files()
def on_parent_menu_select(choice):
self._select_file(self.parents_dict[choice])
def on_menu_select(choice):
self._select_file(self.files_dict[choice])
self.dropdown = Dropdown(options=self.parents,
selected=self.parents[-1],
align=VALIGN_BOTTOM,
on_select=on_parent_menu_select)
self.menu = Menu(options=self.files, align=HALIGN_LEFT,
on_select=on_menu_select)
self.scrollable = Scrollable(
VerticalLayout([self.dropdown, self.menu], align=HALIGN_LEFT),
width=width, height=height)
content = self._get_content()
Dialog.__init__(self, content, window=window, batch=batch, group=group,
anchor=anchor, offset=offset, theme=theme,
movable=movable, on_escape=on_escape)
示例3: __init__
# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import __init__ [as 别名]
def __init__(self, startDir, callback, filter = ".*"):
currentDir = startDir.replace('\\','/')
self.callback = callback
self.filter = filter
Dialog.__init__(self, -1, -1, 400,240, "File Dialog")
self.setLayout(pyui2.layouts.TableLayoutManager(6,8))
self.dirLabel = pyui2.widgets.Label("Directory:")
self.fileLabel = pyui2.widgets.Label("Filename:")
self.filterLabel = pyui2.widgets.Label("Filter:")
self.dirBox = pyui2.widgets.Label(currentDir)
self.filesBox = pyui2.widgets.ListBox(self._pyui2Selected, self._pyui2DoubleClicked)
self.nameBox = pyui2.widgets.Label("")
self.filterBox = pyui2.widgets.Edit(self.filter,10,self._pyui2Filter)
self.dirButton = pyui2.widgets.Button("Up", self._pyui2Up)
self.openButton = pyui2.widgets.Button("Open", self._pyui2Open)
self.closeButton = pyui2.widgets.Button("Close", self._pyui2Close)
self.addChild( self.dirLabel, (0,0,2,1) )
self.addChild( self.fileLabel, (0,6,2,1) )
self.addChild( self.filterLabel, (0,7,2,1) )
self.addChild( self.dirBox, (2,0,3,1) )
self.addChild( self.filesBox, (0,1,6,5) )
self.addChild( self.nameBox, (2,6,3,1) )
self.addChild( self.filterBox, (2,7,3,1) )
self.addChild( self.dirButton, (5,0,1,1) )
self.addChild( self.openButton, (5,6,1,1) )
self.addChild( self.closeButton, (5,7,1,1) )
self.pack()
self.setCurrentDir(currentDir)
示例4: __init__
# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import __init__ [as 别名]
def __init__(self, parent, username, title, callback):
Dialog.__init__(self, parent.gui, False)
self.dlg.set_transient_for(parent.dlg)
self.parent = parent
self.parent.username_dialog = self
self.callback = callback
self.dlg.set_title(title)
self.username = username
self.user.set_text(username)
self.user.grab_focus()
示例5: __init__
# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import __init__ [as 别名]
def __init__(self, driver):
Dialog.__init__(self, driver)
self.message_count = 0
self.current_message = None
self.previous_message = None
self.scrollbar = Scrollbar(driver.canvas)
self.listbox = Listbox(driver.canvas, bg='black', fg='white')
self.checkbox_var = IntVar()
self.checkbox = Checkbutton(self.driver.canvas,
text='Autoscroll', selectcolor='black', variable=self.checkbox_var,
bg='black', fg='white', highlightthickness=0)
self.checkbox.select()
self.listbox.config(yscrollcommand=self.scrollbar.set)
self.scrollbar.config(command=self.listbox.yview)
示例6: __init__
# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import __init__ [as 别名]
def __init__(self, parent):
Dialog.__init__(self, parent, False, False, True)
self.parent = parent
self.blocked = False
self.username_dialog = None
self.question_dialog = None
self.saved = False
self.oldusername = self.main.username
self.settings.check_autostart()
self.dlg.set_title(lang.settings_title)
# Tabs
self.get('users').set_label(lang.settings_tab_accounts)
self.get('general').set_label(lang.settings_tab_general)
self.get('atarashii').set_label(lang.settings_tab_atarashii)
self.get('syncing').set_label(lang.settings_tab_syncing)
self.get('notifications').set_label(lang.settings_tab_notifications)
self.get('theme').set_label(lang.settings_tab_theme)
# Pages
self.page_accounts(self.settings)
self.page_atarashii(self.settings)
self.page_syncing(self.settings)
self.page_theme(self.settings)
self.page_notify_sounds(self.settings)
# Activate
if (not self.main.status(ST_LOGIN_COMPLETE) \
and self.main.username != UNSET_USERNAME) \
or self.main.status(ST_CONNECT):
self.activate(False)
# Events
self.close_button.set_label(lang.settings_button)
self.close_button.connect('clicked', self.on_save)
cancel_button = self.get('cancelbutton')
cancel_button.set_label(lang.settings_button_cancel)
cancel_button.connect('clicked', self.on_close)
gobject.idle_add(self.accounts.grab_focus)
self.dlg.set_size_request(-1, -1)
示例7: __init__
# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import __init__ [as 别名]
def __init__(self, callback, r=255, g=0, b=0):
self.callback = callback
self.r = r
self.g = g
self.b = b
Dialog.__init__(self, -1, -1, 400,240, "Color Dialog")
self.setLayout(pyui2.layouts.TableLayoutManager(4,9))
self.colorGradient = ColorGradient(None, self)
self.colorStrip = ColorStrip(None, self)
self.colorSolid = ColorSolid(None)
self.okButton = pyui2.widgets.Button("OK", self._pyui2OK)
self.cancelButton = pyui2.widgets.Button("Cancel", self._pyui2Cancel)
self.redLabel = pyui2.widgets.Label("Red:")
self.greenLabel = pyui2.widgets.Label("Green:")
self.blueLabel = pyui2.widgets.Label("Blue:")
self.redBox = pyui2.widgets.SliderBar(self._pyui2Red, 255, r)
self.greenBox = pyui2.widgets.SliderBar(self._pyui2Green, 255, g)
self.blueBox = pyui2.widgets.SliderBar(self._pyui2Blue, 255, b)
self.addChild( self.colorGradient, (0,0,2,5) )
self.addChild( self.colorStrip, (2,0,2,5) )
self.addChild( self.colorSolid, (0,5,1,3) )
self.addChild( self.redLabel, (1,5,1,1) )
self.addChild( self.greenLabel, (1,6,1,1) )
self.addChild( self.blueLabel, (1,7,1,1) )
self.addChild( self.redBox, (2,5,2,1) )
self.addChild( self.greenBox, (2,6,2,1) )
self.addChild( self.blueBox, (2,7,2,1) )
self.addChild( self.cancelButton, (0,8,2,1) )
self.addChild( self.okButton, (2,8,2,1) )
self.pack()
self.setColor()
示例8: __init__
# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import __init__ [as 别名]
def __init__(self, driver):
Dialog.__init__(self, driver)
# Add a quadcopter image for motor testing
(self.image_motors,self.label_motors) = self._load_photo(MOTORS_IMAGE_FILE)
(self.image_motors1,self.label_motors1) = self._load_photo(MOTORS1_IMAGE_FILE)
(self.image_motors2,self.label_motors2) = self._load_photo(MOTORS2_IMAGE_FILE)
(self.image_motors3,self.label_motors3) = self._load_photo(MOTORS3_IMAGE_FILE)
(self.image_motors4,self.label_motors4) = self._load_photo(MOTORS4_IMAGE_FILE)
# Add a warning checkbox for motor testing
self.checkbox_var = IntVar()
self.warning_motors = Checkbutton(self.driver.canvas, \
variable=self.checkbox_var, command=self._checkbox_callback, \
text=MOTORS_WARNING_TEXT, font=('Heletica', 14), fg='red', bg='black', highlightthickness=0)
# A a scale for motors
self.scale = Scale(self.driver.canvas, from_=1850, to_=1000, command=self._scale_callback,
orient=VERTICAL, length=MOTOR_SCALE_LENGTH, bg='black', fg='white')
# Index of active motor (0 = none)
self.active_motor = 0
示例9: __init__
# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import __init__ [as 别名]
def __init__(self, driver, simulation=False):
Dialog.__init__(self, driver)
# Vehicle dimensions
W = VEHICLE_SCALE
D = VEHICLE_SCALE / 2
L = VEHICLE_SCALE * 2
#Let these be in World-coordinates (worldview-matrix already applied)
####In right-handed, counter-clockwise order
self.vehicle_points, self.vehicle_faces, self.vehicle_face_colors = get_vehicle(W, D, L)
# Assume no angles to start
self.yaw_pitch_roll = None
# Rotation matrices
self.pitchrot = np.eye(3)
self.yawrot = np.eye(3)
self.rollrot = np.eye(3)
self.simulation = simulation
self.running = False
示例10: __init__
# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import __init__ [as 别名]
def __init__(self, title, text):
font = getTheme().getProperty("DEFAULT FONT")
size = font.getTextSize(title)
Dialog.__init__(self, title = title)
self.setLayout(pyui2.layouts.BorderLayoutManager())
self.textLabel = pyui2.widgets.Label(text)
self.textLabel.setText(text)
self.buttonPanel = pyui2.widgets.Panel()
self.buttonPanel.setLayout(pyui2.layouts.BorderLayoutManager())
self.okButton = pyui2.widgets.Button("OK", self._pyui2OK)
self.okButton.resize(self.innerRect[2]/2, self.okButton.height)
self.cancelButton = pyui2.widgets.Button("Cancel", self._pyui2Cancel)
self.cancelButton.resize(self.innerRect[2]/2, self.cancelButton.height)
self.buttonPanel.addChild(self.okButton, locals.WEST)
self.buttonPanel.addChild(self.cancelButton, locals.EAST)
self.buttonPanel.pack()
self.addChild(self.textLabel, locals.CENTER)
self.addChild(self.buttonPanel, locals.SOUTH)
self.pack()
示例11: __init__
# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import __init__ [as 别名]
def __init__(self, location=(0, 0), surface=None):
Dialog.__init__(self, (0, 0, 640, 640), (200, 200, 200), surface, closekey=pygame.K_ESCAPE, border_width=0, shadow_weight=0)
self.font = pygame.font.Font(None, 30)
self.player = get_game().player
self.x, self.y = location
示例12: __init__
# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import __init__ [as 别名]
def __init__(self, parent, title="Enter some text", prompt="Enter some text",
default="", cancel_button=1):
self.prompt = prompt
self.default = default
Dialog.__init__(self, parent, title, cancel_button=cancel_button)
示例13: __init__
# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import __init__ [as 别名]
def __init__(self, driver):
Dialog.__init__(self, driver)
self.running = False
示例14: __init__
# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import __init__ [as 别名]
def __init__(self, parent, options):
Dialog.__init__(self, parent, 6, 20, 1, 15)
self.options = options
self.sel = 0
self.setup()
示例15: __init__
# 需要导入模块: from dialog import Dialog [as 别名]
# 或者: from dialog.Dialog import __init__ [as 别名]
def __init__(self, *args):
Dialog.__init__(self, *args)
self.locations = locations
self.setup()