本文整理汇总了Python中ui.load_view函数的典型用法代码示例。如果您正苦于以下问题:Python load_view函数的具体用法?Python load_view怎么用?Python load_view使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了load_view函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load_editor
def load_editor(file_manager=None, file_viewer=ui.View(), frame=(0, 0, 540, 600)): # 575)):
try:
view = ui.load_view("HTMLEditor/__init__")
except ValueError as e:
print "Attempt 1 'HTMLEditor/__init__' failed " + exception_str(e)
try:
view = ui.load_view("__init__")
except ValueError as e:
print "Attempt 2 '__init__' failed " + exception_str(e)
view = ui.Editor()
view.frame = frame
view.set_fv_fm(file_manager, file_viewer)
return view
示例2: load_editor_view
def load_editor_view(frame=None, load_addons=True):
try:
view = ui.load_view("EditorView/EditorView")
except ValueError as e:
logger.debug("Attempt 1 'EditorView/EditorView' failed")
logger.exception(exception_str(e))
try:
view = ui.load_view("EditorView")
except ValueError as e:
logger.debug("Attempt 2 'EditorView' failed")
logger.exception(exception_str(e))
view = ui.WebView()
if frame:
view.frame = frame
return view
示例3: load_console
def load_console(frame=(0, 0, 540, 575), load_addons=True):
try:
view = ui.load_view("EditorView/EditorViewConsole")
except ValueError as e:
logger.error("Attempt 1 'EditorView/EditorViewConsole' failed")
logger.exception(exception_str(e))
try:
view = ui.load_view("EditorViewConsole")
except ValueError as e:
logger.error("Attempt 2 'EditorViewConsole' failed")
logger.exception(exception_str(e))
view = WebViewConsole()
logger.debug("Setting Frame")
view.frame = frame
logger.debug("Done")
return view
示例4: showsidebar
def showsidebar():
"""show the sidebar. """
import ui
v=ui.load_view('editmenu')
uncom = v['uncomment']
uncom.transform = ui.Transform.rotation(pi)
v.present('sidebar')
示例5: __init__
def __init__(self):
self.view_names = ['switchview1', 'SwitchViews']
self.view_index = -1
self.view_array = []
# load and hide views
for i in range(len(self.view_names)):
self.view_index += 1
self.view_array.append(ui.load_view(self.view_names[self.view_index]))
self.add_subview(self.view_array[self.view_index])
self.view_array[self.view_index].hidden = True
# initialize some actions
self.view_array[0]['btn_Okay'].action = self.all_action
self.view_array[0]['btn_Cancel'].action = self.all_action
self.view_array[1]['button1'].action = self.all_action
# show empty white view
self.background_color = 'white'
back.action = self.bt_back
forward.action = self.bt_forward
self.left_button_items = [space, back]
self.right_button_items = [space, space, forward]
self.present()
# show view 'SwitchViews'
self.switch_views()
示例6: __init__
def __init__(self, Test = False):
"""
The class initialise function that sets up the view and handles test conditions if requested
Arguments:
Specifics:
"""
global CAMPAIGN_DATA_DIRECTORY
global CAMPAIGN_LOG_SELECTED, CAMPAIGN_ASSETS_SELECTED, CAMPAIGN_NOTES_SELECTED
CAMPAIGN_DATA_DIRECTORY = '/Data/Campaigns/'
try:
strCampaignManagementViewName = 'Campaign Management'
self.vwInterface = ui.load_view(strCampaignManagementViewName)
self.vwInterface.name = strCampaignManagementViewName
self.objCampaignData = clsCampaign.clsCampaign()
self._SelectedLogEntry = -1
self._initialise_campaign_interface()
self._initialise_control_handlers()
self.vwInterface['tblCampaigns'].data_source.items = os.listdir(os.getcwdu() + CAMPAIGN_DATA_DIRECTORY)
if Test:
#self.objCampaignData = initialise_test_data()
#self.objCampaignData.save('xml', CampaignDataDirectory = CAMPAIGN_DATA_DIRECTORY)
pass
except:
pass
示例7: prompt_save
def prompt_save(self, sender):
"""Prompt the user for the name of a task file."""
self.save_dialog = ui.load_view("dialogs/save_task_file")
self.save_dialog["txt_save_file"].begin_editing()
self.save_dialog["txt_save_file"].delegate = self
self.save_dialog.present("popover", popover_location=(500, 500))
示例8: prompt_modify_task_number
def prompt_modify_task_number(self, sender):
"""Prompt the user for the number of the task to modify."""
self.modify_dialog = ui.load_view("dialogs/modify_task_number")
self.modify_dialog["txt_mod_task_num"].begin_editing()
self.modify_dialog["txt_mod_task_num"].delegate = self
self.modify_dialog.present("popover", popover_location=(500, 500))
示例9: prompt_delete_task
def prompt_delete_task(self, sender):
"""Prompt the user to delete a task."""
self.delete_dialog = ui.load_view("dialogs/delete_task")
self.delete_dialog["txt_del_task"].begin_editing()
self.delete_dialog["txt_del_task"].delegate = self
self.delete_dialog.present("popover", popover_location=(500, 500))
示例10: create_cell_contents
def create_cell_contents(self):
cust_cell = ui.load_view('mycell1')
self.add_subview(cust_cell)
cust_cell['lb'].text = str(time.time())
cust_cell['img1'].image = rand_image()
cust_cell['img2'].image = rand_image()
示例11: __init__
def __init__(self):
self.view = ui.load_view('FileManager')
self.root = os.path.expanduser('~')
self.rootlen = len(self.root)
self.path = os.getcwd()
self.path_po = self.path
self.view.name = self.path[self.rootlen:]
self.tableview1 = self.make_tableview1()
self.lst = self.make_lst()
self.lst_po = self.lst
self.filename = ''
self.view['btn_Rename'].action = self.btn_Rename
self.view['btn_Copy'].action = self.btn_Copy
self.view['btn_Move'].action = self.btn_Move
self.view['btn_MakeDir'].action = self.btn_MakeDir
self.view['btn_Delete'].action = self.btn_Delete
self.view['btn_RemoveDir'].action = self.btn_RemoveDir
self.view['btn_OpenIn'].action = self.btn_OpenIn
self.view['btn_Download'].action = self.btn_Download
self.view['btn_Compress'].action = self.btn_Compress
self.view['btn_Extract'].action = self.btn_Extract
self.view['btn_HexView'].action = self.btn_HexView
self.view['btn_GetPic'].action = self.btn_GetPic #from CameraRoll
self.view['btn_Settings'].action = self.btn_Settings
self.view['btn_Help'].action = self.btn_Help
self.view.present('full_screen')
示例12: load
def load(cls):
import os, inspect
pyui= os.path.abspath(inspect.getfile(inspect.currentframe()))+'ui'
if cls._lastinstance is None:
cls._lastinstance = ui.load_view(pyui)
return cls._lastinstance
示例13: quit
def quit(self, sender):
def ask_user(sender): #action method for both buttons (yes and no)
PopOverView.view_po.close()
if sender.name == 'yes':
PopOverView.view_main.close()
PopOverView.view_po = ui.load_view('po')
PopOverView.view_po.present('popover',popover_location=(400,400))
示例14: __init__
def __init__(self):
self.view = ui.load_view('SpecialButton')
self.view.present('fullscreen')
self.label = ui.Label(frame=(120,100,100,100))
self.btn = MyButtonClass(self.label)
self.view.add_subview(self.btn) #watch the order, first button and then the label
self.view.add_subview(self.label)
示例15: hexview_a_file
def hexview_a_file(self, filename):
self.view_po = ui.load_view('hexview')
self.view_po.name = 'HexViewer: ' + filename
self.view_po.present('full_screen')
self.view_po['btn_search'].action = self.button_action
full_pathname = self.path + '/' + filename
self.view_po['tv_data'].text = hex_view(full_pathname)