-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path00030.php
43 lines (31 loc) · 881 Bytes
/
00030.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
<?php
/**
* PHP-GTK Cookbook
*
* https://andor.com.br/php-gtk/cook/how-to-set-title-and-icon-of-gtkwindow
*/
Gtk::init();
// create the window
$window = new \GtkWindow();
// set window size
$window->set_size_request(500, 500);
// set title of window
$window->set_title("PHP-GTK");
// set window icon from pixbuf
$pixbuf = GdkPixbuf::new_from_file("/home/bruno/Desktop/logo.png");
$window->set_icon($pixbuf);
// set icon from file
// $window->set_icon_from_file("/home/bruno/Desktop/logo.png");
// create a box
$vbox = new \GtkBox(GtkOrientation::VERTICAL);
// add a label only to complete the window area
$vbox->pack_start(new GtkLabel(""), TRUE, TRUE, 0);
// add to window
$window->add($vbox);
// connect to signal that close program
$window->connect("destroy", function() {
Gtk::main_quit();
});
// show all and start loop main
$window->show_all();
Gtk::main();