45 lines
890 B
Python
Executable File
45 lines
890 B
Python
Executable File
|
|
import Tkinter as tk
|
|
|
|
|
|
class HPGLView:
|
|
|
|
def __init__( self, master, **options ):
|
|
self.__programs = None
|
|
self.__canvas = tk.Canvas( master )
|
|
self.__canvas.bind( "<Configure>", self.__onresize )
|
|
|
|
def pack( self, **options ):
|
|
self.__canvas.pack( **options )
|
|
|
|
def pack_forget( self ):
|
|
self.__canvas.pack_forget()
|
|
|
|
def grid( self, **options ):
|
|
self.__canvas.grid( **options )
|
|
|
|
def grid_forget( self ):
|
|
self.__canvas.grid_forget()
|
|
|
|
def __onresize( self, event ):
|
|
pass
|
|
|
|
@property
|
|
def programs( self ):
|
|
self.__programs = programs
|
|
|
|
@property
|
|
def papersize( self ):
|
|
self.__sheetsize = sheetsize
|
|
|
|
def update( self ):
|
|
pass
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
window = tk.Tk()
|
|
view = HPGLView( window )
|
|
view.pack( expand=True, fill=tk.BOTH )
|
|
window.mainloop()
|