-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.gtk.php
executable file
·54 lines (45 loc) · 1.34 KB
/
index.gtk.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
// define the autoloader
include_once 'lib/adianti/util/TAdiantiLoader.class.php';
spl_autoload_register(array('TAdiantiLoader', 'autoload_gtk'));
// preload Gtk components
TAdiantiLoader::preload('gtk');
// read configurations
$ini = parse_ini_file('application.ini');
date_default_timezone_set($ini['timezone']);
TAdiantiCoreTranslator::setLanguage( $ini['language'] );
TApplicationTranslator::setLanguage( $ini['language'] );
// define constants
define('APPLICATION_NAME', $ini['application']);
define('OS', strtoupper(substr(PHP_OS, 0, 3)));
define('PATH', dirname(__FILE__));
ini_set('php-gtk.codepage', 'UTF8');
class TApplication extends TCoreApplication
{
protected $content;
function __construct()
{
parent::__construct();
parent::set_title('Adianti Framework :: Samples');
$this->content = new GtkFixed;
$vbox = new GtkVBox;
$vbox->pack_start(GtkImage::new_from_file('app/images/pageheader-gtk.png'), false, false);
$MenuBar = TMenuBar::newFromXML('menu.xml');
$vbox->pack_start($MenuBar, false, false);
$vbox->pack_start($this->content, true, true);
parent::add($vbox);
parent::show_all();
}
}
$app = new TApplication;
try
{
Gtk::Main();
}
catch (Exception $e)
{
$app->destroy();
new TExceptionView($e);
Gtk::main();
}
?>