changeset 221:3fd010a0a33f

Fixed the expose_event with dynamic pixmaps.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 05 Feb 2003 00:14:21 +0000
parents d84054c1d587
children 7bb6cb6f612c
files dwtest.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/dwtest.c	Wed Feb 05 00:02:17 2003 +0000
+++ b/dwtest.c	Wed Feb 05 00:14:21 2003 +0000
@@ -55,7 +55,7 @@
 /* This gets called when a part of the graph needs to be repainted. */
 int DWSIGNAL text_expose(HWND hwnd, DWExpose *exp, void *data)
 {
-	HPIXMAP hpm = (HPIXMAP)data;
+	HPIXMAP hpm = (hwnd == textbox1 ? text1pm : text2pm);
 	int width = DW_PIXMAP_WIDTH(hpm);
 	int height = DW_PIXMAP_HEIGHT(hpm);
 
@@ -274,7 +274,7 @@
 	/* create render box for number pixmap */
 	textbox1 = dw_render_new( 100 );
 	dw_window_set_font(textbox1, FIXEDFONT);
-	dw_font_text_extents(textbox1, NULL, "O", &font_width, &font_height );
+	dw_font_text_extents(textbox1, NULL, "O", &font_width, &font_height);
 	dw_box_pack_start(pagebox, textbox1, (font_width*width1)+2, font_height*rows, FALSE, TRUE, 0);
 
 	/* create box for filecontents and horz scrollbar */
@@ -299,8 +299,8 @@
 	dw_messagebox("DWTest", "Width: %d Height: %d\n", font_width, font_height);
 	dw_draw_rect(0, text1pm, TRUE, 0, 0, font_width*width1, font_height*rows);
 	dw_draw_rect(0, text2pm, TRUE, 0, 0, font_width*cols, font_height*rows);
-	dw_signal_connect(textbox1, "expose_event", DW_SIGNAL_FUNC(text_expose), text1pm);
-	dw_signal_connect(textbox2, "expose_event", DW_SIGNAL_FUNC(text_expose), text2pm);
+	dw_signal_connect(textbox1, "expose_event", DW_SIGNAL_FUNC(text_expose), NULL);
+	dw_signal_connect(textbox2, "expose_event", DW_SIGNAL_FUNC(text_expose), NULL);
 	dw_signal_connect(textbox2, "configure_event", DW_SIGNAL_FUNC(configure_event), text2pm);
 	dw_signal_connect(hscrollbar, "value_changed", DW_SIGNAL_FUNC(scrollbar_valuechanged), (void *)status);
 	dw_signal_connect(vscrollbar, "value_changed", DW_SIGNAL_FUNC(scrollbar_valuechanged), (void *)status);