Esempio n. 1
0
 public function run()
 {
     $gladefile = BASEDIR . '/data/explorer.glade';
     $config = \Explorer\Config::getInstance();
     $main = new \Explorer\Controller\MainWindowController($gladefile);
     \Gtk::Main();
 }
Esempio n. 2
0
    function onClose()
    {
        $dialog = new GtkMessageDialog(null, Gtk::DIALOG_MODAL, Gtk::MESSAGE_QUESTION, Gtk::BUTTONS_YES_NO, 'Close the window ?');
        $dialog->set_position(GTK::WIN_POS_CENTER);
        $response = $dialog->run();
        if ($response == Gtk::RESPONSE_YES) {
            $dialog->destroy();
            return false;
        } else {
            $dialog->destroy();
            return true;
        }
    }
    /**
     * Returns the application instance
     */
    static function getInstance()
    {
        return self::$inst;
    }
}
ini_set('php-gtk.codepage', 'UTF8');
$app = new TApplication();
try {
    Gtk::Main();
} catch (Exception $e) {
    $app->destroy();
    $ev = new TExceptionView($e);
    $ev->show();
    Gtk::main();
}