summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkPanedwindow.c
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2007-11-25 18:11:10 (GMT)
committerjenglish <jenglish@flightlab.com>2007-11-25 18:11:10 (GMT)
commit37a492a973a6293e2324e7a9d66dee21daf1d033 (patch)
tree22175f1ab591c35a78f6f7b5914368ecf10d3186 /generic/ttk/ttkPanedwindow.c
parent81e551c563bf0c2e7ba07e4b6f207bbae50242df (diff)
downloadtk-37a492a973a6293e2324e7a9d66dee21daf1d033.zip
tk-37a492a973a6293e2324e7a9d66dee21daf1d033.tar.gz
tk-37a492a973a6293e2324e7a9d66dee21daf1d033.tar.bz2
Internal Ttk_Manager API updates; Fixed [Bug 1343984];
Added [$nb hide] method; [$nb add] on already-managed windows no longer throws an error, can be used to re-add a hidden tab. Updated docs and test suite.
Diffstat (limited to 'generic/ttk/ttkPanedwindow.c')
-rw-r--r--generic/ttk/ttkPanedwindow.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c
index e961815..c9086f5 100644
--- a/generic/ttk/ttkPanedwindow.c
+++ b/generic/ttk/ttkPanedwindow.c
@@ -1,4 +1,4 @@
-/* $Id: ttkPanedwindow.c,v 1.11 2007/06/10 03:25:32 jenglish Exp $
+/* $Id: ttkPanedwindow.c,v 1.12 2007/11/25 18:11:12 jenglish Exp $
*
* Copyright (c) 2005, Joe English. Freely redistributable.
*
@@ -404,10 +404,10 @@ static void PanedPlaceSlaves(void *managerData)
PlacePanes(pw);
}
-static void PaneRemoved(Ttk_Manager *mgr, int index)
+static void PaneRemoved(void *managerData, int index)
{
- Paned *pw = Ttk_ManagerData(mgr);
- Pane *pane = Ttk_SlaveData(mgr, index);
+ Paned *pw = managerData;
+ Pane *pane = Ttk_SlaveData(pw->paned.mgr, index);
DestroyPane(pw, pane);
}
@@ -440,35 +440,30 @@ static int AddPane(
return TCL_OK;
}
-/* PanedGeometryRequestProc --
- * Update pane request size, but only if slave is currently unmapped.
- * Geometry requests from mapped slaves are not directly honored,
+/* PaneRequest --
+ * Only update pane request size if slave is currently unmapped.
+ * Geometry requests from mapped slaves are not directly honored
* in order to avoid unexpected pane resizes (esp. while the
* user is dragging a sash [#1325286]).
*/
-static void PanedGeometryRequestProc(
- ClientData clientData, Tk_Window slaveWindow)
+static int PaneRequest(void *managerData, int index, int width, int height)
{
- Ttk_Manager *mgr = clientData;
- Paned *pw = Ttk_ManagerData(mgr);
+ Paned *pw = managerData;
+ Pane *pane = Ttk_SlaveData(pw->paned.mgr, index);
+ Tk_Window slaveWindow = Ttk_SlaveWindow(pw->paned.mgr, index);
+ int horizontal = pw->paned.orient == TTK_ORIENT_HORIZONTAL;
if (!Tk_IsMapped(slaveWindow)) {
- int slaveIndex = Ttk_SlaveIndex(mgr, slaveWindow); /* ASSERT: != -1 */
- Pane *pane = Ttk_SlaveData(mgr, slaveIndex);
- pane->reqSize
- = pw->paned.orient == TTK_ORIENT_HORIZONTAL
- ? Tk_ReqWidth(slaveWindow) : Tk_ReqHeight(slaveWindow);
+ pane->reqSize = horizontal ? width : height;
}
-
- /* Continue with default GeometryRequestProc:
- */
- Ttk_GeometryRequestProc(clientData, slaveWindow);
+ return 1;
}
static Ttk_ManagerSpec PanedManagerSpec = {
- { "panedwindow", PanedGeometryRequestProc, Ttk_LostSlaveProc },
+ { "panedwindow", Ttk_GeometryRequestProc, Ttk_LostSlaveProc },
PanedSize,
PanedPlaceSlaves,
+ PaneRequest,
PaneRemoved
};