Re: Gtk2::MessageDialog title

On Nov 20, 2009, at 11:01 PM, Zettai Muri wrote:

Is it possible to set the title of a MessageDialog?

Of course. Gtk2::MessageDialog isa Gtk2::Dialog isa Gtk2::Window, so just just Gtk2::Window::set_title(). See below.

But beware that the gnome human interface guidelines say that alert windows should have no title, as the title would normally just duplicate the text of the message... so, depending on what you're doing, you might actually want to blank out the title.

I have the following:

sub show_duplicate_dialog
    # A modal dialog.  Note that the message is a printf-style format.
    my($duplicate) = @_;
    my($dialog) = Gtk2::MessageDialog->new (undef,
                                    'error', # message type
                                    'ok', # which set of buttons?
                                    #printf format:
                                    "\"%s\" already selected.",

$dialog->set_title ("Fooo");

    my($response) = $dialog->run;


But can't work out how to add a title to the dialog box that appears.

For each widget in Gtk2 there is a man page; each man page has a HIERARCHY section, which shows the class ancestry for that type. Or you can look at the C api reference on, which has the same info in a different format.

Applause is an addiction, like heroin or checking your email.
  -- Sideshow Mel

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