PHP-GTK2 Cookbook Forum
Welcome, Guest
Please Login or Register.    Lost Password?
Run PHP-GTK2 through Apache web server (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Run PHP-GTK2 through Apache web server
#464
ppraveenk (User)
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
Run PHP-GTK2 through Apache web server 5 Months, 2 Weeks ago Karma: 0  
Hi All,

Can we execute PHP-GTK2 application through Apache web server by placing the abc.php file in htdocs and then run form the webserver by giving http://localhost/abc.php?

Can I implement GtkWindow in normal php which runs through webserver?

I had downloaded a php file from net which has the functionality to blink a window in task bar. I need to implement this functionality in my Php script that runs through Apache web server.
Please suggest me how can I achieve this.
Please find code below.

<?php
class bobWindow extends GtkWindow {

private $label;

public function __construct() {
parent::__construct();

$this->label = new GtkLabel('Minimize this window to test.');

$this->set_size_request(300,200);
$this->set_title('Blink Taskbar Entry Demo');
$this->connect_simple('delete-event',array($this,'on_quit'));
$this->connect('window-state-event',array($this,'on_iconify'));

//. you must test for when the window is brought back into focus for
//. the purpose of turning the taskbar blinking off.
$this->connect_simple('focus-in-event',array($this,'on_focus'));

$this->add($this->label);
$this->show_all();
return;
}

public function on_quit() {
$this->hide();
Gtk::main_quit();
return;
}

public function on_iconify($w,$e) {
if(($e->new_window_state & Gdk::WINDOW_STATE_ICONIFIED)) {
//. we want to wait for two seconds after before we start to blink.
Gtk::timeout_add(2000,array($this,'init_blink'));
}
return;
}

public function on_focus() {
//. stop blink.
$this->set_urgency_hint(false);
return;
}

public function init_blink() {
//. start blink.
$this->set_urgency_hint(true);
return false;
}
}

$window = new bobWindow;

Gtk::main();

$window->destroy();
unset($window);

?>

Thanks in Advance,
Praveen.
 
  The administrator has disabled public write access.
#516
kksou (Admin)
Admin
Posts: 443
graph
User Online Now Click here to see the profile of this user
Re:Run PHP-GTK2 through Apache web server 5 Months, 1 Week ago Karma: 8  
Hi Praveen,

Imagine your web server in US. A user from Japan access your web page. The user will see your web page in his browser in Japan.

It's possible that your web page do a system call to run a PHP-GTK script. However, a PHP-GTK script runs only locally. You will see your PHP-GTK application "pop-up" on your server, in US. The user in Japan will not see anything in his browser.

PHP-GTK is for running as a standalone application on your local machine. It is not for use in a browser.

You can develop a client-server type of application using PHP-GTK. In this case, you will need to develop a client application, and a server backend. The user will need to run your PHP-GTK client application, not from a browser.

Hope this makes things a bit clearer...

Regards,
/kksou
 
  The administrator has disabled public write access.
#583
ppraveenk (User)
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
Re:Run PHP-GTK2 through Apache web server 5 Months ago Karma: 0  
Hi,

Thanks for the reply.
So there is no way to incorporate the above gtk code in my php which is called through web server.
Any Ideas on how to achieve the blink functionlaity in Php will be gretely helpful.

Thanks,
Praveen.
 
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Blog - Forum - Privacy Policy - Contact Us
Copyright © 2006-2009. kksou.com. All Rights Reserved