Show and hide window help(modified source code)



You can probably tell by the source code I would like to show a window, have a loop count and hide that window. It shows the window but doesn't hide it. Any ideas? Eventually I would like to have this happen and then call another function, but little by little. Any help would be appreciated. Thanks.


/* basicgtk.c */

#include <gtk/gtk.h>

  /* Function which stops the program */
  void CloseTheApp(GtkWidget * window, gpointer data )
  {
     gtk_main_quit ();
  }

  gint i;

gint main ( gint argc, gchar * argv[] )
{

  /* Declare a GtkWidget to use as the main window */
  GtkWidget * window ;

  /* Start GTK+ up, and let it process any arguments that were */
  /* passed in on the command line */
  gtk_init ( &argc, &argv );

  /* Create the window itself */
  window = gtk_window_new ( GTK_WINDOW_TOPLEVEL ) ;
  gtk_signal_connect(GTK_OBJECT(window),
    "destroy",
     GTK_SIGNAL_FUNC(CloseTheApp),
     NULL);

  /* Show the window, as far as GTK+ is concerned though we just want */
  /* to make a widget visible */

  for ( i = 0 ; i < 1000 ; i ++ )
 {
 gtk_widget_show (window);
 }

 /*gtk_widget_hide(window);*/
 g_print("The window should be hidden now\n");

  /* Start GTK+ running so that it can catch any signals */
  gtk_main () ;

  /* This line will never be reached in this app */
  return 0;
}

_________________________________________________________________
Winterize your home with tips from MSN House & Home. http://special.msn.com/home/warmhome.armx




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