From f479296307f674dc9267c506a41d3a0d7f4b92ef Mon Sep 17 00:00:00 2001 From: jenglish Date: Wed, 21 Mar 2007 20:06:40 +0000 Subject: BUGFIX (Ttk_BuildLayoutTemplate): Nested TTK_GROUP nodes did not work unless they appeared at the end of the layout (and only by accident then). --- ChangeLog | 6 ++++++ generic/ttk/ttkLayout.c | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 517ca82..1daab62 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-03-21 Joe English + + * 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 * 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 @@ -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 */ -- cgit v0.12