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


Python Options.height方法代码示例

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


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

示例1: handle_events

# 需要导入模块: from options import Options [as 别名]
# 或者: from options.Options import height [as 别名]
    def handle_events(self):
        """ Handle any pygame event """
        opt = Options()
        # pygame logic
        for event in pygame.event.get():
            if event.type == QUIT:
                return Event.DONE

            elif event.type == VIDEORESIZE:
                self.screen = pygame.display.set_mode(event.dict['size'], RESIZABLE)
                opt.width = event.dict["w"]
                opt.height = event.dict["h"]
                self.__reflow()
                pygame.display.flip()

            elif event.type == MOUSEMOTION:
                if pygame.mouse.get_focused():
                    pos = pygame.mouse.get_pos()
                    self.select_item_on_hover(*pos)

            elif event.type == KEYDOWN:
                if event.key == K_UP and pygame.key.get_mods() & KMOD_CTRL and opt.read_from_server:
                    opt.read_delay += 1
                    self.update_window_title()
                elif event.key == K_DOWN and pygame.key.get_mods() & KMOD_CTRL and opt.read_from_server:
                    opt.read_delay = max(0, opt.read_delay - 1)
                    self.update_window_title()
                elif event.key == K_RETURN:
                    self.load_selected_detail_page()
                elif event.key == K_F4 and pygame.key.get_mods() & KMOD_ALT:
                    return Event.DONE
                elif event.key == K_c and pygame.key.get_mods() & KMOD_CTRL:
                    # Debug function to write the state to a json file
                    #with open("../export_state.json", "w") as state_file:
                    #    state_file.write(json.dumps(self.state, cls=TrackerStateEncoder, sort_keys=True))

                    # Write the seed to the clipboard
                    # (from http://stackoverflow.com/questions/579687/how-do-i-copy-a-string-to-the-clipboard-on-windows-using-python)
                    r = Tk()
                    r.withdraw()
                    r.clipboard_clear()
                    r.clipboard_append(self.state.seed)
                    r.destroy()

                #self.generate_run_summary() # This is commented out because run summaries are broken with the new "state" model rewrite of the item tracker

            elif event.type == MOUSEBUTTONDOWN:
                if event.button == 1:
                    self.load_selected_detail_page()
                if event.button == 3:
                    self.save_window_position()
                    import option_picker
                    self.screen.fill(DrawingTool.color(opt.background_color))
                    self.write_message("Editing options...", flip=True)
                    pygame.event.set_blocked([QUIT, MOUSEBUTTONDOWN, KEYDOWN, MOUSEMOTION])
                    option_picker.OptionsMenu().run()
                    pygame.event.set_allowed([QUIT, MOUSEBUTTONDOWN, KEYDOWN, MOUSEMOTION])
                    self.reset_options()
                    self.reset()
                    if self.state is not None:
                        self.__reflow()
                    return Event.OPTIONS_UPDATE

        return None
开发者ID:Alzarath,项目名称:RebirthItemTracker,代码行数:66,代码来源:view.py


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