I want to draw some lines after click button. But when I minimize the window, or scroll the window in a ScrolledWindow, all the drawing will lost. Is there any way to keep them?
Here is the code:
import wx
class Frame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, size=(640, 480))
self.panel = wx.Panel(self, wx.ID_ANY)
button = wx.Button(self.panel, id=wx.ID_ANY, label=u'Start Calculation', size=(160, 22))
self.Bind(wx.EVT_BUTTON, self.OnButtonCalcuating, button)
def OnButtonCalcuating(self, event):
self.dc = wx.ClientDC(self.panel)
self.dc.DrawLine(50, 60, 190, 60)
if __name__ == '__main__':
app = wx.PySimpleApp()
frame = Frame()
frame.Show()
app.MainLoop()