I am using a frame which contains a shapecanvas that I then create a diagram
and draw on. I want to make the canvas scrollable, which seems should be
easy since it is derived from wxScrolledWindow. I cannot even get any
scroll bars to appear. Maybe someone can help.
Too much code for whole example but here is where I create the canvas -
class PathEditWindow(wxShapeCanvas):
def __init__(self, parent, prog, PV, ProgBP):
wxShapeCanvas.__init__(self, parent, -1, (0, 0), (1000, 700),
wxVSCROLL | wxHSCROLL)
#wxVSCROLL and wxHSCROLL were added on my last attempt to make it
work
#but appear to have no effect
self.SetScrollbars(5, 5, 50, 50)
self.PV = PV
self.ProgBP = ProgBP
self.prog = prog
self.red_dash_pen = wxPen(wxRED, 1, wxDOT)
self.scale = 52
self.SetBackgroundColour(wxWHITE)
self.diagram = wxDiagram()
self.SetDiagram(self.diagram)
self.diagram.SetCanvas(self)
self.dc = wxClientDC(self)
self.PrepareDC(self.dc)
self.Show(TRUE)
self.initial_speed, self.dist_speed = self.get_speeds()
self.PathCoord = self.get_coord()
self.SetStart_Orient()
self.draw()