Hey guys,
I am making a few gui programs and I was wondering on this code ..

class PaintChart(wx.Panel):
    def __init__(self, parent, data):
        self.data = data.split()
        wx.Panel.__init__(self, parent)
        self.SetBackgroundColour('BLACK')

        self.Bind(wx.EVT_PAINT, self.drawChart)

    def drawChart(self, e):
        dc = wx.PaintDC(self)
        dc.SetDeviceOrigin(30, 240)
        dc.SetAxisOrientation(True, True)
        dc.SetPen(wx.Pen('RED'))
        dc.DrawRectangle(1, 1, 300, 200)

Here I set the rectangular to fixed size, and if i resize the frame(This class is being called from another which holds a frame) then the frame and the panel would also resize but not the rectangular. However, I would want that to resize as well. How can I set the size of it to be technically (1,1, MATCHPARENT, MATCHPARENT) and it would also resize if the frame does?

Here's some photos:

Edited 1 Year Ago by Slavi

Attachments 2.png 6.63 KB 1.png 7.36 KB

Nevermind, all I really needed was
import matplotlib.pyplot as plt :D

This question has already been answered. Start a new discussion instead.