Home

Forums

Web development

 

 

 

 
     
 
dna88 Web development and Technology Forum
 
Profile   Register   Memberlist   Usergroups   FAQ   Search  Log in
Building stand alone application with PHP

 
Post new topic   Reply to topic    dna88 Forum Index -> Web scripting language Discussion Forum
Author Message
quantum
Site Admin
Site Admin


Joined: 07 Mar 2004
Posts: 1048
Location: Dhaka, Bangladesh

Post Post subject: Building stand alone application with PHP Reply with quote

Everyone thought php is just for the web? Wrong. With GTK you can develop desktop applications using PHP! Is'nt that absolutely awesome?

PHP-GTK is an extension for PHP programming language that implements language bindings for GTK+ toolkit. It provides an object-oriented interface to GTK+ classes and functions and greatly simplifies writing client side cross-platform GUI applications.

Download php gtk documentation here:
[http://gtk.php.net/download-docs.php]

Download php-gtk gere:
[http://gtk.php.net/download.php]

Home ofphp gtk:
[http://gtk.php.net/]

Here is a detailed article about how to begin with php gtk application developments:
[http://www.devx.com/opensource/Article/21235/0/page/1]

It is very easy and everything just the same as regular php coding for web pages after you install the GTK. Even it opens and closes the same way other PHP code does. The first line of code is always <?php, and the last line is ?>.

One extra thing you have to do is you must detect the operating system (OS). As such, the following code snippet is necessary for all PHP-GTK applications:

Quote:
<?php
if (!class_exists('gtk')) {
dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so'));
}

/*Now, create the window widget as a variable.*/
$window = &new GtkWindow();

/*Next, create a title for this new window widget.*/
$window->set_title("PHP Window Number 1");

/*Then you will set the widget window to the center of the screen.*/
$window->set_position(GTK_WIN_POS_CENTER);

/*This statement is also necessary in all PHP-GTK applications that have graphics on the screen.
This shows all the parent widgets and their children.*/

$window->show_all();

/* Run the program from top to bottom. */
Gtk::main();

?>


This creates a simple window widget. Try it out. Simply paste the code into Notepad or a similar text editor and save the file as phpwindow1.php. Cool nah!
_________________

Dust fills my eyes / Clouds roll by / and I roll with them / Centuries cry / Orders fly / and I fall again
Afford best design, implement best solution. Outsource your web design.
Thu Jun 24, 04 1:58 am
Back to top
quantum View user's profile Send private message Visit poster's website AIM Address
dude
Power User
Power User


Joined: 10 Mar 2004
Posts: 376
Location: Savar, Dhaka

Post Post subject: Reply with quote

I want to see an example. Will it be as good as applications written with VB or Java?
Fri Jul 02, 04 12:51 am
Back to top
dude View user's profile Send private message Visit poster's website
quantum
Site Admin
Site Admin


Joined: 07 Mar 2004
Posts: 1048
Location: Dhaka, Bangladesh

Post Post subject: Stand alone application with php Reply with quote

Challange accepted. Will show some demo soon enough. Although, php gtk is not quite as powerful as VB or Java, quite obviously. Php was not originally written with stand alone application in mind. Furthermore, php gtk does not have graphical development environment as VB or JBuilder design mode. You have to handcode the interface, almost like C. But php gtk has good database function and all the standard interface functions. Let us see... Gentle smile
_________________

Dust fills my eyes / Clouds roll by / and I roll with them / Centuries cry / Orders fly / and I fall again
Afford best design, implement best solution. Outsource your web design.
Fri Jul 02, 04 3:28 am
Back to top
quantum View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    dna88 Forum Index -> Web scripting language Discussion Forum All times are GMT - 7 Hours
Page 1 of 1

 

Partners and Resources

Bangladesh hosting company

Bangladesh web design

Driven by phpBB © phpBB Group