Resizing widgets in text windows

Eric Brunel eric_brunel at despammed.com
Mon Jan 29 09:33:11 CET 2007


On Fri, 26 Jan 2007 22:35:20 +0100, <deacon.sweeney at gmail.com> wrote:

> Hi, I've been searching for a .resize()-like function to overload much
> like can be done for the delete window protocol as follows:
>
> toplevel.protocol("WM_DELETE_WINDOW", callback)
>
> I realize that the pack manager usually handles all of the resize
> stuff, but I've found an arrangement that the pack manager fails for.
> That is, if one embeds a canvas into a window created inside a text
> widget, then resize the text widget (via its container), the canvas and
> its container windows do not resize.

Supposing you call "embedding" inserting a widget in the text via the  
window_create method, why should they? Embedding a window in a Text is  
used to put some arbitrary widget in the middle of the text it contains.  
So the embedded widget has no reason to grow or shrink with the parent  
Text widget: it just moves with the text.

> So I need to resize the window
> that the canvas is embedded in. The most obvious way of doing this
> would be as above, but there does not seem to be an equivalent to the
> "WM_DELETE_WINDOW" protocol for resizing.

As James said, the <Configure> event is your friend. But I'm not sure I  
understand your use case...

HTH
-- 
python -c "print ''.join([chr(154 - ord(c)) for c in  
'U(17zX(%,5.zmz5(17l8(%,5.Z*(93-965$l7+-'])"



More information about the Python-list mailing list