how to delete trail or vestige of child window



dear sir/madam:
I make a GtkText in scrolledWindow. While click a button, a window (child) will appear. I will select if I want the scrollBar auto or not and the speed of the scrollBar. after I click ok it will be destroy and scrolledWindow will scroll automaticlly. Unfortunately, though the bar and text could scroll itself, the trail or vestige of the child keep there? how to deal with it? I try many method.
it is some code.
the child window is modal and transient one.
*************************************************
void
on_okBtn_clicked                       (GtkButton       *button,
                                       GtkSpinButton *spin)
{
   GtkWidget * parent;
   GtkWidget * window;
   GtkAdjustment *adjustmentX;
   gint autoScrollSpeed;
   gint oldPosition;
   gint scrolledBarPosition;
/*get spin value before other change and spin_destroy*/
   autoScrollSpeed = autoScroll * gtk_spin_button_get_value_as_int (spin);
window= GTK_WIDGET(button);
   /* search up for window */
   for (;;) {
             parent = window->parent;
             if (parent == NULL)
                   break;
             window = parent;
       }
/*thought use these three sentences, this window still have "trail" effect*/
   //gtk_widget_set_usize (window, 0, 0);
   //gtk_widget_hide (window);
   //gtk_widget_hide_on_delete(window);
gtk_widget_destroy(window); /* destroy window */ gtk_main_quit ( ); /* quit that main function for the select scroll and its speed window*/ adjustmentX = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW(scrolledWindow) ) ;
   scrolledBarPosition =adjustmentX->value;
//gtk_text_freeze (GTK_TEXT (text)); //no effect do{ oldPosition = scrolledBarPosition;
       gtk_adjustment_set_value ( adjustmentX,
                               ( scrolledBarPosition + 4) );
adjustmentX = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW(scrolledWindow) ) ; scrolledBarPosition =adjustmentX->value; g_print ( "on_okBtn_clicked with %d move down from %d\n", autoScrollSpeed, scrolledBarPosition); sleep(autoScrollSpeed); } while( scrolledBarPosition > oldPosition ); //gtk_text_thaw (GTK_TEXT (text)); //no effect*/ }
******************************************************************
thank you a lot for your help.

xn




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