libXaw/Viewport widget initialization
Alexander Pohoyda <[email protected]>
| Newsgroups | gmane.comp.xfree86.devel |
|---|---|
| Message-ID | <[email protected]> |
The original problem is that when I use my experimental Hyperbolic
Tree widget as a child of Viewport widget, the size of unrealized
Viewport widget is not yet set and thus I cannot find out how much
space I have available for layout.
I have the following patch in mind and it solves the problem for me.
Does it make sense or should I look for another solution?
Index: Viewport.c
===================================================================
RCS file: /cvs/xc/lib/Xaw/Viewport.c,v
retrieving revision 1.11
diff -u -r1.11 Viewport.c
--- Viewport.c 14 Dec 2001 19:54:45 -0000 1.11
+++ Viewport.c 13 Sep 2005 18:18:07 -0000
@@ -292,6 +292,12 @@
w->form.default_spacing = 0; /* Reset the default spacing to 0 pixels */
/*
+ * Get the size from the parent
+ */
+ XtWidth(w) = XtWidth(XtParent(w));
+ XtHeight(w) = XtHeight(XtParent(w));
+
+ /*
* Initialize all widget pointers to NULL
*/
w->viewport.child = NULL;
Please CC me on reply. Thank you.
--
Alexander Pohoyda <[email protected]>
PGP Key fingerprint: 7F C9 CC 5A 75 CD 89 72 15 54 5F 62 20 23 C6 44