Home » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » GTK theming a reality 
	| 
		
 |  
	
		
		
			| Re: GTK theming a reality [message #6840 is a reply to message #6839] | 
			Thu, 30 November 2006 21:58    | 
		 
		
			
				
				
				  | 
					
						  
						mirek
						 Messages: 14271 Registered: November 2005 
						
					 | 
					Ultimate Member  | 
					 | 
		 
		 
	 | 
 
	
		BTW, I am just trying to get icons, but there is strange problem: 
 
I am getting only the sort of alpha channel (no colors and perhaps that alpha is one of channels). 
 
Code fragments used are: 
 
		ImageDraw iw(cx + 2 * margin, cy + 2 * margin);
		iw.DrawRect(0, 0, cx + 2 * margin, cy + 2 * margin, back);
		static G_obj *cm = GDK().gdk_x11_colormap_foreign_new(
			GDK().gdkx_visual_get(XVisualIDFromVisual(Xvisual)), Xcolormap);
		G_obj *gw = GDK().gdk_pixmap_foreign_new(iw.GetDrawable());
		GDK().gdk_drawable_set_colormap(gw, cm);
  
 
(above is common for painting widget elements too, so there most likely is not problem). 
 
				G_obj *b = GTK().gtk_widget_render_icon(widget, detail, state, NULL);
				GDK().gdk_draw_pixbuf(gw, NULL, b, 0, 0, 0, 0, -1, -1, shadow, 0, 0);
				GOBJ().g_object_unref(b);
  
 
(I am iterating state and shadow using several values to investigate the issue, all of them are just alphas...) 
 
Any ideas? 
 
Mirek
		
		
		
 |  
	| 
		
	 | 
 
 
 |  
	
		
		
			| Re: GTK theming a reality [message #6841 is a reply to message #6840] | 
			Thu, 30 November 2006 22:45    | 
		 
		
			
				
				
				
					
						  
						masu
						 Messages: 378 Registered: February 2006 
						
					 | 
					Senior Member  | 
					 | 
		 
		 
	 | 
 
	
		| luzr wrote on Thu, 30 November 2006 21:58 |  
 
				G_obj *b = GTK().gtk_widget_render_icon(widget, detail, state, NULL);
				GDK().gdk_draw_pixbuf(gw, NULL, b, 0, 0, 0, 0, -1, -1, shadow, 0, 0);
				GOBJ().g_object_unref(b);
 
  |  
  
Looking into the API docs, it should be:
				GdkPixbuf *b = GTK().gtk_widget_render_icon(widget, detail, state, NULL);
				GDK().gdk_draw_pixbuf(gw, NULL, b, 0, 0, 0, 0, -1, -1, shadow, 0, 0);
				GOBJ().g_object_unref(b);
  
and widget has to be != NULL, but I think this is the case. Otherwise one should call gdk_drawable_set_colormap() on b again. 
 
Matthias
		
		
		
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |  
	
		
		
			| Re: GTK theming a reality [message #6843 is a reply to message #6841] | 
			Thu, 30 November 2006 22:54    | 
		 
		
			
				
				
				  | 
					
						  
						mirek
						 Messages: 14271 Registered: November 2005 
						
					 | 
					Ultimate Member  | 
					 | 
		 
		 
	 | 
 
	
		| masu wrote on Thu, 30 November 2006 16:45 |  
 | luzr wrote on Thu, 30 November 2006 21:58 |  
 
				G_obj *b = GTK().gtk_widget_render_icon(widget, detail, state, NULL);
				GDK().gdk_draw_pixbuf(gw, NULL, b, 0, 0, 0, 0, -1, -1, shadow, 0, 0);
				GOBJ().g_object_unref(b);
 
  |  
  
Looking into the API docs, it should be:
				GdkPixbuf *b = GTK().gtk_widget_render_icon(widget, detail, state, NULL);
				GDK().gdk_draw_pixbuf(gw, NULL, b, 0, 0, 0, 0, -1, -1, shadow, 0, 0);
				GOBJ().g_object_unref(b);
  
Otherwise one should call gdk_drawable_set_colormap() on b again. 
 
Matthias
  |  
  
 
Afaik, GdkPixbuf is not drawable... 
 
Mirek
		
		
		
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	
		
		
			| Re: GTK theming a reality [message #6887 is a reply to message #6883] | 
			Sun, 03 December 2006 15:17    | 
		 
		
			
				
				
				
					
						  
						masu
						 Messages: 378 Registered: February 2006 
						
					 | 
					Senior Member  | 
					 | 
		 
		 
	 | 
 
	
		| luzr wrote on Sun, 03 December 2006 12:44 |   What font have you set? (Just name).
  |  
  
It is simply called "Sans", but it does matter what font I choose, it is always Arial in theIDE even after restarting theIDE. 
 
Matthias
		
		
  931b81e7ea53320dccc37375b34b38c3
		
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |   
Goto Forum:
 
 Current Time: Tue Nov 04 13:23:47 CET 2025 
 Total time taken to generate the page: 0.08299 seconds 
 |