Re: how to draw border around a group



On Fri, 2017-08-25 at 10:09 +0200, Fred van Zwieten wrote:
Hi,


I want to draw a border around a group of images. There are several
solutions I see:


1. Add a rect to the group using the bounds of the group for size

2. Using stroke-color


(1) works, but I cannot get (2) to work on a canvasGroup, although it
is inherited from SimpleItem. 



I do this:
    image_group =
GooCanvas.CanvasGroup(parent=root,stroke_color="blue")



But I don't see a thing. Do I need to repaint or something?



Are there other ways to do this?

Method (1) is the easiest, but if you add the rectangle to the group it
may alter the bounds which could get confusing. So probably best to keep
it separate, or in a parent group.

Groups don't paint anything themselves so Method (2) won't work.

You could possibly subclass GooCanvasGroup and paint a rect but that
could get quite/very complicated.

Damon





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]