DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2310
Version: 1.3-feature


Meanwhile I added as_group() and as_window() to the main 1.3 branch and
merged the changes with our test branch. I also wrote a small traverse()
function for test purposes. You can pick it from the attached file
traverse.diff that can be applied to the scroll demo to see how it works.

WRT Windows clipping: I'm sorry to say that I can see all sorts of
(probably) clipping problems on Windows. I'll upload scroll.pdf that shows
the problems. This has been produced with the (modified) test/scroll.exe,
but I can see similar effects with other programs.

WRT transparency: I had an idea what might be wrong, but unfortunately
this didn't work. I'll have to test and see, but I'll probably be (some
kind of) offline for the rest of today and most of tomorrow. :-(


Link: http://www.fltk.org/str.php?L2310
Version: 1.3-feature
Index: test/scroll.cxx
===================================================================
--- test/scroll.cxx     (revision 7074)
+++ test/scroll.cxx     (working copy)
@@ -99,11 +99,39 @@
   {0}
 };
 
+void as_x (const char *t, const Fl_Widget *w) {
+  printf ("%-10s: %p, as_group: %p, as_window: %p\n",
+         t,w,w->as_group(),w->as_window());
+}
+
+int traverse (Fl_Widget *w, int level=0) {
+
+  Fl_Group *g = w->as_group();
+  Fl_Window *win = w->as_window();
+  const char *L = w->label()?w->label():"<NULL>";
+  const char *t = "widget";
+  if (win) t = "window";
+  else if (g) t = "group ";
+
+  printf ("level%2d: this is a %s: %p [%s]\n",level,t,w,L);
+  if (!g) return 0;
+
+  for (int i=0; i<g->children(); i++) {
+    traverse(g->child(i),level+1);
+  }
+  printf ("level%2d: traversed %d children for %s %p [%s]\n",
+         level,g->children(),t,g,L);
+  return g->children();
+}
+
 int main(int argc, char** argv) {
-  Fl_Window window(5*75,400);
+  Fl_Double_Window window(5*75,400);
   window.box(FL_NO_BOX);
   Fl_Scroll scroll(0,0,5*75,300);
 
+  window.label("Fl_Scroll demo");
+  scroll.label("Fl_Scroll");
+
   int n = 0;
   for (int y=0; y<16; y++) for (int x=0; x<5; x++) {
     char buf[20]; sprintf(buf,"%d",n++);
@@ -132,6 +160,17 @@
 
   thescroll = &scroll;
 
+  printf ("\n");
+  as_x ("Drawing",&drawing);
+  as_x ("achoice",&achoice);
+  as_x ("scroll",&scroll);
+  as_x ("thescroll",thescroll);
+  as_x ("window",&window);
+
+  printf("\n#### traverse(&window) ####\n");
+  traverse(&window);
+  fflush(stdout);
+
   //scroll.box(FL_DOWN_BOX);
   //scroll.type(Fl_Scroll::VERTICAL);
   window.end();
_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to