PHP-GTK
Tuesday, September 02, 2014 
download | documentation | applications | faq | changelog | resources 


search for in the  


previousGtkMessageDialog
GtkMessageDialog::set_markupnext

Last updated: Sun, 12 May 2013
view this page in English

GtkMessageDialog Constructor

GtkMessageDialog ( GtkWindow parent , GtkDialogFlags flags , GtkMessageType type , GtkButtonsType buttons , string message);

Creates a new message dialog with icon, text and buttons.

Example 103. A modal GtkMessageDialog

<?php
$dialog = new GtkMessageDialog(
    null,//parent
    0,
    Gtk::MESSAGE_QUESTION,
    Gtk::BUTTONS_YES_NO,
    'Do you like PHP-Gtk2?'
);
$dialog->set_markup(
    'Do <b>you</b> like PHP-Gtk '
    . '<span foreground="red">2</span>?'
);
$answer = $dialog->run();
$dialog->destroy();
 
if ($answer == Gtk::RESPONSE_YES) {
    echo "You like me! Thanks!\r\n";
} else if ($answer == Gtk::RESPONSE_NO) {
    echo "Why not?\r\n";
} else {
    echo "Why didn't you press a button?\r\n";
}
?>

The second parameter could be set to 0, as the run() method automatically makes the dialog modal.


User Contributed Notes
gtk.gtkmessagedialog.constructor.php
add a note about notes
There are no user contributed notes for this page.


previousGtkMessageDialog
GtkMessageDialog::set_markupnext

Last updated: Sun, 12 May 2013
view this page in English


credits 

PHP  Copyright © 2001-2014 The PHP Group
 All rights reserved.
Last updated: Sun May 12 20:50:59 2013 CEST