Root class for Screen based on Tkinter.
| 328 | |
| 329 | |
| 330 | class _Root(TK.Tk): |
| 331 | """Root class for Screen based on Tkinter.""" |
| 332 | def __init__(self): |
| 333 | TK.Tk.__init__(self) |
| 334 | |
| 335 | def setupcanvas(self, width, height, cwidth, cheight): |
| 336 | self._canvas = ScrolledCanvas(self, width, height, cwidth, cheight) |
| 337 | self._canvas.pack(expand=1, fill="both") |
| 338 | |
| 339 | def _getcanvas(self): |
| 340 | return self._canvas |
| 341 | |
| 342 | def set_geometry(self, width, height, startx, starty): |
| 343 | self.geometry("%dx%d%+d%+d"%(width, height, startx, starty)) |
| 344 | |
| 345 | def ondestroy(self, destroy): |
| 346 | self.wm_protocol("WM_DELETE_WINDOW", destroy) |
| 347 | |
| 348 | def win_width(self): |
| 349 | return self.winfo_screenwidth() |
| 350 | |
| 351 | def win_height(self): |
| 352 | return self.winfo_screenheight() |
| 353 | |
| 354 | Canvas = TK.Canvas |
| 355 |