• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python ui.load_view函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中ui.load_view函数的典型用法代码示例。如果您正苦于以下问题:Python load_view函数的具体用法?Python load_view怎么用?Python load_view使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了load_view函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
开发者ID:c0ns0le,项目名称:Pythonista,代码行数:13,代码来源:__init__.py


示例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
开发者ID:dewww,项目名称:HTMLEditor-Pythonista,代码行数:15,代码来源:WebDelegate.py


示例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
开发者ID:dewww,项目名称:HTMLEditor-Pythonista,代码行数:16,代码来源:WebDelegate.py


示例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')
开发者ID:pysmath,项目名称:editmenu,代码行数:7,代码来源:editmenu.py


示例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()
开发者ID:c0ns0le,项目名称:Pythonista,代码行数:27,代码来源:SwitchViews.py


示例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
开发者ID:ssnowden,项目名称:TravellerAidApp,代码行数:29,代码来源:Campaign+Management.py


示例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))
开发者ID:robinsiebler,项目名称:Task-List,代码行数:7,代码来源:menu.py


示例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))
开发者ID:robinsiebler,项目名称:Task-List,代码行数:7,代码来源:menu.py


示例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))
开发者ID:robinsiebler,项目名称:Task-List,代码行数:7,代码来源:menu.py


示例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()
开发者ID:Phuket2,项目名称:VirtualView,代码行数:7,代码来源:vpv.py


示例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')
开发者ID:cclauss,项目名称:FileManager,代码行数:26,代码来源:FileManager.py


示例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
开发者ID:c0ns0le,项目名称:Pythonista,代码行数:7,代码来源:Tabs.py


示例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))
开发者ID:c0ns0le,项目名称:Pythonista,代码行数:7,代码来源:pop-over.py


示例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)
开发者ID:humberry,项目名称:ui-tutorial,代码行数:7,代码来源:SpecialButton3.py


示例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)
开发者ID:c0ns0le,项目名称:Pythonista,代码行数:7,代码来源:FileManager.py


示例16: __init__

	def __init__(self):
		view = ui.load_view()
		
		# Set announce duration to a default of once per every 15 minutes.
		#view['rootview']['announceFreqTextfield'].text = '15'
		#view['rootview']['announceFreqSlider'].value = .25 # every 1/4 hour.
		
		# cache away the current location (if location services on for Pythonista)
		self.locationString = self.createCurrentLocationString()
		
		if traceFlag: print 'location string in __init__ is ->>' + self.locationString
		
		webview = view['rootview']['webview']

		# Place the analog clock in a location that is sensible for a "gadget"
		# and disable touch or multitouch gestures to prevent unwannted resizing
		# or movement to the underlying clock itself which has no need to do so.
		webview.height = 20
		webview.width = 10
		webview.frame= 15,25,120,125
		webview.multitouch_enabled = False
		webview.touch_enabled = False
		if traceFlag: print 'Presenting view now.'
		view.present('sidebar')
		if traceFlag: print 'Loading html with embedded svg now.'
		webview.load_html(svgInHtml)
开发者ID:ltddev,项目名称:MyPythonista,代码行数:26,代码来源:PythonistaClockWidget.py


示例17: initView

    def initView(self,filename=None):
        '''setup the View.  if filename is omitted, open current file in editor'''
        #print os.path.abspath(__file__)
        #shname=inspect.getfile(inspect.getouterframes(inspect.currentframe())[-1])

        p= os.path.dirname(inspect.stack()[-1][1])
        s=  os.path.join(p,os.path.splitext(__file__)[0])
        e=ui.load_view(s)
        # e=ui.load_view(os.path.splitext(__file__)[0])
        e['loadbutton'].action=self.edopen
        e['savebutton'].action=self.edsave
        e['selectbutton'].action=self.edselect

        srcname='editarea.html'
        w=e['webview1']
        w.load_url(os.path.abspath(srcname))

        e.present('panel')
        if filename is not None:
            f=e['filename']
            try:
                f.text=filename
                ui.delay(partial( self.edopen,w), 1)
            except:
                pass
        return e
开发者ID:c0ns0le,项目名称:Pythonista,代码行数:26,代码来源:ed.py


示例18: showPopupButton

def showPopupButton(title, handler, yPos):
	v = ui.load_view('popoverButton')
	v['button'].title = title
	v['button'].action = handler
	xPos = 990
	yPos = yPos + 75
	v.height = 6
	v.present('popover', popover_location=(xPos,yPos), hide_title_bar=True)
开发者ID:Mr-Coxall,项目名称:wc_sync,代码行数:8,代码来源:Working_Copy_Sync.py


示例19: prompt_add

    def prompt_add(self, sender):
        """Prompt the user to add a task."""

        self.add_dialog = ui.load_view("dialogs/add_task")
        self.add_dialog["button_save"].enabled = False
        self.add_dialog["txt_add_task"].delegate = self
        self.add_dialog["txt_add_task"].begin_editing()
        self.add_dialog.present("popover", popover_location=(500, 500))
开发者ID:robinsiebler,项目名称:Task-List,代码行数:8,代码来源:menu.py


示例20: setup

	def setup(self):
		"""
		This extracts saved (persistence) data from pickle files.
		Then it creates all the different Views ready to be called.
		And then it creates the initial user interface.
		"""
		# IMPLEMENT PERSISTANCE
		# Open saved file and extract Group objects.
		# THIS MUST BE CALLED BEFORE THE TABLE ITEMS ARE EXTRACTED!!
		# File path is hard coded for iOS version).
		# This creates a 'generator'.
		saved_items = self.read_file('ios_persistance.pkl')
		# Iterate through saved_items generator and add the contents to the
		# groups_list.
		for item in saved_items:
			self.groups_list.append(item)
		# Do the same for Settings
		# This is a slight duplicate of code but self.read_file didn't quite work.
		if os.path.isfile('settings.pkl'):
			with open('settings.pkl', 'rb') as output:
				self.settings = pickle.load(output)
			
		# SETUP ROOT VIEW (Groups)
		self.root_view = ui.View()
		self.root_view.name = 'Groups'
		self.root_view.background_color = 'white'
		self.root_table = ui.TableView()
		self.root_table.flex = 'WH'
		# Define content items list
		table_items = []
		# Extract items from groups_list
		for group in self.groups_list:
			group_name = group.get_name()
			table_items.append({
				'title': group_name,
				'accessory_type': 'detail_disclosure_button'})
		self.groups_listsource = ui.ListDataSource(table_items)
		self.root_table.data_source = self.groups_listsource
		self.root_table.delegate = self.groups_listsource
		self.groups_listsource.action = self.group_list_action
		self.groups_listsource.edit_action = self.groups_edit_action
		self.groups_listsource.accessory_action = self.group_accessory_action
		self.root_view.add_subview(self.root_table)
		
		# SETUP PEOPLE VIEW
		self.people_pushed_view = ui.load_view('people_view')
		self.people_table = self.people_pushed_view['tableview1']
		
		# IMPLEMENT UI
		# Create button objects with the format
		edit_group_btn = ui.ButtonItem('Settings', None, self.groups_btn_action)
		add_group_btn = ui.ButtonItem('Add', None, self.groups_btn_action)
		# Apply buttons to view
		self.root_view.left_button_items = [edit_group_btn]
		self.root_view.right_button_items = [add_group_btn]
		# Create and present NavigationView
		nav_view = ui.NavigationView(self.root_view)
		nav_view.present()
开发者ID:ncarding,项目名称:NavViewTemplate,代码行数:58,代码来源:main.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python ui.message函数代码示例发布时间:2022-05-27
下一篇:
Python ui.label函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap