event function for sizeallocate. Here, we know how large this widget is, and we know the width of the vruler and the height of the hruler. Hence we can calculate, how much space to give to the drawingArea. We'll do this by resizing the entire table Definition at line 159 of file Preview.py. 00159 : """ event function for sizeallocate. Here, we know how large this widget is, and we know the width of the vruler and the height of the hruler. Hence we can calculate, how much space to give to the drawingArea. We'll do this by resizing the entire table """ if not self.vrulerwidth or not self.hrulerheight: return w,h = tuple(allocation)[2:] # we want a certain apsect ratio of the drawing area # Additionally, we must not give all available space to the table, # otherwise would not be able to make the widdget smaller w = sum(self.vrulerwidth)+3 h = sum(self.hrulerheight)+3 if h>0 and w>0: r = float(w)/h if r < self.aspectratio: h = int(w / self.aspectratio) elif r > self.aspectratio: w = int(h * self.aspectratio) self.preview.set_size_request(w1, h1) self.preview.map = None def setImage(self, img, scanwindow):
