Please visit our sponsor
UNKNOWN //************************************** // Name: PHP-GTK Window Code // Description:Simple explanation of PHP-GTK framework...! // By: Bogomil Shopov // // // Inputs:None // // Returns:None // //Assumes:None // //Side Effects:None //This code is copyrighted and has limited warranties. //Please see http://www.Planet-Source-Code.com/xq/ASP/txtCodeId.462/lngWId.8/qx/vb/scripts/ShowCode.htm //for details. //************************************** <?PHP //import the php-gtk library file (dll (win)) dl('php_gtk.dll'); // define variables // window $window =&new GtkWindow(); $window->set_title("Messenger"); //button $bt=&new; GtkButton("Send value"); $bt2=&new; GtkButton("Kill Me!"); //layout $adj=&new; GtkAdjustment(0,0,400,400,400,400); $lt=&new; GtkLayout($adj,$adj); // TextField global $fld; $fld= &new; GtkEntry(); //functions function get_value($bt,$window){ global $fld; $str=$fld-&gt;get_text(); echo"Your input:$str"; } //element properties $bt-&gt;connect("clicked","get_value", $window); $bt2-&gt;connect_object('clicked', array('gtk', 'main_quit')); //Layout positon $lt-&gt;put($fld,1,1); $lt-&gt;put($bt,50,50); $lt-&gt;put($bt2,50,100); //window show $window-&gt;add($lt); $window-&gt;show_all(); Gtk::Main(); ?&gt;