Re: GtkPaned patch



On Wed, 2003-03-05 at 21:01, Luis Oliveira wrote:
> I attached a short example that shows what I mean, two paned
> GtkDrawingArea's, exactly the same but the lower one is flickery when
> dragging the GtkPaned. Any idea why this is happening?

Duh.. I forgot the attachment and only noticed today.

-- 
Luis Oliveira
luismbo AT netcabo DOT pt
/* gcc `pkg-config --libs --cflags gtk+-2.0` panedtest.c -o panedtest */

#include <gtk/gtk.h>

static char * bgxpm[] = {
"23 23 3 1",
" 	c None",
".	c #0000FF",
"+	c #FFFF00",
"........+++++++++++....",
".......+++++++++++.....",
"......+++++++++++......",
".....+++++++++++.......",
"....+++++++++++........",
"...+++++++++++.........",
"..+++++++++++..........",
".+++++++++++...........",
"+++++++++++............",
"++++++++++............+",
"+++++++++............++",
"++++++++............+++",
"+++++++............++++",
"++++++............+++++",
"+++++............++++++",
"++++............+++++++",
"+++............++++++++",
"++............+++++++++",
"+............++++++++++",
"............+++++++++++",
"...........+++++++++++.",
"..........+++++++++++..",
".........+++++++++++..."};


gboolean expose(GtkWidget *widget, GdkEventExpose *event, gpointer data)
{
	gdk_draw_arc (widget->window,
		      widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
		      TRUE,
		      widget->allocation.width/4, widget->allocation.height/4,
		      widget->allocation.width/2, widget->allocation.height/2,
		      0, 64 * 360);

	return TRUE;
}

int main(int argc, char **argv)
{
	GtkWidget *vpaned, *window, *draw;
	GdkPixmap *pix;

	gtk_init(&argc, &argv);

	gtk_rc_parse_string("style \"transparent\" { bg_pixmap[NORMAL] = \"<parent>\" }");
	gtk_rc_parse_string("widget \"*GtkDrawingArea*\" style \"transparent\"");

	window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	gtk_widget_set_usize(GTK_WIDGET(window), 200, 300);
	g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(gtk_exit), NULL);
	gtk_widget_realize(window);
	pix = gdk_pixmap_create_from_xpm_d(window->window, NULL, NULL, bgxpm);
	window->style->bg_pixmap[GTK_STATE_NORMAL] = pix;
	gtk_widget_set_style(window, window->style);

	vpaned = gtk_vpaned_new();
	gtk_container_add(GTK_CONTAINER(window), vpaned);

	draw = gtk_drawing_area_new();
	g_signal_connect (G_OBJECT(draw), "expose_event", G_CALLBACK(expose), NULL);
	gtk_paned_add1(GTK_PANED(vpaned), draw);

	draw = gtk_drawing_area_new();
	g_signal_connect (G_OBJECT(draw), "expose_event", G_CALLBACK(expose), NULL);
	gtk_paned_add2(GTK_PANED(vpaned), draw);

	gtk_widget_show_all(window);
	gtk_main();

	return 0;
}


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