Ejemplo n.º 1
0
 /**
  * Run this
  *
  */
 public function run()
 {
     static $map = array(MB_ICONHAND => 'error', MB_ICONQUESTION => 'question', MB_ICONEXCLAMATION => 'warning', MB_ICONASTERISK => 'information');
     // Set window title
     $this->window->set_title($this->caption);
     // Set message text
     $this->label->set_text($this->message);
     // Set icon
     $idx = $map[$this->style & MB_ICONMASK];
     $this->cat->debug($this->style, $this->style & MB_ICONMASK);
     $this->icon->set($this->pixmaps['p:' . $idx], $this->pixmaps['m:' . $idx]);
     // Buttons
     foreach (array('OK', 'CANCEL', 'YES', 'NO', 'RETRY', 'IGNORE', 'ABORT') as $name) {
         if ($this->style & constant('MB_' . $name)) {
             $b = new GtkButton(ucfirst(strtolower($name)));
             // TBD: Get via gettext?
             $b->set_name($name);
             $b->set_flags(GTK_CAN_DEFAULT);
             $b->show();
             $this->connect($b, 'clicked', 'onButtonClicked');
             $this->actionarea->pack_start($b);
         }
     }
     parent::run();
 }