GNOME 2.0 pixmaps and applet


	I'm experiencing problem with setting pixmap in GNOME 2.0's
applet widget. The same code worked properly in GNOME 1.4 panel but
now it simply doesn't display pixmap, here is a fragment:

void init(PanelApplet *applet_widget) 
	vbox = gtk_vbox_new(TRUE, 0);

	window = gtk_drawing_area_new();
	gtk_widget_set_events(window, GDK_EXPOSURE_MASK);
	gtk_widget_set_usize(window, 48, 48);
	gtk_widget_set_app_paintable(window, TRUE);
	gtk_box_pack_start(GTK_BOX(vbox), window, TRUE, TRUE, 0);

	g_signal_connect(G_OBJECT(window), "expose_event", GTK_SIGNAL_FUNC(expose_cb), NULL);
	pixmap = gdk_pixmap_create_from_xpm_d(window->window, &mask, NULL, background_xpm);
	gdk_draw_pixmap(window->window, window->style->fg_gc [GTK_WIDGET_STATE(window)], pixmap, 0, 0, 0, 0, 48, 48);

	gtk_container_add(GTK_CONTAINER(applet_widget), vbox);
	panel_applet_setup_menu(applet_widget, applet_menu_xml,


It works when I use gtk_pixmap_new() to create pixmap and then
gtk_container_add() to add it to the applet, but I want to use
gtk_drawing_area(). Strangely, when I use for example gdk_draw_arc() to
draw in the drawable then it works, but gdk_draw_pixmap() doesn't.

Of course the pixmap is redrawn in expose_event callback but there
is still no visible effects (applet is empty).

Can someone help me?

-= karol(at) =-               -= =-
  -= -It is better to give than to lend, and it costs about the same-=-

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