summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkPanedwindow.c
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2006-11-24 18:04:14 (GMT)
committerjenglish <jenglish@flightlab.com>2006-11-24 18:04:14 (GMT)
commita3220fdf64e35fe118d44af78a8d9582b416fbd7 (patch)
tree5b155465341298f1a6a698db16a5c8cd767801a4 /generic/ttk/ttkPanedwindow.c
parent1f9a3b07076ff41b7ee08baa31e992abc40687cc (diff)
downloadtk-a3220fdf64e35fe118d44af78a8d9582b416fbd7.zip
tk-a3220fdf64e35fe118d44af78a8d9582b416fbd7.tar.gz
tk-a3220fdf64e35fe118d44af78a8d9582b416fbd7.tar.bz2
* library/ttk/altTheme.tcl, library/ttk/clamTheme.tcl,
library/ttk/defaults.tcl, library/ttk/winTheme.tcl, library/ttk/xpTheme.tcl: explicitly specify -anchor w on TMenubutton * tests/ttk/entry.test: Fixed font dependency; test entry-3.2 should work on all platforms now. * library/classicTheme.tcl: Don't define or use TkClassicDefaultFont. * generic/ttk/ttkTreeview.c, generic/ttk/ttkPanedwindow.c: Handle missing layouts.
Diffstat (limited to 'generic/ttk/ttkPanedwindow.c')
-rw-r--r--generic/ttk/ttkPanedwindow.c42
1 files changed, 24 insertions, 18 deletions
diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c
index ac8d9cc..e207a58 100644
--- a/generic/ttk/ttkPanedwindow.c
+++ b/generic/ttk/ttkPanedwindow.c
@@ -1,4 +1,4 @@
-/* $Id: ttkPanedwindow.c,v 1.3 2006/11/07 03:45:28 jenglish Exp $
+/* $Id: ttkPanedwindow.c,v 1.4 2006/11/24 18:04:14 jenglish Exp $
*
* Copyright (c) 2005, Joe English. Freely redistributable.
*
@@ -447,29 +447,35 @@ static Ttk_Layout PanedGetLayout(
{
Paned *pw = recordPtr;
Ttk_Layout panedLayout = TtkWidgetGetLayout(interp, themePtr, recordPtr);
- int horizontal = pw->paned.orient == TTK_ORIENT_HORIZONTAL;
- const char *layoutName = horizontal ? ".Vertical.Sash" : ".Horizontal.Sash";
- Ttk_Layout sashLayout = Ttk_CreateSublayout(interp, themePtr, panedLayout,
- layoutName, pw->core.optionTable);
- if (sashLayout) {
- int sashWidth, sashHeight;
+ if (panedLayout) {
+ int horizontal = pw->paned.orient == TTK_ORIENT_HORIZONTAL;
+ const char *layoutName =
+ horizontal ? ".Vertical.Sash" : ".Horizontal.Sash";
+ Ttk_Layout sashLayout = Ttk_CreateSublayout(
+ interp, themePtr, panedLayout, layoutName, pw->core.optionTable);
- if (pw->paned.sashLayout)
- Ttk_FreeLayout(pw->paned.sashLayout);
- pw->paned.sashLayout = sashLayout;
+ if (sashLayout) {
+ int sashWidth, sashHeight;
- Ttk_LayoutSize(sashLayout, 0, &sashWidth, &sashHeight);
+ Ttk_LayoutSize(sashLayout, 0, &sashWidth, &sashHeight);
+ pw->paned.sashThickness = horizontal ? sashWidth : sashHeight;
- pw->paned.sashThickness = horizontal ? sashWidth : sashHeight;
+ if (pw->paned.sashLayout)
+ Ttk_FreeLayout(pw->paned.sashLayout);
+ pw->paned.sashLayout = sashLayout;
+ } else {
+ Ttk_FreeLayout(panedLayout);
+ return 0;
+ }
+ }
- /* Sanity-check:
- */
- if (pw->paned.sashThickness < MIN_SASH_THICKNESS)
- pw->paned.sashThickness = MIN_SASH_THICKNESS;
+ /* Sanity-check:
+ */
+ if (pw->paned.sashThickness < MIN_SASH_THICKNESS)
+ pw->paned.sashThickness = MIN_SASH_THICKNESS;
- Ttk_ManagerSizeChanged(pw->paned.mgr);
- }
+ Ttk_ManagerSizeChanged(pw->paned.mgr);
return panedLayout;
}