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


Python Messages.deactivate方法代码示例

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


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

示例1: Window

# 需要导入模块: from messages import Messages [as 别名]
# 或者: from messages.Messages import deactivate [as 别名]
class Window(wx.Frame):
    def __init__(self, parent, title):
        wx.Frame.__init__(self, parent, title=title)

        # Splitters and Panels
        self.controls_map_splitter = wx.SplitterWindow(self)
        self.controls_map_splitter.SetMinimumPaneSize(300)

        controls_panel = wx.Panel(self.controls_map_splitter)
        map_panel = wx.Panel(self.controls_map_splitter)

        self.graphs_messages_splitter = wx.SplitterWindow(controls_panel)
        self.graphs_messages_splitter.SetMinimumPaneSize(50)

        graphs_panel = wx.Panel(self.graphs_messages_splitter)
        messages_panel = wx.Panel(self.graphs_messages_splitter)

        # World graphic
        self._graphics = worldmap.WorldMap(map_panel)
        self.graphics_sizer = wx.BoxSizer(wx.VERTICAL)
        self.graphics_sizer.Add(self._graphics, 1, wx.EXPAND)
        map_panel.SetSizerAndFit(self.graphics_sizer)

        # Controls panel
        self.controls = Controls(controls_panel, (300, 250), self)

        # Info panel
        self.info = Info(controls_panel, (300, 250))

        # Graph canvas
        self.graphs = graphs.Graphs(graphs_panel, (300, 300))

        # Messages panel
        self.messages = Messages(messages_panel, (600, 200))

        self.interface_sizer = wx.BoxSizer(wx.VERTICAL)

        self.controls_info_sizer = wx.BoxSizer(wx.HORIZONTAL)
        self.controls_info_sizer.Add(self.info, 0, wx.EXPAND)
        self.controls_info_sizer.Add((20, -1), proportion=0)    # Padding
        self.controls_info_sizer.Add(self.controls, 1, wx.EXPAND)

        self.messages_sizer = wx.BoxSizer(wx.VERTICAL)
        self.messages_sizer.Add(self.messages, 1, wx.EXPAND)
        messages_panel.SetSizerAndFit(self.messages_sizer)

        self.graphs_sizer = wx.BoxSizer(wx.VERTICAL)
        self.graphs_sizer.Add(self.graphs, 1, wx.EXPAND)
        graphs_panel.SetSizerAndFit(self.graphs_sizer)

        self.interface_sizer.Add(self.controls_info_sizer, 0, wx.EXPAND)
        self.interface_sizer.Add(self.graphs_messages_splitter, 1, wx.EXPAND)

        controls_panel.SetSizerAndFit(self.interface_sizer)

        self.graphs_messages_splitter.SplitHorizontally(
            messages_panel,
            graphs_panel
        )

        self.controls_map_splitter.SplitVertically(controls_panel, map_panel)

        # Set up event handler for any worker thread results
        EVT_RESULT(self, self.OnResult)
        EVT_STOP(self, self.OnStop)

        # Set up close event so timer is properly stopped
        wx.EVT_CLOSE(self, self.OnClose)

        self.reset_gui()
        self.Show()

    def reset_gui(self):
        self.controls.reset_buttons()
        self.messages.clear()
        self.graphs.reset_data()

    # Event Methods
    def OnStart(self, event):
        self.controls.set_buttons_ready()

        self._simulation = simulation.Simulation()

        self._simulation.setup_config(self.controls.get_config_filename())
        self.simulation_info = self._simulation.initialize()

        if not self.simulation_info.interface_config.print_messages:
            self.messages.deactivate()

        self._graphics.num_max_complaints = \
            self.simulation_info.num_max_complaints

        self.rounds = 0
        self.steps = 0

        self.next_phase = "COASTPLAN"
        self.prev_phase = None

        self.worker = None

#.........这里部分代码省略.........
开发者ID:ingfy,项目名称:FisherSimulation,代码行数:103,代码来源:gui.py


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