Re: window is not shown



I guess he wants to add some functionality to a regular run() loop.

On Wed, 30 Aug 2006 10:51:39 -0500, Jonathon Jongsma <jonathon jongsma gmail com> wrote:

On 8/27/06, Diether Knof <dknof gmx de> wrote:
Hello Paul,

> no. the window doesn't actually appear until the main event loop runs.
> if you don't believe me, remove both "hide" and the main event loop.

perhaps I should comment the code some more
--
// working version
#include <gtkmm.h>

int main(int argc, char *argv[])
{
  // create a main application class
  Gtk::Main kit(argc, argv);
  // create a window
  Gtk::Window window;
  // show the window
  window.show();

  while(true)
    // run the main loop forever
    // here the window is shown
    kit.iteration();

  return EXIT_SUCCESS;
}
--


--
// not working version
#include <gtkmm.h>

int main(int argc, char *argv[])
{
  // create a main application class
  Gtk::Main kit(argc, argv);
  // create a window
  Gtk::Window window;
  // show the window now
  window.show_now();
  // hide the window
  window.hide();
  // show the window
  window.show();

  while(true)
    // run the main loop forever
    // here the window should be shown
    kit.iteration();

  return EXIT_SUCCESS;
}
--

The difference between the two versions is, that in the second I tell the window to hide and aftewards to show, but in the main loop the window is _not_ shown, although the last command to the window was to show itself. If The 'show_now' is not called, the window is also shown. It seems to me: If a window is shown, then gets the signal to hide itself, after that the signal to show itself before the program gets into the main loop, the hide signal is processed after the show signal, so not in the order of calling.
I hope, you understand my problem now.


Greetings
Diether Knof

I'm curious.  What is the reason that you're calling Main::iteration()
instead of Main::run()?




--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/



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