"Wait" window doesn't appear!



Hi!
I wrote the following code for a program of mine. It displays a "wait till it's done" window, execute some operations, then destroy it.

[...]

wait = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (wait), _("Please wait..."));
gtk_window_set_transient_for (GTK_WINDOW (wait), GTK_WINDOW (dlg));
wlbl = gtk_label_new (_("Please wait, collecting data..."));
gtk_container_set_border_width (GTK_CONTAINER (wait), 10);
gtk_container_add (GTK_CONTAINER (wait), wlbl);

gtk_widget_show_all (wait);

len = lseek (fd, 0, SEEK_END);
pwd = mmap (NULL, len, PROT_READ, MAP_PRIVATE, fd, 0);
key = grg_key_gen (pwd, len);
munmap (pwd, len);
close (fd);

gtk_widget_destroy (wait);

[...]

The problem is, the window doesn't show. If the file pointed by fd is slow enough, i.e. a floppy, it spins the drive, reads data, processes it, all correctly, but the window isn't displayed. If I remove gtk_widget_destroy, it executes the loading and _then_ displays the window. What can I do?
	Thanks in advance,
		Mano :)

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Germano Rizzo - mano pluto linux it
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Pluto FSUG member - www.pluto.linux.it
Linux Registered User #120637
PGP/GPG Public Key at
  http://gnomermind.sf.net/pubkey.txt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An rud is annamh is iontach
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





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