Main Menu

HOME

.Net
ASP
Assembly
C
C++
Delphi
HTML
Java
JavaScript
MySQL
PC interface
Powershell
Perl
PHP
VBScript
Visual Basic
XML

US Job listings




   Misc

   Amazon

   Links

    


Hello World with PHP-GTK

 

Example 1.1. PHP-GTK Hello World Program Listing

This example is from the manual

<?php

if (!class_exists('gtk')) {
if (strtoupper(substr(PHP_OS, 0,3) == 'WIN'))
dl('php_gtk.dll');
else
dl('php_gtk.so');
}

function delete_event()
{
return false;
}

function shutdown()
{
print("Shutting down...\n");
gtk::main_quit();
}

function hello()
{
global $window;
print "Hello World!\n";
$window->destroy();
}

$window = &new GtkWindow();
$window->connect('destroy', 'shutdown');
$window->connect('delete-event', 'delete_event');
$window->set_border_width(10);

$button = &new GtkButton('Hello World!');
$button->connect('clicked', 'hello');
$window->add($button);

$window->show_all();

gtk::main();

?>


 

 



 




   Sponsors
 

   Software
500 Java Tips E-book
PHP editor
PERL editor
Beginning Java
Beginning Visual Basic
Learn VB.net
Learn VB 6
VB and databases
ASP image library
C++ builder programming
C++ fundamentals

   Source Code
display the current timezone(VB)
sum all of the elements in an array(C)
highlighting source code(php)
event logs to an excel spreadsheet(VBScript)
Background sound supported(ASP.net)
change screen resolution(VB)
shared resources on your pc(VB)
Slashdot feed(PHP)

    




Copyright © 2004 by programmershelp.co.uk