[Gd-chatter] r11403 - branches/opendylan-melange/gtk-duim

hannes at gwydiondylan.org hannes at gwydiondylan.org
Tue Jun 12 22:25:47 CEST 2007


Author: hannes
Date: Tue Jun 12 22:25:45 2007
New Revision: 11403

Added:
   branches/opendylan-melange/gtk-duim/gtk-layout.dylan   (contents, props changed)
Modified:
   branches/opendylan-melange/gtk-duim/gtk-duim-debug.lid
   branches/opendylan-melange/gtk-duim/gtk-duim.lid
   branches/opendylan-melange/gtk-duim/gtk-gadgets.dylan
   branches/opendylan-melange/gtk-duim/gtk-mirror.dylan
   branches/opendylan-melange/gtk-duim/gtk-top.dylan
Log:
Job: fd

some more work on the tree-control
some layout hacking


Modified: branches/opendylan-melange/gtk-duim/gtk-duim-debug.lid
==============================================================================
--- branches/opendylan-melange/gtk-duim/gtk-duim-debug.lid	(original)
+++ branches/opendylan-melange/gtk-duim/gtk-duim-debug.lid	Tue Jun 12 22:25:45 2007
@@ -17,6 +17,7 @@
 	gtk-pixmaps
 	gtk-top
 	gtk-gadgets
+	gtk-layout
 	gtk-menus
         gtk-dialogs
 	gtk-help

Modified: branches/opendylan-melange/gtk-duim/gtk-duim.lid
==============================================================================
--- branches/opendylan-melange/gtk-duim/gtk-duim.lid	(original)
+++ branches/opendylan-melange/gtk-duim/gtk-duim.lid	Tue Jun 12 22:25:45 2007
@@ -17,6 +17,7 @@
 	gtk-pixmaps
 	gtk-top
 	gtk-gadgets
+	gtk-layout
 	gtk-menus
         gtk-dialogs
 	gtk-help

Modified: branches/opendylan-melange/gtk-duim/gtk-gadgets.dylan
==============================================================================
--- branches/opendylan-melange/gtk-duim/gtk-gadgets.dylan	(original)
+++ branches/opendylan-melange/gtk-duim/gtk-gadgets.dylan	Tue Jun 12 22:25:45 2007
@@ -89,7 +89,7 @@
 define method do-compose-space
     (gadget :: <gtk-gadget-mixin>, #key width, height)
  => (space-req :: <space-requirement>)
-//  debug-message("do-compose-space(%= , %d, %d)", gadget, width, height);
+  debug-message("do-compose-space(%= , %d, %d)", gadget, width, height);
   let mirror = sheet-direct-mirror(gadget);
   if (mirror)
     let widget = mirror-widget(mirror);
@@ -1165,6 +1165,9 @@
     end;
   end;
   
+  unless (every?(rcurry(instance?, <integer>), new-selection))
+    new-selection := #[];
+  end;
   gtk-debug("  Selection now %=", new-selection);
   distribute-selection-changed-callback(gadget, new-selection);
   #t
@@ -1516,7 +1519,8 @@
     (<gtk-list-control-mixin>,
      <tree-control>,
      <leaf-pane>)
-  sealed constant slot %nodes :: <stretchy-object-vector> = make(<stretchy-vector>);
+  sealed constant slot %nodes :: <node-of-tree-control>
+    = make(<node-of-tree-control>, object: "root");
 end;
 
 define sealed method class-for-make-pane
@@ -1574,11 +1578,11 @@
 define sealed method update-list-control-items
     (gadget :: <gtk-tree-control>, mirror :: <gadget-mirror>)
  => ()
-  gadget.%nodes.size := 0;
   let model = gadget.store-model;
   let roots = tree-control-roots(gadget);
   let children? = tree-control-children-predicate(gadget);
   let label-function = gadget-label-key(gadget);
+  gadget.%nodes.children.size := 0;
   with-gdk-lock
     gtk-tree-store-clear(model);
     let np = null-pointer(<GtkTreeIter>);
@@ -1593,7 +1597,8 @@
           end;
           g-value-set-value(data, label);
           gtk-tree-store-set-value(model, iter, 0, data);
-          add!(gadget.%nodes, make(<node-of-tree-control>, object: tln));
+          add!(gadget.%nodes.children,
+               make(<node-of-tree-control>, object: tln));
           if (children?(tln))
             with-stack-structure (dummy :: <GtkTreeIter>)
               gtk-tree-store-insert-before(model, dummy, iter, np);
@@ -1635,7 +1640,8 @@
   let label-function = gadget-label-key(sheet);
   with-gdk-lock
     let path = map(string-to-integer,
-                   split(gtk-tree-path-to-string(path), ':'));
+                   split(as(<byte-string>, gtk-tree-path-to-string(path)),
+                         ':'));
     let parent-tree = find-node-list(sheet, path);
     let object = parent-tree.real-object;
     with-stack-structure (iter :: <GtkTreeIter>)

Added: branches/opendylan-melange/gtk-duim/gtk-layout.dylan
==============================================================================
--- (empty file)
+++ branches/opendylan-melange/gtk-duim/gtk-layout.dylan	Tue Jun 12 22:25:45 2007
@@ -0,0 +1,32 @@
+Module:       gtk-duim
+Synopsis:     GTK gadget implementation
+Author:       Hannes Mehnert, Andreas Bogk
+Copyright:    (c) 2007 Dylan Hackers
+              All rights reserved.
+License:      GNU Lesser General Public License
+Warranty:     Distributed WITHOUT WARRANTY OF ANY KIND
+
+
+/// Separators
+define sealed class <gtk-column-layout>
+    (<gtk-gadget-mixin>,
+     <column-layout>,
+     <sealed-constructor-mixin>)
+end class <gtk-separator>;
+
+define sealed method class-for-make-pane
+    (framem :: <gtk-frame-manager>, class == <column-layout>, #key)
+ => (class :: <class>, options :: false-or(<sequence>))
+  values(<gtk-column-layout>, #f)
+end method class-for-make-pane;
+
+define sealed method make-gtk-mirror
+    (gadget :: <gtk-column-layout>)
+ => (mirror :: <gadget-mirror>)
+  with-gdk-lock
+    let widget = gtk-vbox-new(0, 1); // fix spacing!
+      make(<gadget-mirror>,
+           widget: widget,
+           sheet:  gadget)
+  end
+end method make-gtk-mirror;

Modified: branches/opendylan-melange/gtk-duim/gtk-mirror.dylan
==============================================================================
--- branches/opendylan-melange/gtk-duim/gtk-mirror.dylan	(original)
+++ branches/opendylan-melange/gtk-duim/gtk-mirror.dylan	Tue Jun 12 22:25:45 2007
@@ -418,6 +418,15 @@
   end
 end method set-mirror-parent;
 
+define method set-mirror-parent
+    (child :: <widget-mirror>, parent :: <widget-mirror>)
+ => ()
+  with-gdk-lock
+    gtk-container-add(mirror-widget(parent),
+                      mirror-widget(child))
+  end
+end;
+
 /*
 define method set-mirror-parent
     (child :: <popup-menu-mirror>, parent :: <display-mirror>)
@@ -458,7 +467,7 @@
     (mirror :: <widget-mirror>, width :: <integer>, height :: <integer>)
  => ()
   let widget = mirror.mirror-widget;
-  gtk-debug("set-pirror-size for %= to %=x%=", mirror-widget(mirror), width, height);
+  gtk-debug("set-mirror-size for %= to %=x%=", mirror-widget(mirror), width, height);
   let (left, top) = box-position(mirror.%region);
   with-stack-structure (allocation :: <GtkAllocation>)
     allocation.GdkRectangle-x      := left;
@@ -466,7 +475,7 @@
     allocation.GdkRectangle-width  := width;
     allocation.GdkRectangle-height := height;
     with-gdk-lock
-      gtk-widget-size-allocate(widget, allocation)
+//      gtk-widget-size-allocate(widget, allocation)
     end
   end
   // ---*** debugging code
@@ -480,9 +489,9 @@
     (mirror :: <drawing-area-mirror>, width :: <integer>, height :: <integer>)
  => ()
 //  gtk-drawing-area-size(mirror-widget(mirror), width, height);
-  gtk-debug("set-pirror-size for %= to %=x%=", mirror-widget(mirror), width, height);
+  gtk-debug("set-mirror-size for %= to %=x%=", mirror-widget(mirror), width, height);
   with-gdk-lock
-    gtk-widget-set-size-request(mirror-widget(mirror), width, height);
+//    gtk-widget-set-size-request(mirror-widget(mirror), width, height);
   end
 end method set-mirror-size;
 

Modified: branches/opendylan-melange/gtk-duim/gtk-top.dylan
==============================================================================
--- branches/opendylan-melange/gtk-duim/gtk-top.dylan	(original)
+++ branches/opendylan-melange/gtk-duim/gtk-top.dylan	Tue Jun 12 22:25:45 2007
@@ -43,7 +43,6 @@
 define method set-mirror-parent
     (child :: <widget-mirror>, parent :: <top-level-mirror>)
  => ()
-  let (x, y) = sheet-native-edges(mirror-sheet(child));
   with-gdk-lock
     gtk-container-add(mirror-widget(parent),
                       mirror-widget(child))



More information about the chatter mailing list