<html><P>I am using tkinter for this because it looks like most of what I need to build a code generator is in the example. I am having trouble resizing the x though. It only resizes when the window gets smaller and I need it resize regardless (and to be able to get the x,y of the bottom corner). With python 2.5 when the window gets bigger the example is just centered on the top and not redrawn.</P>
<P> </P>
<P> </P>
<P>from Tkinter import Tk<BR>from WCK import Widget</P>
<P>#from WCK import Widget</P>
<P>class CrossWidget(Widget):</P>
<P> def ui_handle_repair(self, draw, x0, y0, x1, y1):<BR> black = self.ui_pen("black", 5)</P>
<P> # draw a black cross<BR> draw.line((x0, y0, x1, y1), black)<BR> draw.line((x0, y1, x1, y0), black)<BR> <BR> def ui_handle_resize(self, width, height):<BR> self.ui_damage()<BR> #black = self,ui_pen("black", 5)<BR> #draw.line((x0, y0, x1, y1), black)<BR> #draw.line((x0, y1, x1, y0), black)<BR> # center the text<BR> </P>
<P> </P>
<P>root = Tk()</P>
<P>widget = CrossWidget(root)<BR>widget.pack() #(expand=1, fill="both")</P>
<P>root.mainloop()</P></html>