tkinter with wck

E

Eric_Dexter

I am playing around with this code but I am having trouble getting my x
to be bigger it only seems to redraw when it becomes smaller than the
original size up to full size (in ui_handle_repair). At other window
sizes it just seems to center it.. I tried playing around with resize
but never got that to do anything... any ideas (I might be willing to
try other toolkits but the example looks very close to what I was
after) http://www.dexrow.com

from Tkinter import Tk
from WCK import Widget

#from WCK import Widget

class CrossWidget(Widget):

def ui_handle_repair(self, draw, x0, y0, x1, y1):
black = self.ui_pen("black", 5)

# draw a black cross
draw.line((x0, y0, x1, y1), black)
draw.line((x0, y1, x1, y0), black)

def ui_handle_resize(self, width,height):

black = self,ui_pen("black", 5)
#draw.line((x0, y0, x1, y1), black)
#draw.line((x0, y1, x1, y0), black)
# center the text




root = Tk()

widget = CrossWidget(root)
widget.pack() #(expand=1, fill="both")

root.mainloop()
 
D

Dennis Lee Bieber

I am playing around with this code but I am having trouble getting my x
to be bigger it only seems to redraw when it becomes smaller than the
original size up to full size (in ui_handle_repair). At other window
sizes it just seems to center it.. I tried playing around with resize

I downloaded/installed WCK just to test.

My experience was that YOUR code resulted in horizontally centering
the X, but not vertically.
widget = CrossWidget(root)
widget.pack() #(expand=1, fill="both")
Why are the options commented out? I found leaving them active
resulted in the behavior you desire. Without them, the "widget", itself,
is initially created at some default size, and only when the surrounding
frame became smaller than that size did the dimensions of the widget
change. Becoming larger than the initial size resulted in moving the
limited size "widget" within the backdrop frame (horizontally centering
a 100x100 "widget").
--
Wulfraed Dennis Lee Bieber KD6MOG
(e-mail address removed) (e-mail address removed)
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: (e-mail address removed))
HTTP://www.bestiaria.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,044
Members
48,769
Latest member
Clifft

Latest Threads

Top