TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 03-01-2008, 06:40 PM   #1 (permalink)
Alan @ CIT
Member of the Month
The Frequenter
Member of the Month Top Contributor 
 
Alan @ CIT's Avatar
 
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
Alan @ CIT is on a distinguished road
Default PHP-GTK2 (finally) Released

Well, the PHP-Gtk team proved me wrong by finally releasing PHP-Gtk2. And to think I'd assumed that the project was dead

PHP-Gtk2 brings lots of improvments over the previous version, including much better window drawing / handling on Windows.

Some useful links for anyone interested:

PHP-Gtk Website
PHP-Gtk2 Documentation
PHP-Gtk2 Downloads

I've also knocked up a little demo app for anyone interested in PHP-Gtk - code and screenshots below:

Code:

PHP Code:
<?php
// ===============================================================
// PHP-GTK2 Demo Application
// Accepts input from a text box then shows a popup message
// ---------------------------------------------------------------
// Written by Alan Wagstaff
// Donated to the Public Domain
// ===============================================================

// Check if GTK2 is loaded
if( !class_exists('gtk'))
{
    die(
'Please load the php-gtk2 module in your php.ini' "\r\n");
}

/**
 * Main Window
 * Displays a label, input box and button
  */
class windowMain extends GtkWindow
{

    
/**
     * Text input
     *
     * @var object
     */
    
var $txtName null;
    
    
/**
     * Constructor - sets up the main window
     */
    
function __construct()
    {

        
parent::__construct();
        
        
// Create the window
        
$this->connect_simple('destroy', array('gtk''main_quit'));

        
// Set the window properties
        
$this->set_title('TalkPHP PHP-GTK2 Demo');
        
$this->set_position(Gtk::WIN_POS_CENTER);
        
$this->set_border_width(8);
        
        
// Add the label, input box and go button
        
$this->add($this->createInput());
        
        
// Display the window
        
$this->show_all();

    }

    
/**
     * Creates the label, input box and button elements
     */
    
function createInput()
    {
        
        
// Create a panel that will hold our other elements
        
$panel = new GtkVBox(false8);
        
        
// Create the input box
        
$this->txtName = new GtkEntry();
        
        
// Create the label
        
$labelNamePrompt = new GtkLabel('Please Enter Your _Name');
        
$labelNamePrompt->set_use_underline(true);
        
$labelNamePrompt->set_mnemonic_widget($this->txtName);
        
        
// Create the button
        
$btnGo = new GtkButton('Go!');
        
        
// Connect the click event of the button to our function btnGo_clicked()
        
$btnGo->connect('clicked', array($this'btnGo_clicked'));
        
        
// Add all our elements to the container panel - just shoves them in starting at the top
        
$panel->pack_start($labelNamePromptfalsetrue);
        
$panel->pack_start($this->txtNamefalsetrue);
        
$panel->pack_start($btnGofalsetrue);
        
        
// Return our element-filled panel
        
return $panel;
        
    }

    
/**
     * Fires when the Go button is clicked
     */
    
function btnGo_clicked($btnGo)
    {

        
// Create a dialog box with the following options:
        // DIALOG_MODAL - The applicaiton cannot be used while the dialog is open
        // DIALOG_DESTORY_WITH_PARENT - Close when the app closes
        // MESSAGE_INFO - The icon to display
        // BUTTONS_OK - The buttons to display
        // The text that will appear in our dialog box
        
$dlgHello = new GtkMessageDialog($this,
            
Gtk::DIALOG_MODAL Gtk::DIALOG_DESTROY_WITH_PARENT,
            
Gtk::MESSAGE_INFO,
            
Gtk::BUTTONS_OK,
            
sprintf('Hello %s, from everyone at TalkPHP!'$this->txtName->get_text())
        );
        
        
// Show the dialog box until it is closed
        
$dlgHello->run();
        
        
// Destroy the dialog box
        
$dlgHello->destroy();

    }

}
    
// ----------------
// Create our new Window (aka, application)
// ----------------
new windowMain();

// ----------------
// Run our application
// ----------------
Gtk::main();
All the application does is prompt the user for their name then display it in a popup dialog box.

Screenshots:





I still wouldn't recommend using PHP-Gtk2 for creating full Windows / Linux applications but it is definately an improvment on the previous versions

Alan
Attached Thumbnails
php-gtk2-finally-released-main_window.jpg  php-gtk2-finally-released-dialog_popup.jpg  
Send a message via MSN to Alan @ CIT
Alan @ CIT is offline  
Reply With Quote
The Following 3 Users Say Thank You to Alan @ CIT For This Useful Post:
obolus (03-01-2008), ReSpawN (03-01-2008), SOCK (03-01-2008)
Old 03-01-2008, 06:47 PM   #2 (permalink)
The Acquainted
 
Join Date: Nov 2007
Posts: 154
Thanks: 31
SOCK is on a distinguished road
Default

Thanks for that, nice example. I haven't used or even looked at PHP-GTK in years, I'd assumed production was dead as well.
__________________
I reject your reality, and substitute my own.
SOCK is offline  
Reply With Quote
Old 03-01-2008, 09:55 PM   #3 (permalink)
The Frequenter
 
ReSpawN's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
ReSpawN is on a distinguished road
Default

Wow, that looks seriously very awesome. Yet it is still kinda new so I think if you implement is, in what ever, you'll be the first. Is there a tie to a particular PHP version like PHP 5 (since OOP is 'completed' in 5)?
__________________
"Life is a bitch, take that bitch on a ride"
Send a message via MSN to ReSpawN
ReSpawN is offline  
Reply With Quote
Old 03-01-2008, 10:16 PM   #4 (permalink)
Alan @ CIT
Member of the Month
The Frequenter
Member of the Month Top Contributor 
 
Alan @ CIT's Avatar
 
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
Alan @ CIT is on a distinguished road
Default

The PHP-Gtk2 package is completely self-contained. It comes with a specially-configured CLI version of PHP 5.2.5 and doesn't require a webserver to run.

To run an application, you would just drop to a command line and use:

Code:
Linux: ./php myApp.php
Windows: php.exe myApp.php
Which then starts up the windows like the ones shown in the screenshots above.

Attached is the php.ini that comes with it and the results of php.exe -i for anyone interested

Alan
Attached Files
File Type: txt phpinfo.txt (15.9 KB, 220 views)
File Type: txt php-cli.ini.txt (2.5 KB, 191 views)
Send a message via MSN to Alan @ CIT
Alan @ CIT is offline  
Reply With Quote
The Following User Says Thank You to Alan @ CIT For This Useful Post:
ReSpawN (03-01-2008)
Old 03-01-2008, 10:19 PM   #5 (permalink)
The Frequenter
 
ReSpawN's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
ReSpawN is on a distinguished road
Default

So (not that I have) it doesn't run with PHP 4.4.8 or what ever. Since some of my customers are still deepening on my skills to script 4.4.8.
__________________
"Life is a bitch, take that bitch on a ride"
Send a message via MSN to ReSpawN
ReSpawN is offline  
Reply With Quote
Old 03-01-2008, 10:23 PM   #6 (permalink)
Alan @ CIT
Member of the Month
The Frequenter
Member of the Month Top Contributor 
 
Alan @ CIT's Avatar
 
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
Alan @ CIT is on a distinguished road
Default

It wouldn't effect them Because it is completely self-contained, you distribute the PHP-Gtk2 folder (including php.exe) with your PHP files. Your customers wouldn't have to install anything or adjust anything on their existing php4 / web server setup as it doesn't use it.

Alan
Send a message via MSN to Alan @ CIT
Alan @ CIT is offline  
Reply With Quote
Old 03-01-2008, 10:24 PM   #7 (permalink)
The Acquainted
 
freenity's Avatar
 
Join Date: Feb 2008
Posts: 119
Thanks: 17
freenity is on a distinguished road
Default

Wait those are windows windows?? I mean it is not executed in browser ??
Thats freaky freaking awesome :D
__________________
http://feudal-times.net - My PBB Game
http://gwphp.feudal-times.net - My Blog "Gaming With PHP"
freenity is offline  
Reply With Quote
Old 03-01-2008, 10:27 PM   #8 (permalink)
Alan @ CIT
Member of the Month
The Frequenter
Member of the Month Top Contributor 
 
Alan @ CIT's Avatar
 
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
Alan @ CIT is on a distinguished road
Default

Indeed - it doesn't use a web server or web browser at all - runs just like a normal Windows or XWindows application

Alan
Send a message via MSN to Alan @ CIT
Alan @ CIT is offline  
Reply With Quote
Old 03-01-2008, 10:42 PM   #9 (permalink)
The Frequenter
 
ReSpawN's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
ReSpawN is on a distinguished road
Default

That's very impressive Alan, thanks for the tip once again. I am surely going to introduce it to my boss, maybe he can have his go with it.
__________________
"Life is a bitch, take that bitch on a ride"
Send a message via MSN to ReSpawN
ReSpawN is offline  
Reply With Quote
Old 03-02-2008, 12:31 AM   #10 (permalink)
WebDev'n Beer Drnkn' Fool
 
stewart's Avatar
 
Join Date: Dec 2007
Location: Denver, CO
Posts: 59
Thanks: 2
stewart is on a distinguished road
Default

PHP-GTK is very interesting, it has come a long way now. I was looking forward to version 2 coming out for the longest time..

The betas have been available for quite some time now for v2.

Glad it is finally out xD!!!
__________________
stewart::howe
Web Developer & Programmer
CelerMedia.Com | iAmStewart.com | CelerLabs.com

Last edited by stewart : 03-02-2008 at 06:25 PM.
Send a message via ICQ to stewart Send a message via AIM to stewart Send a message via MSN to stewart Send a message via Yahoo to stewart
stewart is offline  
Reply With Quote
Old 10-18-2012, 02:16 PM   #11 (permalink)
The Addict
 
Join Date: Oct 2012
Posts: 244
Thanks: 0
dashixiong is on a distinguished road
Default

Some conservatives have Coach Factory Outlet pushed that critique further, saying that Mr. Obama’s policies are too costly, often assist the wrong people Louis Vuitton Belts and could have the paradoxical effect of driving up college costs. The dispute turns not just on different Coach Factory Outlet assessments of how policies play out, but on differing philosophical views about the role of government. During Gucci Belts his time in office, Mr. Obama has sharply increased aid to low- and middle-income students, notably through the Pell Grant Coach Factory Outlet program, which grew from $14.6 billion given to 6 million students in 2008, to nearly $40 billion for Coach Factory Outlet almost 10 million students this year. His administration also made it easier to request aid, shortening the Coach Factory Online complex federal application and allowing people to transfer their financial information electronically from the Internal Coach Outlet Online Revenue Service database. But while many education experts laud his efforts, analysts of varying political Coach Outlet Online stripes have also questioned how much impact some of the president’s policies will have, noting that the prices Coach Online Outlet charged by colleges, and student borrowing, continue to climb.But behind the headlines about soaring costs, the Coach Factory Outlet Online reality is more complex and wildly uneven, because a growing number of students receive Coach Outlet Online financial aid, and only relatively high-income families pay those fast-rising sticker prices. Adjusted for Coach Factory Online inflation, the College Board calculates, the average net price changed little over the last decade at private Coach Factory Outlet schools, and rose only modestly at public ones.Defending federal spending, Arne Duncan, the secretary of Hermes Belts education, said that for more than 30 years, college prices had risen even when federal aid had not, leading him to believe Coach Factory Online there was zero correlation.
dashixiong is offline  
Reply With Quote
Old 10-22-2012, 09:48 AM   #12 (permalink)
The Addict
 
Join Date: Oct 2012
Posts: 244
Thanks: 0
dashixiong is on a distinguished road
Default Coach Outlet

when I go home.Coach Outlet It’s a big part of what I find addictive about living and working inCoach Outlet Store Online this part of the world. You feel like you’re watching the future unfold.Coach Factory Online for the US Open with no success."I prefer to go day-by-day without setting objectives orCoach Factory Online time frames, work hard on my recovery and make sure I keep on getting better little by little."Nadal has been forced Coach Outletto watch from the sidelines as longtime rival Roger Federer returned Coach Purse Outlet Onlineto the top of the world rankings after winning Coach Factory Outlet Onlinea seventh Wimbledon singles title.He has also seen Britain's Andy Murray,Coach Bags Outlet Online who won the men's singles gold medal at the 2012 Olympic Games, move above him in the world rankings after securing hisCoach Handbags Outlet first grand slam title at last month's U.S. Open.Currently ranked fourth in the world, Nadal has qualified to play at November's season-ending ATP World Tour Finals in London, Coach Outlet Onlinebut his ability to take part is in doubt due to his injury problems, admitting that his knee is still "bothering him".
dashixiong is offline  
Reply With Quote
Old 01-29-2013, 12:39 PM   #13 (permalink)
The Addict
 
Join Date: Oct 2012
Posts: 244
Thanks: 0
dashixiong is on a distinguished road
Default

Organizers said Coach Outlet Online was opportune because the battle’s 150-year anniversary is in December, and Fredericksburg Coach Factory Outlet has been preparing to mark the sesquicentennial. in the new agreement is that Coach Outlet Online revolutionary councils from 14 Syrian provinces now each have a representative, though not all live Coach Online Outlet in Syria. The hope is that will bind the coalition to those inside the country. Perhaps Coach Bags Outlet the most important body the new group is expected to form is a Revolutionary Military Council Coach Factory Online to oversee the splintered fighting organizations and to funnel both lethal and nonlethal Coach Factory Outlet military aid to the rebels. It should unite units of the Free Syrian Army, various militias Coach Outlet Store Online and brigades in each city and large groups of defectors. Before the ink was even dry on the Coach Outlet Store final draft, negotiators hoped that it would bring them the antiaircraft missiles they crave to Coach Factory Stores take on the Syrian Air Force. The United States and Britain have offered only Coach Handbags Outlet nonmilitary aid to the uprising. A similar attempt by the Syrian National Council to Coach Factory Store supervise the military never jelled. Organizers said funding was too haphazard. Eventually foreign Coach Factory Online governments like Qatar and Saudi Arabia, which are financing and arming the rebels, found Coach Factory Online their own favorite factions to deal with. Foreign leaders notably including Secretary of State Coach Outlet Hillary Rodham Clinton urged this unification largely so they could coordinate their Coach Factory Outlet efforts and aid through a group of technocrats. Once it receives international recognition, the Coach Outlet Store Online coalition is supposed to establish a temporary Coach Outlet Online military never jelled.
dashixiong is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 04:40 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design