python类load_view()的实例源码

Top Songs.py 文件源码 项目:pythonista-scripts 作者: lukaskollmer 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def tableView_accessoryButtonTappedForRowWithIndexPath_(_self, _cmd, _tv, _ip):
    view = ObjCInstance(_self)
    row = ObjCInstance(_ip).row()

    cell = ObjCInstance(tableView_cellForRowAtIndexPath_(_self, None, _tv, _ip))

    accessory_view = ObjCInstance(cell.valueForKey_('_accessoryView'))

    song = songs[row]
    song_info_view = ui.load_view('SongInfo')
    ObjCInstance(song_info_view['artworkImageView']).setImage_(song.artwork)
    song_info_view['song_title_label'].text = str(song.title)
    song_info_view['song_album_label'].text = str(song.albumTitle)
    song_info_view['song_playcount_label'].text = str(song.playCount)

    song_info_view.present('popover')
Find_and_replace.py 文件源码 项目:pythonista-scripts 作者: khilnani 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def showfindbar():
    v = ui.load_view('Find_and_replace')

    find = v['find']
    find.autocapitalization_type = ui.AUTOCAPITALIZE_NONE
    find.delegate = FindField()

    replace = v['replace']
    replace.autocapitalization_type = ui.AUTOCAPITALIZE_NONE
    replace.delegate = ReplaceField()

    back = v['back']

    forward = v['forward']

    once_and_for_all = v['once_and_for_all']
    once_and_for_all.action = seg

    replace_button = v['replace_button']

    editor._set_toolbar(v)
ui_io.py 文件源码 项目:ui2 作者: controversial 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def dump_view(view, path):
    """ The reverse of `ui.load_view()` """
    with open(path, "w") as f:
        json.dump(_view_to_dict(view), f)
mazecraze.py 文件源码 项目:pythonista-scripts 作者: khilnani 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def loadoptionscreen(self):
    '''Load the option screen ui and queue the state to show it.'''
    self.optionscreen = ui.load_view('mazecraze') #Create the options screen.
    self.wantstate = self.showoptionscreen
NavigationViewExample.py 文件源码 项目:pythonista-scripts 作者: khilnani 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def __init__(self):
        root_view = ui.load_view()
        root_view.left_button_items  = [make_button_item(self.bt_close,   'ionicons-close-24')]
        root_view.right_button_items = [make_button_item(self.bt_subview, 'ionicons-arrow-right-b-24')]
        self.nav_view = ui.NavigationView(root_view)
        self.nav_view.present(hide_title_bar=True)
NavigationViewExample.py 文件源码 项目:pythonista-scripts 作者: khilnani 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def bt_subview(self, sender):
        sub_view = ui.load_view('switchview1.pyui')
        sub_view.name = 'subview'
        sub_view['btn_Okay'].action = self.bt_action
        sub_view['btn_Cancel'].action = self.bt_action
        self.nav_view.push_view(sub_view)
pop-over.py 文件源码 项目:pythonista-scripts 作者: khilnani 项目源码 文件源码 阅读 34 收藏 0 点赞 0 评论 0
def __init__(self):
    PopOverView.view_main = ui.load_view('pop-over')
    PopOverView.view_main.present('fullscreen')
pop-over.py 文件源码 项目:pythonista-scripts 作者: khilnani 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
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))
ShowTableView.py 文件源码 项目:pythonista-scripts 作者: khilnani 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def __init__(self):
        self.view = ui.load_view('ShowTableView')
        self.view.present('fullscreen')
        self.view.name = 'ShowTableView'
        self.bt_empty_action(None)
SpecialButton3.py 文件源码 项目:pythonista-scripts 作者: khilnani 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
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)
SpecialButton2.py 文件源码 项目:pythonista-scripts 作者: khilnani 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def __init__(self):
        #self.view = ui.load_view('SpecialButton')
        self.view = ui.View()
        self.view.background_color = 'white'
        self.view.present('fullscreen')
        img = ui.Image.named('Girl')
        width,height = img.size
        img = None
        self.btn = MyButtonClass(100,100,width,height,'red')
        self.view.add_subview(self.btn)
SpecialButton.py 文件源码 项目:pythonista-scripts 作者: khilnani 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def __init__(self):
        self.view = ui.load_view('SpecialButton')
        self.view.present('fullscreen')
        self.btn = MyButtonClass()
        self.view.add_subview(self.btn)
editmenu.py 文件源码 项目:pythonista-scripts 作者: khilnani 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
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
KeyboardControl.py 文件源码 项目:pythonista-scripts 作者: khilnani 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def run():
    global root
    global ctrl
    global out
    root = ui.load_view()
    ctrl = root["ctrl"]
    out = root["out"]
    ctrl.delegate = KBControlDelegate()

    root.present("sheet")


问题


面经


文章

微信
公众号

扫码关注公众号