Re: Gtk2::Dialog ... adding a label




On Tuesday, May 25, 2004, at 08:10 PM, A. Pagaltzis wrote:

* Daniel Kasak <dkasak nusconsulting com au> [2004-05-26 01:56]:
   my $label = Gtk2::Label->new ($message);
   $dialog->vbox->add ($label);
     $label->show();


less succinctly...  ;-)

your label was indeed being added, it just wasn't being shown, because you didn't ask for it to be shown.

Gtk2::Dialog::run() (actually gtk_dialog_run()) calls Gtk2::Widget::show() (or gtk_widget_show()) on the dialog under the hood.

gtk_widget_show() only shows the widget on which you call it. it will not show all of that widget's children. gtk_widget_show_all() (or Gtk2::Widget::show_all() in perl) does that, but it's not always a good idea to call show_all(), as there may be some children which are intentionally not visible.


--
I don't have a drinking problem,
'cept when i can't get drink.
  -- Tom Waits




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