我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用wx.NO_FULL_REPAINT_ON_RESIZE。
def __init__(self, parent, title): wx.Frame.__init__(self, parent, -1, title, size=(700, 650), style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE) self._config = FlashConfig.load(self._get_config_file_path()) self._build_status_bar() self._set_icons() self._build_menu_bar() self._init_ui() sys.stdout = RedirectText(self.console_ctrl) self.SetMinSize((640, 480)) self.Centre(wx.BOTH) self.Show(True)
def __init__(self, parent, background='black', style=0, *args, **kwargs): """Initialize a new DrawablePanel. Args: parent: wx parent object. style: Style arguments passed the the wx.Panel base class. The wx.NO_FULL_REPAINT_ON_RESIZE argument is added to the given style arguments. args, kwargs: Additional arguments passed to the wx.Panel base class. """ wx.Panel.__init__(self, parent=parent, style=style | wx.NO_FULL_REPAINT_ON_RESIZE, *args, **kwargs) self.background = background self.lastSize = (0,0) # initial resize creates initial drawing # buffer and triggers first draw self.resize() self.Bind(wx.EVT_PAINT, self.repaint) self.Bind(wx.EVT_SIZE, self.resize)