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

[STR New]

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


I have on my todo-list to make the icon support in FLTK a bit more
full-featured. The current API is a bit transparent though and might be
very problematic to be compatible with going forward. I'd therefore like
to hide things a bit better before 1.3.0 so that we can work on
improvements later.

The attached patch makes the icon read-only (by just having a "set"
operation), and no longer makes it inline. That way we can more easily
change what it does in future versions.


Link: http://www.fltk.org/str.php?L2563
Version: 1.3-feature
Index: src/Fl_Window.cxx
===================================================================
--- src/Fl_Window.cxx   (revision 8418)
+++ src/Fl_Window.cxx   (arbetskopia)
@@ -277,7 +277,13 @@
   }
 }
 
+/** Sets the current icon window target dependent data. */
+void Fl_Window::icon(const void * ic)
+{
+  icon_ = ic;
+}
 
+
 //
 // End of "$Id$".
 //
Index: src/Fl_win32.cxx
===================================================================
--- src/Fl_win32.cxx    (revision 8418)
+++ src/Fl_win32.cxx    (arbetskopia)
@@ -1427,9 +1427,9 @@
     wcw.lpfnWndProc = (WNDPROC)WndProc;
     wcw.cbClsExtra = wcw.cbWndExtra = 0;
     wcw.hInstance = fl_display;
-    if (!w->icon())
+    if (!w->icon_)
       w->icon((void *)LoadIcon(NULL, IDI_APPLICATION));
-    wcw.hIcon = wcw.hIconSm = (HICON)w->icon();
+    wcw.hIcon = wcw.hIconSm = (HICON)w->icon_;
     wcw.hCursor = fl_default_cursor = LoadCursor(NULL, IDC_ARROW);
     //uchar r,g,b; Fl::get_color(FL_GRAY,r,g,b);
     //wc.hbrBackground = (HBRUSH)CreateSolidBrush(RGB(r,g,b));
Index: src/Fl_x.cxx
===================================================================
--- src/Fl_x.cxx        (revision 8418)
+++ src/Fl_x.cxx        (arbetskopia)
@@ -1689,8 +1689,8 @@
       fl_show_iconic = 0;
       showit = 0;
     }
-    if (win->icon()) {
-      hints->icon_pixmap = (Pixmap)win->icon();
+    if (win->icon_) {
+      hints->icon_pixmap = (Pixmap)win->icon_;
       hints->flags       |= IconPixmapHint;
     }
     XSetWMHints(fl_display, xp->xid, hints);
Index: FL/Fl_Window.H
===================================================================
--- FL/Fl_Window.H      (revision 8418)
+++ FL/Fl_Window.H      (arbetskopia)
@@ -330,10 +330,7 @@
   static const char *default_xclass();
   const char* xclass() const;
   void xclass(const char* c);
-  /** Gets the current icon window target dependent data. */
-  const void* icon() const     {return icon_;}
-  /** Sets the current icon window target dependent data. */
-  void icon(const void * ic)   {icon_ = ic;}
+  void icon(const void * ic);
 
   /**
     Returns non-zero if show() has been called (but not hide()
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to