Widget not exposed.



Hello. I'm doing an application which has a custom widget, which goes
inside a derived VBox.
The custom widget does custom drawing.
The problem is that I need to draw my widget after a callback. But if
my widget is attached to the table
AFTER w.show_all(), my widget doesn't receive expose events, no matter
if I call table.queue_draw().
But if instead of that, I attach my widget before calling
w.show_all(), the widget gets exposed and
there is no problem. How can I do to get expose events if I need to
draw my widget after w.show_all()?


int main(int argc, char * argv[]) {
  ....
  Gtk::Main m(argc, argv)
  Gtk::Table t(2, 2);
  Gtk::MyCustomWidget widget;

  Gtk::VBox b;
  Gtk::Window w;

  w.add(b);

  //Attach my custom widget to the table. If I attach it before
calling w.show_all(), there's no problem
  //but if I attach the widget AFTER w.show_all(), the widget does not
get exposed.
  t.attach(widget, 0, 1, 0, 1);
  b.pack_start(t, false, false);

  w.show_all();
}


Sorry if there's any mistake in the code, I don't have the original
code here. Thanks for your time.


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