Gtk_Text question (2)



Hello,

Here is another odd phenomenon: Running the following code (to display a
string in Gtk_Text widget) gave me 2 windows - seems that the Gtk_Text
window flies itself out of the base window. Can someone give me a help on
this? 

Lixin

============================ code start ================================
void main( int argc, char* argv[] )
{
  Gtk_Main m( &argc, &argv );
  
  Gtk_Text* text  = new Gtk_Text(NULL, NULL);
  text->show();
  text->realize();
  text->insert(NULL, NULL, NULL, "Hello World", -1);

  Gtk_Window* window = new Gtk_Window( GTK_WINDOW_TOPLEVEL );
  window->add(text);
  window->show();
 
  m.run();
}
========================== code end ==================================




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