diff options
author | jenglish <jenglish@flightlab.com> | 2007-03-21 20:06:40 (GMT) |
---|---|---|
committer | jenglish <jenglish@flightlab.com> | 2007-03-21 20:06:40 (GMT) |
commit | f479296307f674dc9267c506a41d3a0d7f4b92ef (patch) | |
tree | 31bd9d0b2518447966e0d0a7c32a2297580caae7 | |
parent | 44bc3e12acfd6ccb492f90a574ab9bf722ad2d11 (diff) | |
download | tk-f479296307f674dc9267c506a41d3a0d7f4b92ef.zip tk-f479296307f674dc9267c506a41d3a0d7f4b92ef.tar.gz tk-f479296307f674dc9267c506a41d3a0d7f4b92ef.tar.bz2 |
BUGFIX (Ttk_BuildLayoutTemplate): Nested TTK_GROUP nodes did not work
unless they appeared at the end of the layout (and only by accident then).
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | generic/ttk/ttkLayout.c | 14 |
2 files changed, 18 insertions, 2 deletions
@@ -1,3 +1,9 @@ +2007-03-21 Joe English <jenglish@users.sourceforge.net> + + * generic/ttk/ttkLayout.c(Ttk_BuildLayoutTemplate): BUGFIX: + Nested TTK_GROUP nodes did not work unless they appeared + at the end of the layout (and only by accident then). + 2007-03-08 Joe English <jenglish@users.sourceforge.net> * tests/grid.test(grid-21.7): Reset wm geometry . and pack propagate . diff --git a/generic/ttk/ttkLayout.c b/generic/ttk/ttkLayout.c index 2dbdfdf..ca1a6e9 100644 --- a/generic/ttk/ttkLayout.c +++ b/generic/ttk/ttkLayout.c @@ -5,7 +5,7 @@ * * Copyright (c) 2003 Joe English. Freely redistributable. * - * $Id: ttkLayout.c,v 1.7 2007/01/11 19:59:26 jenglish Exp $ + * $Id: ttkLayout.c,v 1.8 2007/03/21 20:06:41 jenglish Exp $ */ #include <string.h> @@ -735,9 +735,19 @@ Ttk_LayoutTemplate Ttk_BuildLayoutTemplate(Ttk_LayoutSpec spec) } if (spec->opcode & TTK_CHILDREN) { + int depth = 1; last->child = Ttk_BuildLayoutTemplate(spec+1); - while (!(spec->opcode & TTK_LAYOUT_END)) { + + /* Skip to end of group: + */ + while (depth) { ++spec; + if (spec->opcode & TTK_CHILDREN) { + ++depth; + } + if (spec->opcode & TTK_LAYOUT_END) { + --depth; + } } } } /* for */ |