# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1044404061 0 # Node ID 3fd010a0a33f25d878bd672b61e2a96e91b90411 # Parent d84054c1d5870164a93d40fc18a574aec92777c9 Fixed the expose_event with dynamic pixmaps. diff -r d84054c1d587 -r 3fd010a0a33f dwtest.c --- 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);