Re: [gtkmm] Gtk-- create Pixmaps at startup?



Craig Anderson wrote:
> 
> I need advice on using Pixmaps using Gtk---1.0.1.
> Here is what I'm trying to do:
> 

Try this:

--- gtk_test_007.cc	Thu Aug  5 13:28:16 1999
+++ ../temp/gtk_test_007.cc	Thu Aug  5 14:14:28 1999
@@ -68,32 +68,32 @@
 
   top_packer = new Gtk_Packer();
 
-  Gdk_Pixmap seed_pm;
   Gdk_Color  tmp_color;
 
-  seed_pm.create(8,8);
-
-  pm_1a.create_from_xpm_d(seed_pm,
-			  sk_mask,
-			  tmp_color,
-			  d1a_xpm);
-  pm_1b.create_from_xpm_d(seed_pm,
+  realize ();
+  
+  pm_1a . create_from_xpm_d ( get_window (),
+			      sk_mask,
+			      tmp_color,
+			      d1a_xpm );
+			      
+  pm_1b.create_from_xpm_d( get_window (),
 			  sk_mask,
 			  tmp_color,
 			  d1b_xpm);
-  pm_2a.create_from_xpm_d(seed_pm,
+  pm_2a.create_from_xpm_d(get_window (),
 			  sk_mask,
 			  tmp_color,
 			  d2a_xpm);
-  pm_2b.create_from_xpm_d(seed_pm,
+  pm_2b.create_from_xpm_d(get_window(),
 			  sk_mask,
 			  tmp_color,
 			  d2b_xpm);
-  pm_3a.create_from_xpm_d(seed_pm,
+  pm_3a.create_from_xpm_d(get_window (),
 			  sk_mask,
 			  tmp_color,
 			  d3a_xpm);
-  pm_3b.create_from_xpm_d(seed_pm,
+  pm_3b.create_from_xpm_d(get_window (),
 			  sk_mask,
 			  tmp_color,
 			  d3b_xpm);
@@ -168,6 +168,7 @@
 
   return 0;
 }
+/*
 
 #if 0
 Gdk-CRITICAL **: file gdkpixmap.c: line 62 (gdk_pixmap_new): assertion
`(window != NULL) || (depth != -1)' failed.
@@ -183,4 +184,6 @@
 Gdk-WARNING **: Creating pixmap from xpm with NULL window and colormap
 
 Gdk-WARNING **: Creating pixmap from xpm with NULL window and colormap
+
 #endif
+*/


Hope this helps.

Todd.
-- 
   | Todd Dukes                      E-MAIL:  tdukes@ibmoto.com |
   | Motorola Somerset                  Phone:   (512) 424-8008 |
   | 6200 Bridgepoint Parkway Building #4 MS OE70               |
   | Austin, Texas 78730                                        |



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]