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

muppet wrote:

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);


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 see.
Thankyou both.

One more small problem ... the buttons I get in the dialog are pressed hard against the right-hand side of the dialog ( when the text of my message is longer than the 2 buttons ). I could add an hbox with homogeneous spacing and add buttons to that, but is there an easier way of getting the buttons evenly spaced across the dialog?

Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak nusconsulting com au
Title: CanIt Vote for ID 47197

The following links have been placed here by the NUS Consulting internal spam filter and are for use by NUS Consulting staff only.
Please ingore these links.
Not spam
Forget previous vote

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