cvs: php-gtk-doc /examples/reference/gtk/gtkaboutdialog constructor.phpw set_logo.phpw /examples/reference/gtk/gtkaccellabel constructor.phpw
/examples/reference/gtk/gtkalignment constructor.phpw /examples/reference/gtk/gtkcolorselectiondialog constructor.phpw
/examples/reference/gtk/gtkdialog constructor.phpw /examples/reference/gtk/gtkentry constructor.phpw /examples/reference/gtk/gtkeventbox
constructor.phpw /examples/reference/gtk/gtkexpander constructor.phpw /examples/reference/gtk/gtkfilechooserbutton constructor.phpw
/examples/reference/gtk/gtkfileselection constructor.phpw /examples/reference/gtk/gtkframe shadows.phpw /examples/reference/gtk/gtkiconview
constructor.phpw /examples/reference/gtk/gtklabel constructor.phpw /examples/reference/gtk/gtkmessagedialog constructor.phpw
/examples/reference/gtk/gtknotebook constructor.phpw /examples/reference/gtk/gtkseparator separators.phpw /examples/reference/gtk/gtktable
constructor.phpw /examples/re! ference/gtk/gtktextbuffer constructor.phpw /examples/tutorials/changes extension_check.phpw
/examples/tutorials/helloadvanced helloadvanced.phpw
| From: | Christian Weiske | Date: | Thu, 16 Mar 2006 21:17:34 +0000 |
| Subject: | cvs: php-gtk-doc /examples/reference/gtk/gtkaboutdialog constructor.phpw set_logo.phpw /examples/reference/gtk/gtkaccellabel constructor.phpw /examples/reference/gtk/gtkalignment constructor.phpw /examples/reference/gtk/gtkcolorselectiondialog constructor.phpw /examples/reference/gtk/gtkdialog constructor.phpw /examples/reference/gtk/gtkentry constructor.phpw /examples/reference/gtk/gtkeventbox constructor.phpw /examples/reference/gtk/gtkexpander constructor.phpw /examples/reference/gtk/gtkfilechooserbutton constructor.phpw /examples/reference/gtk/gtkfileselection constructor.phpw /examples/reference/gtk/gtkframe shadows.phpw /examples/reference/gtk/gtkiconview constructor.phpw /examples/reference/gtk/gtklabel constructor.phpw /examples/reference/gtk/gtkmessagedialog constructor.phpw /examples/reference/gtk/gtknotebook constructor.phpw /examples/reference/gtk/gtkseparator separators.phpw /examples/reference/gtk/gtktable constructor.phpw /examples/re! ference/gtk/gtktextbuffer constructor.phpw /examples/tutorials/changes extension_check.phpw /examples/tutorials/helloadvanced helloadvanced.phpw |
||
| Groups: | php.gtk.doc | ||
| Request: | Send a blank email to php-gtk-doc+get-1930@lists.php.net to get a copy of this message | ||
cweiske Thu Mar 16 21:17:34 2006 UTC
Modified files:
/php-gtk-doc/examples/reference/gtk/gtkaboutdialog constructor.phpw
set_logo.phpw
/php-gtk-doc/examples/reference/gtk/gtkaccellabel constructor.phpw
/php-gtk-doc/examples/reference/gtk/gtkalignment constructor.phpw
/php-gtk-doc/examples/reference/gtk/gtkcolorselectiondialog
constructor.phpw
/php-gtk-doc/examples/reference/gtk/gtkdialog constructor.phpw
/php-gtk-doc/examples/reference/gtk/gtkentry constructor.phpw
/php-gtk-doc/examples/reference/gtk/gtkeventbox constructor.phpw
/php-gtk-doc/examples/reference/gtk/gtkexpander constructor.phpw
/php-gtk-doc/examples/reference/gtk/gtkfilechooserbutton
constructor.phpw
/php-gtk-doc/examples/reference/gtk/gtkfileselection
constructor.phpw
/php-gtk-doc/examples/reference/gtk/gtkframe shadows.phpw
/php-gtk-doc/examples/reference/gtk/gtkiconview constructor.phpw
/php-gtk-doc/examples/reference/gtk/gtklabel constructor.phpw
/php-gtk-doc/examples/reference/gtk/gtkmessagedialog
constructor.phpw
/php-gtk-doc/examples/reference/gtk/gtknotebook constructor.phpw
/php-gtk-doc/examples/reference/gtk/gtkseparator separators.phpw
/php-gtk-doc/examples/reference/gtk/gtktable constructor.phpw
/php-gtk-doc/examples/reference/gtk/gtktextbuffer constructor.phpw
/php-gtk-doc/examples/tutorials/changes extension_check.phpw
/php-gtk-doc/examples/tutorials/helloadvanced helloadvanced.phpw
Log:
Fixed the widths (as Steph noted) and some CS issues in the examples.
http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkaboutdialog/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkaboutdialog/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkaboutdialog/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkaboutdialog/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkaboutdialog/constructor.phpw:1.1 Sun Oct 23 13:15:01 2005 +++ php-gtk-doc/examples/reference/gtk/gtkaboutdialog/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -6,10 +6,14 @@ $dlg->set_comments('These are my comments' . "\nWith a newline"); $dlg->set_copyright('Copyright (C) 1982-2005 myself'); -$dlg->set_license("MyPL v2\nDo whatever you want to do.\nBut don't hurt anyone.");//Button -$dlg->set_logo($dlg->render_icon(Gtk::STOCK_CDROM, Gtk::ICON_SIZE_LARGE_TOOLBAR)); +$dlg->set_license("MyPL v2\nDo whatever you want to do.\n" + . "But don't hurt anyone.");//Button +$dlg->set_logo( + $dlg->render_icon(Gtk::STOCK_CDROM, Gtk::ICON_SIZE_LARGE_TOOLBAR) +); $dlg->set_website('http://website.example.org'); -$dlg->set_translator_credits("German version - My Friend\nFrench version - Another Friend"); +$dlg->set_translator_credits("German version - My Friend\n" + . "French version - Another Friend"); $dlg->run(); ?> \ No newline at end of file http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkaboutdialog/set_logo.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkaboutdialog/set_logo.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkaboutdialog/set_logo.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkaboutdialog/set_logo.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkaboutdialog/set_logo.phpw:1.1 Sun Oct 23 13:15:01 2005 +++ php-gtk-doc/examples/reference/gtk/gtkaboutdialog/set_logo.phpw Thu Mar 16 21:17:33 2006 @@ -1,6 +1,8 @@ <?php $dlg = new GtkAboutDialog(); -$dlg->set_default_icon($dlg->render_icon(Gtk::STOCK_CDROM, Gtk::ICON_SIZE_LARGE_TOOLBAR)); +$dlg->set_default_icon( + $dlg->render_icon(Gtk::STOCK_CDROM, Gtk::ICON_SIZE_LARGE_TOOLBAR) +); $dlg->set_name('Logo demo'); $dlg->set_logo(null); $dlg->run(); http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkaccellabel/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkaccellabel/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkaccellabel/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkaccellabel/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkaccellabel/constructor.phpw:1.1 Sat Feb 18 09:25:52 2006 +++ php-gtk-doc/examples/reference/gtk/gtkaccellabel/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -9,7 +9,9 @@ $btn = new GtkButton('Save'); //Add a "Ctrl+S" accelerator to the button (and the group) -$btn->add_accelerator('activate', $accgrp, Gdk::KEY_S, Gdk::CONTROL_MASK, Gtk::ACCEL_VISIBLE); +$btn->add_accelerator('activate', $accgrp, Gdk::KEY_S, + Gdk::CONTROL_MASK, Gtk::ACCEL_VISIBLE +); //Tell the label which widget shall be activated $lbl->set_accel_widget($btn); http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw?r1=1.2&r2=1.3&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw:1.2 php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw:1.3 --- php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw:1.2 Thu Nov 3 17:40:27 2005 +++ php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -7,12 +7,14 @@ //A GtkVBox that will hold the GtkAlignment widgets and GtkHSeparators $vbox = new GtkVBox(); -//Let's create four GtkAlignment containers with different settings, each holding a button +//Let's create four GtkAlignment containers with different settings, +// each holding a button //First GtkAlignment container. -//Positioning the button at the top-left of the window, not allowing it to extend: +//Positioning the button at the top-left of the window, +// not allowing it to extend: $align1 = new GtkAlignment(0, 0, 0, 0); //Let's push the button down and right, with padding on the top and left: $align1->set_padding(100, 100, 100, 100); @@ -29,7 +31,8 @@ //Second GtkAlignment container. -//This container will center it's child, while not allowing it to extend to occupy all free space +//This container will center it's child, +// while not allowing it to extend to occupy all free space $align2 = new GtkAlignment(0.5, 0.5, 0, 0); //Creating a new button $button2 = new GtkButton('Centered, does not extend'); @@ -44,7 +47,8 @@ //Third GtkAlignment container. -//This container will center it's child, allowing it extend into 75% (0.75) of the *free space* in the container +//This container will center it's child, allowing it extend +// into 75% (0.75) of the *free space* in the container $align3 = new GtkAlignment(0.5, 0.5, 0.75, 0.75); //Creating a new button $button3 = new GtkButton("Centered, extends an extra \r\n75% of empty space"); http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkcolorselectiondialog/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkcolorselectiondialog/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkcolorselectiondialog/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkcolorselectiondialog/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkcolorselectiondialog/constructor.phpw:1.1 Fri Dec 2 23:27:20 2005 +++ php-gtk-doc/examples/reference/gtk/gtkcolorselectiondialog/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -6,7 +6,10 @@ //Let the Cancel button quit the program -$dlgColorsel->cancel_button->connect_simple('clicked', array($dlgColorsel, 'destroy')); +$dlgColorsel->cancel_button->connect_simple( + 'clicked', + array($dlgColorsel, 'destroy') +); //The OK button shows the current color $dlgColorsel->ok_button->set_label('Show color'); @@ -21,7 +24,13 @@ //we just want 8 bit, we shift the values by 8 bit $strColor = 'RGB: ' . ($color->red >> 8) . ' ' . ($color->green >> 8) . ' ' . ($color->blue >> 8); - $msg = new GtkMessageDialog(null, 0, Gtk::MESSAGE_INFO, Gtk::BUTTONS_OK, $strColor); + $msg = new GtkMessageDialog( + null, + 0, + Gtk::MESSAGE_INFO, + Gtk::BUTTONS_OK, + $strColor + ); $msg->run(); $msg->destroy(); }//function showColor($button) http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkdialog/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkdialog/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkdialog/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkdialog/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkdialog/constructor.phpw:1.1 Wed Dec 28 12:11:29 2005 +++ php-gtk-doc/examples/reference/gtk/gtkdialog/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -1,7 +1,14 @@ <?php /* Creating and initialising the dialog box */ -$dialogBox = new GtkDialog("This is a Dialog", NULL, Gtk::DIALOG_MODAL, -array(Gtk::STOCK_NO, Gtk::RESPONSE_NO, Gtk::STOCK_YES, Gtk::RESPONSE_YES)); +$dialogBox = new GtkDialog( + "This is a Dialog", + NULL, + Gtk::DIALOG_MODAL, + array( + Gtk::STOCK_NO, Gtk::RESPONSE_NO, + Gtk::STOCK_YES, Gtk::RESPONSE_YES + ) +); /* Creating and adding a question to the dialog */ $dialogQues = new GtkLabel("Do you like PHP-Gtk2?"); @@ -14,9 +21,9 @@ /* Running the dialog box */ $result = $dialogBox->run(); -/* Accessing the result and performing appropriate action */ -switch($result) -{ +/* Accessing the result and performing + appropriate action */ +switch($result) { case (Gtk::RESPONSE_YES): echo "Thanks!\n"; break; http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkentry/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkentry/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkentry/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkentry/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkentry/constructor.phpw:1.1 Sat Nov 19 10:06:48 2005 +++ php-gtk-doc/examples/reference/gtk/gtkentry/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -1,41 +1,37 @@ <?php -/* Checking for PHP-GTK 2 Module */ -if(!class_exists('gtk')) { - die('Please load the PHP-GTK 2 module in your php.ini'); -} - -/* Function to retrieve text from GtkEntry and Print it */ +//Function to retrieve text from GtkEntry and print it function get_input($entry) { - $input=$entry->get_text(); + $input = $entry->get_text(); echo "$input\r\n"; $entry->grab_focus(); $entry->set_text(""); } -/* Setting up the Window - Note the usage of connect_simple() - instead of deprecated connect_object() */ -$window = &new GtkWindow(); +//Setting up the Window +// Note the usage of connect_simple() +// instead of deprecated connect_object() +$window = new GtkWindow(); $window->set_position(Gtk::WIN_POS_CENTER); -$window->connect_simple('destroy', array('gtk', 'main_quit')); +$window->connect_simple('destroy', array('Gtk', 'main_quit')); -/* Adding a box to the Window to allow more than one Child */ -$box = &new GtkVBox(); +//Adding a box to the Window to allow more than one Child +$box = new GtkVBox(); $window->add($box); -/* Adding the GtkEntry widget and connecting - it to the callback function: get_text() */ -$entry = &new GtkEntry(); +//Adding the GtkEntry widget and connecting +// it to the callback function: get_text() +$entry = new GtkEntry(); $entry->connect('activate', 'get_input'); $box->add($entry); -/* Adding a GtkButton to the box and use connect_simple() so that it - will pass the GtkEntry to the callback function when it is clicked */ +//Adding a GtkButton to the box and use connect_simple() +// so that it will pass the GtkEntry to the callback +// function when it is clicked $button = &new GtkButton('Click Me to echo input!'); $button->connect_simple('clicked', 'get_input', $entry); $box->add($button); -/* Display everything and start the main loop */ +//Display everything and start the main loop $box->show_all(); $window->show_all(); Gtk::main(); http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkeventbox/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkeventbox/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkeventbox/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkeventbox/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkeventbox/constructor.phpw:1.1 Wed Dec 28 12:11:29 2005 +++ php-gtk-doc/examples/reference/gtk/gtkeventbox/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -1,51 +1,63 @@ <?php -/* Initialising the event box and adding an image to it */ +//Initialising the event box and adding an image to it $imageEvent = new GtkEventBox(); -$imageWidget = GtkImage::new_from_stock(Gtk::STOCK_DIALOG_WARNING, Gtk::ICON_SIZE_DIALOG); +$imageWidget = GtkImage::new_from_stock( + Gtk::STOCK_DIALOG_WARNING, + Gtk::ICON_SIZE_DIALOG +); $imageEvent->add($imageWidget); -/* Initialising another event box and adding a label to it */ +//Initialising another event box and adding a label to it $labelEvent = new GtkEventBox(); -$labelWidget = new GtkLabel("Click Something!"); +$labelWidget = new GtkLabel('Click something!'); $labelEvent->add($labelWidget); -/* Connecting the signals to the callback */ -$imageEvent->connect("button_press_event", "doSomething"); -$labelEvent->connect("button_press_event", "doSomething"); +//Connecting the signals to the callback +$imageEvent->connect('button_press_event', 'doSomething'); +$labelEvent->connect('button_press_event', 'doSomething'); -/* The callback function */ +//The callback function function doSomething($widget, $event) { - /* Determining which widget triggered the signal */ + //Determine which widget triggered the signal $widget = $widget->get_child()->get_name(); - if ($widget=='GtkImage') { + if ($widget == 'GtkImage') { $type = 'image'; } else { $type = 'label'; } - /* Displaying a dialog that displays a message */ - $dialog = new GtkMessageDialog(NULL,1,0,1,'You Clicked the '.$type.'!'); + //Show a dialog that displays a message + $dialog = new GtkMessageDialog( + null, + 0, + Gtk::MESSAGE_INFO, + Gtk::BUTTONS_OK, + 'You clicked the ' . $type . '!' + ); $dialog->run(); $dialog->destroy(); } -/* Creating a VBox to add the event boxes to */ +//Creating a VBox to add the event boxes to $vbox = new GtkVBox(); $seperator = new GtkHSeparator(); $vbox->pack_start($imageEvent); $vbox->pack_start($seperator); $vbox->pack_start($labelEvent); -/* Creating a window and adding the VBox to it */ +//Creating a window and adding the VBox to it $window = new GtkWindow(); $window->add($vbox); $window->set_position(Gtk::WIN_POS_CENTER); $window->set_default_size(200,150); $window->show_all(); $window->set_title("Event Boxes!"); -$window->connect_simple("destroy", array('gtk', 'main_quit')); +$window->connect_simple( + 'destroy', + array('Gtk', 'main_quit') +); -/* Starting main loop */ +//Starting main loop Gtk::main(); ?> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkexpander/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkexpander/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkexpander/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkexpander/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkexpander/constructor.phpw:1.1 Fri Dec 2 21:49:22 2005 +++ php-gtk-doc/examples/reference/gtk/gtkexpander/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -1,36 +1,30 @@ <?php -/* Creating the callbacks for handling basic window functions */ -function delete_event() -{ - return false; -} - -function destroy() +//Creating the callbacks for handling basic window functions +function onDestroy() { Gtk::main_quit(); } -/* Creating and initialising a new window to add our expander to */ +//Creating and initialising a new window to add our expander to $window = new GtkWindow(); -$window->connect('destroy', 'destroy'); -$window->connect('delete-event', 'delete_event'); +$window->connect('destroy', 'onDestroy'); $window->set_title('GtkExpander Demo'); -$window->set_default_size(250,60); +$window->set_default_size(250, 60); $window->set_border_width(10); -/* Creating a new expander object */ +//Creating a new expander object $expander = new GtkExpander('Expander'); -/* Creating a label to store details */ +//Creating a label to store details $label = new GtkLabel('Details can be shown or hidden'); -/* Adding the details to the expander */ +//Adding the details to the expander $expander->add($label); -/* Adding the expander to the window */ +//Adding the expander to the window $window->add($expander); -/* Displaying the window and starting the main loop */ +//Displaying the window and starting the main loop $window->show_all(); Gtk::main(); ?> \ No newline at end of file http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkfilechooserbutton/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkfilechooserbutton/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkfilechooserbutton/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkfilechooserbutton/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkfilechooserbutton/constructor.phpw:1.1 Tue Dec 20 22:43:29 2005 +++ php-gtk-doc/examples/reference/gtk/gtkfilechooserbutton/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -1,11 +1,15 @@ <?php -/* Creating and initialising a new window to add the FileChooser to */ +//Creating and initialising a new window +// to add the FileChooser to $window = new GtkWindow(); -/* Quit the main loop when window is destroyed */ -$window->connect_simple('destroy', array('gtk', 'main_quit')); +//Quit the main loop when window is destroyed +$window->connect_simple( + 'destroy', + array('Gtk', 'main_quit') +); -/* Setting parameters of the window */ +//Setting parameters of the window $window->set_title('GtkFileChooser Demo'); $window->set_default_size(250,60); $window->set_border_width(10); @@ -16,25 +20,30 @@ * will be performed when the open button of the * GtkFileChooserDialog widget is clicked */ -$thebutton = new GtkFileChooserButton('Select the File', -Gtk::FILE_CHOOSER_ACTION_OPEN); +$thebutton = new GtkFileChooserButton( + 'Select the File', + Gtk::FILE_CHOOSER_ACTION_OPEN +); -/* Creating a label and a quit button */ -$thelabel = new GtkLabel('Click to select a File: '); +//Creating a label and a quit button +$thelabel = new GtkLabel('Click to select a file: '); $toquit = new GtkButton('_Quit'); -$toquit->connect_simple('clicked', array($window, 'destroy')); +$toquit->connect_simple( + 'clicked', + array($window, 'destroy') +); -/* Creating a layout to add the elements */ +//Creating a layout to add the elements $thehbox = new GtkHBox(); $thevbox = new GtkVBox(); -/* Adding the elements to the layout */ +//Adding the elements to the layout $thehbox->pack_start($thelabel); $thehbox->pack_start($thebutton); $thevbox->pack_start($thehbox); $thevbox->pack_start($toquit); -/* Displaying the window and starting the main loop */ +//Displaying the window and starting the main loop $window->add($thevbox); $window->show_all(); Gtk::main(); http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkfileselection/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkfileselection/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkfileselection/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkfileselection/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkfileselection/constructor.phpw:1.1 Tue Dec 20 22:43:29 2005 +++ php-gtk-doc/examples/reference/gtk/gtkfileselection/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -1,28 +1,39 @@ <?php -/* Creating and initialising the file selection prompt */ +//Creating and initialising the file selection prompt $filePrompt = new GtkFileSelection('GtkFileSelection Demo'); -$filePrompt->connect_simple('destroy', array('gtk', 'main_quit')); +$filePrompt->connect_simple( + 'destroy', + array('Gtk', 'main_quit') +); -/* Adding a quit button that destroys the prompt */ +//Adding a quit button that destroys the prompt $filePrompt->cancel_button->set_label('Quit'); -$filePrompt->cancel_button->connect_simple('clicked', array($filePrompt, 'destroy')); +$filePrompt->cancel_button->connect_simple( + 'clicked', + array($filePrompt, 'destroy') +); -/* Add an OK button that displays the file selected on click */ +//Add an OK button that displays the file selected on click $filePrompt->ok_button->set_label('Show the file'); $filePrompt->ok_button->connect('clicked', 'showFile'); -/* Callback function that displays the file name */ +//Callback function that displays the file name function showFile($okbutton) { $filePrompt = $okbutton->get_toplevel(); $fileName = $filePrompt->get_filename(); - $message = new GtkMessageDialog(null, 0, Gtk::MESSAGE_INFO, - Gtk::BUTTONS_OK, 'You selected: ' . $fileName); + $message = new GtkMessageDialog( + null, + 0, + Gtk::MESSAGE_INFO, + Gtk::BUTTONS_OK, + 'You selected: ' . $fileName + ); $message->run(); $message->destroy(); } -/* Show the prompt and start the main loop */ +//Show the prompt and start the main loop $filePrompt->show(); Gtk::main(); ?> \ No newline at end of file http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkframe/shadows.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkframe/shadows.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkframe/shadows.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkframe/shadows.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkframe/shadows.phpw:1.1 Tue Jan 31 15:55:29 2006 +++ php-gtk-doc/examples/reference/gtk/gtkframe/shadows.phpw Thu Mar 16 21:17:33 2006 @@ -2,10 +2,9 @@ /** * Display the four border types */ - $wnd = new GtkWindow(); $wnd->set_title('Shadow types'); -$wnd->connect_simple('destroy', array('gtk', 'main_quit')); +$wnd->connect_simple('destroy', array('Gtk', 'main_quit')); $tbl = new GtkTable(2,2); $wnd->add($tbl); http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkiconview/constructor.phpw?r1=1.2&r2=1.3&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkiconview/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkiconview/constructor.phpw:1.2 php-gtk-doc/examples/reference/gtk/gtkiconview/constructor.phpw:1.3 --- php-gtk-doc/examples/reference/gtk/gtkiconview/constructor.phpw:1.2 Thu Oct 27 07:15:40 2005 +++ php-gtk-doc/examples/reference/gtk/gtkiconview/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -3,7 +3,7 @@ $wnd = new GtkWindow(); $wnd->set_title('GtkIconView'); $wnd->set_default_size(400, 400); -$wnd->connect_simple('destroy', array('gtk', 'main_quit')); +$wnd->connect_simple('destroy', array('Gtk', 'main_quit')); $iv = new GtkIconView(); @@ -27,7 +27,10 @@ //make it scrollable $scrollwin = new GtkScrolledWindow(); -$scrollwin->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); +$scrollwin->set_policy( + Gtk::POLICY_AUTOMATIC, + Gtk::POLICY_AUTOMATIC +); $scrollwin->add($iv); $wnd->add($scrollwin); http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtklabel/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtklabel/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtklabel/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtklabel/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtklabel/constructor.phpw:1.1 Sat Nov 5 08:29:09 2005 +++ php-gtk-doc/examples/reference/gtk/gtklabel/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -1,9 +1,12 @@ <?php function rotate($label) { - $label->set_label($label->get_angle() . ' ' . 'label text - this <b>is</b> a' - . '<span foreground="#F00">very long label</span>' - . 'so we can see <span background="green" size="larger"' - . ' weight="bold">rotation</span> better'); + $label->set_label( + $label->get_angle() + . ' label text - this <b>is</b> a' + . '<span foreground="#F00">very long label</span>' + . 'so we can see <span background="green" size="larger"' + . ' weight="bold">rotation</span> better' + ); $label->set_angle($label->get_angle() + 1); return true; } @@ -11,7 +14,7 @@ $wnd = new GtkWindow(); $wnd->set_default_size(500,500); $wnd->set_title('GtkLabel::set_angle'); -$wnd->connect_simple('destroy', array('gtk', 'main_quit')); +$wnd->connect_simple('destroy', array('Gtk', 'main_quit')); $label = new GtkLabel('t_est', true); $label->set_use_markup(true); http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkmessagedialog/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkmessagedialog/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkmessagedialog/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkmessagedialog/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkmessagedialog/constructor.phpw:1.1 Mon Aug 1 18:07:21 2005 +++ php-gtk-doc/examples/reference/gtk/gtkmessagedialog/constructor.phpw Thu Mar 16 21:17:34 2006 @@ -6,7 +6,10 @@ Gtk::BUTTONS_YES_NO, 'Do you like PHP-Gtk2?' ); -$dialog->set_markup('Do <b>you</b> like PHP-Gtk <span foreground="red">2</span>?'); +$dialog->set_markup( + 'Do <b>you</b> like PHP-Gtk ' + . '<span foreground="red">2</span>?' +); $answer = $dialog->run(); $dialog->destroy(); http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtknotebook/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtknotebook/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtknotebook/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtknotebook/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtknotebook/constructor.phpw:1.1 Sat Feb 18 10:35:42 2006 +++ php-gtk-doc/examples/reference/gtk/gtknotebook/constructor.phpw Thu Mar 16 21:17:34 2006 @@ -6,7 +6,10 @@ $ntbk->append_page(new GtkLabel('This is the first child')); //Create the second page, this time with an extra label -$ntbk->append_page(new GtkLabel('This is the second child'), new GtkLabel('Second')); +$ntbk->append_page( + new GtkLabel('This is the second child'), + new GtkLabel('Second') +); //Create the third page, with an icon as label and //some nested childs @@ -16,14 +19,17 @@ $vbox->pack_start(new GtkButton('Test'), false, false); $ntbk->append_page( $vbox, - GtkImage::new_from_stock(Gtk::STOCK_ADD, Gtk::ICON_SIZE_MENU) + GtkImage::new_from_stock( + Gtk::STOCK_ADD, + Gtk::ICON_SIZE_MENU + ) ); //The rest of the setup is standard $wnd = new GtkWindow(); $wnd->set_default_size(300, -1); -$wnd->connect_simple('destroy', array('gtk', 'main_quit')); +$wnd->connect_simple('destroy', array('Gtk', 'main_quit')); $wnd->add($ntbk); $wnd->show_all(); Gtk::main(); http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkseparator/separators.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkseparator/separators.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkseparator/separators.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkseparator/separators.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkseparator/separators.phpw:1.1 Sat Nov 5 08:32:13 2005 +++ php-gtk-doc/examples/reference/gtk/gtkseparator/separators.phpw Thu Mar 16 21:17:34 2006 @@ -1,17 +1,12 @@ <?php -//Checking for php-gtk -if( !class_exists('gtk')) { - die('Please load the php-gtk2 module in your php.ini' . "\r\n"); -} - -//The GtkBoxes we'll be using to arrange our demonstration +//The GtkBoxes we'll be using to arrange our demonstration $vbox = new GtkVBox(); $hbox = new GtkHBox(); //Labels that will identify each portion of the window -$label_top = new GtkLabel("Top"); -$label_br = new GtkLabel("Bottom right"); -$label_bl = new GtkLabel("Bottom left"); +$label_top = new GtkLabel('Top'); +$label_br = new GtkLabel('Bottom right'); +$label_bl = new GtkLabel('Bottom left'); //Our separators $vsep = new GtkVSeparator(); @@ -48,7 +43,7 @@ //Adding the GtkVBox to the window $win->add($vbox); //Connecting the destroy signal -$win->connect_simple('destroy', array('gtk','main_quit')); +$win->connect_simple('destroy', array('Gtk','main_quit')); //Showing the window's content $win->show_all(); //Main loop http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtktable/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtktable/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtktable/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtktable/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtktable/constructor.phpw:1.1 Wed Nov 23 09:14:03 2005 +++ php-gtk-doc/examples/reference/gtk/gtktable/constructor.phpw Thu Mar 16 21:17:34 2006 @@ -1,9 +1,4 @@ <?php -//Checking for php-gtk -if (!class_exists('gtk')) { - die('Please load the php-gtk2 module in your php.ini' . "\r\n"); -} - //Creating the window that will hold our example program $window = new GtkWindow(); //Title of the window @@ -11,9 +6,10 @@ //Initial placement of the window $window->set_position(Gtk::WIN_POS_CENTER); //Connecting the "destroy" signal -$window->connect_simple('destroy', array('gtk', 'main_quit')); +$window->connect_simple('destroy', array('Gtk', 'main_quit')); -//Creating our GtkTable - note that the homogeneous property defaults to false. +//Creating our GtkTable +// note that the homogeneous property defaults to false. $table = new GtkTable(3, 3, false); //Let's define the spacing between columns and rows to 10 pixels @@ -24,7 +20,8 @@ $window->add($table); //Now that we have a table, let's add some widgets to it -//Note the different AttachOptions: resize the window to see the effects of each +//Note the different AttachOptions: +// resize the window to see the effects of each $text = new GtkTextView(); $table->attach($text, 0, 3, 0, 1); @@ -37,20 +34,27 @@ $button3 = new GtkButton('Button 3 '); $table->attach($button3, 2, 3, 1, 2, Gtk::FILL, Gtk::EXPAND, 3, 3); -//Let's add a label with information. We'll use it to experiment with acessing -//widgets in a GtkTable -$label = new GtkLabel("Expand this window to see the difference \r\n" - . "between the GtkAttachOptions settings."); +//Let's add a label with information. +// We'll use it to experiment with acessing +// widgets in a GtkTable +$label = new GtkLabel( + "Expand this window to see the difference \r\n" + . "between the GtkAttachOptions settings." +); $table->attach($label, 0, 3, 2, 3, Gtk::SHRINK, Gtk::SHRINK); //Adding a button that will change the text in the label $button4 = new GtkButton('Change label text'); -//If you recall, we created a 3*3 table, but as we're out of space right now, -//this button will be placed on row 4. You can use resize(), but just attaching -//the child will cause the table to automatically change it's size + +//If you recall, we created a 3*3 table, but as we're out +// of space right now, this button will be placed on row +// 4. You can use resize(), but just attaching +// the child will cause the table to automatically change +// it's size $table->attach($button4, 0, 3, 3, 4, Gtk::FILL, Gtk::EXPAND, 3, 3); -//Let's connect button4 to a function that changes the text of the label +//Let's connect button4 to a function +// that changes the text of the label $button4->connect_simple('clicked', 'change_text'); //This function accesses the GtkLabel and changes it's content @@ -71,8 +75,10 @@ if (substr($current_text, 0, 6) == "Expand") { $children['1']->set_text("Have a nice day! \r\n"); } else { - $children['1']->set_text("Expand this window to see the difference \r\n" - . "between the GtkAttachOptions settings."); + $children['1']->set_text( + "Expand this window to see the difference \r\n" + . "between the GtkAttachOptions settings." + ); } } http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtktextbuffer/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtktextbuffer/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtktextbuffer/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtktextbuffer/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtktextbuffer/constructor.phpw:1.1 Thu Oct 27 07:15:45 2005 +++ php-gtk-doc/examples/reference/gtk/gtktextbuffer/constructor.phpw Thu Mar 16 21:17:34 2006 @@ -2,7 +2,7 @@ // Create a new window. $window = new GtkWindow(); // Properly handle closing of the window. -$window->connect_simple('destroy', array('gtk', 'main_quit')); +$window->connect_simple('destroy', array('Gtk', 'main_quit')); // Create a new buffer and a new view to show the buffer. $textBuffer = new GtkTextBuffer(); http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/tutorials/changes/extension_check.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/tutorials/changes/extension_check.phpw diff -u php-gtk-doc/examples/tutorials/changes/extension_check.phpw:1.1 php-gtk-doc/examples/tutorials/changes/extension_check.phpw:1.2 --- php-gtk-doc/examples/tutorials/changes/extension_check.phpw:1.1 Mon Dec 12 11:25:37 2005 +++ php-gtk-doc/examples/tutorials/changes/extension_check.phpw Thu Mar 16 21:17:34 2006 @@ -1,7 +1,7 @@ <?php if (!extension_loaded('php-gtk')) { - echo "The PHP-Gtk2 module is not available!\r\n"; - exit(1); + echo "The PHP-Gtk2 module is not available!\r\n"; + exit(1); } //..continue with your program ?> \ No newline at end of file http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/tutorials/helloadvanced/helloadvanced.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/tutorials/helloadvanced/helloadvanced.phpw diff -u php-gtk-doc/examples/tutorials/helloadvanced/helloadvanced.phpw:1.1 php-gtk-doc/examples/tutorials/helloadvanced/helloadvanced.phpw:1.2 --- php-gtk-doc/examples/tutorials/helloadvanced/helloadvanced.phpw:1.1 Wed Feb 15 15:17:45 2006 +++ php-gtk-doc/examples/tutorials/helloadvanced/helloadvanced.phpw Thu Mar 16 21:17:34 2006 @@ -14,9 +14,12 @@ * This function gets called as soon as the user * clicks on the Login button. * -* @param GtkWindow $wnd The login window, needed to close it when all is ok -* @param GtkEntry $txtUsername The username text field, used to get the username -* @param GtkEntry $txtPassword The password widget to retrieve the password +* @param GtkWindow $wnd The login window, needed to close it +* when all is ok +* @param GtkEntry $txtUsername The username text field, used to get +* the username +* @param GtkEntry $txtPassword The password widget to retrieve the +* password */ function login(GtkWindow $wnd, GtkEntry $txtUsername, GtkEntry $txtPassword) { @@ -36,8 +39,12 @@ if ($errors !== null) { //There was at least one error. //We show a message box with the errors - $dialog = new GtkMessageDialog($wnd, Gtk::DIALOG_MODAL, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, $errors); - $dialog->set_markup("The following errors occured:\r\n<span foreground='red'>" . $errors . "</span>"); + $dialog = new GtkMessageDialog($wnd, Gtk::DIALOG_MODAL, + Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, $errors); + $dialog->set_markup( + "The following errors occured:\r\n" + . "<span foreground='red'>" . $errors . "</span>" + ); $dialog->run(); $dialog->destroy(); } else { @@ -76,7 +83,7 @@ //Destroy the window when the user clicks Cancel $btnCancel->connect_simple('clicked', array($wnd, 'destroy')); //Call the login function when the user clicks on Login -$btnLogin ->connect_simple('clicked', 'login', $wnd, $txtUsername, $txtPassword); +$btnLogin->connect_simple('clicked', 'login', $wnd, $txtUsername, $txtPassword); //Lay out all the widgets in the table
http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkaboutdialog/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkaboutdialog/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkaboutdialog/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkaboutdialog/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkaboutdialog/constructor.phpw:1.1 Sun Oct 23 13:15:01 2005 +++ php-gtk-doc/examples/reference/gtk/gtkaboutdialog/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -6,10 +6,14 @@ $dlg->set_comments('These are my comments' . "\nWith a newline"); $dlg->set_copyright('Copyright (C) 1982-2005 myself'); -$dlg->set_license("MyPL v2\nDo whatever you want to do.\nBut don't hurt anyone.");//Button -$dlg->set_logo($dlg->render_icon(Gtk::STOCK_CDROM, Gtk::ICON_SIZE_LARGE_TOOLBAR)); +$dlg->set_license("MyPL v2\nDo whatever you want to do.\n" + . "But don't hurt anyone.");//Button +$dlg->set_logo( + $dlg->render_icon(Gtk::STOCK_CDROM, Gtk::ICON_SIZE_LARGE_TOOLBAR) +); $dlg->set_website('http://website.example.org'); -$dlg->set_translator_credits("German version - My Friend\nFrench version - Another Friend"); +$dlg->set_translator_credits("German version - My Friend\n" + . "French version - Another Friend"); $dlg->run(); ?> \ No newline at end of file http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkaboutdialog/set_logo.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkaboutdialog/set_logo.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkaboutdialog/set_logo.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkaboutdialog/set_logo.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkaboutdialog/set_logo.phpw:1.1 Sun Oct 23 13:15:01 2005 +++ php-gtk-doc/examples/reference/gtk/gtkaboutdialog/set_logo.phpw Thu Mar 16 21:17:33 2006 @@ -1,6 +1,8 @@ <?php $dlg = new GtkAboutDialog(); -$dlg->set_default_icon($dlg->render_icon(Gtk::STOCK_CDROM, Gtk::ICON_SIZE_LARGE_TOOLBAR)); +$dlg->set_default_icon( + $dlg->render_icon(Gtk::STOCK_CDROM, Gtk::ICON_SIZE_LARGE_TOOLBAR) +); $dlg->set_name('Logo demo'); $dlg->set_logo(null); $dlg->run(); http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkaccellabel/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkaccellabel/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkaccellabel/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkaccellabel/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkaccellabel/constructor.phpw:1.1 Sat Feb 18 09:25:52 2006 +++ php-gtk-doc/examples/reference/gtk/gtkaccellabel/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -9,7 +9,9 @@ $btn = new GtkButton('Save'); //Add a "Ctrl+S" accelerator to the button (and the group) -$btn->add_accelerator('activate', $accgrp, Gdk::KEY_S, Gdk::CONTROL_MASK, Gtk::ACCEL_VISIBLE); +$btn->add_accelerator('activate', $accgrp, Gdk::KEY_S, + Gdk::CONTROL_MASK, Gtk::ACCEL_VISIBLE +); //Tell the label which widget shall be activated $lbl->set_accel_widget($btn); http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw?r1=1.2&r2=1.3&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw:1.2 php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw:1.3 --- php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw:1.2 Thu Nov 3 17:40:27 2005 +++ php-gtk-doc/examples/reference/gtk/gtkalignment/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -7,12 +7,14 @@ //A GtkVBox that will hold the GtkAlignment widgets and GtkHSeparators $vbox = new GtkVBox(); -//Let's create four GtkAlignment containers with different settings, each holding a button +//Let's create four GtkAlignment containers with different settings, +// each holding a button //First GtkAlignment container. -//Positioning the button at the top-left of the window, not allowing it to extend: +//Positioning the button at the top-left of the window, +// not allowing it to extend: $align1 = new GtkAlignment(0, 0, 0, 0); //Let's push the button down and right, with padding on the top and left: $align1->set_padding(100, 100, 100, 100); @@ -29,7 +31,8 @@ //Second GtkAlignment container. -//This container will center it's child, while not allowing it to extend to occupy all free space +//This container will center it's child, +// while not allowing it to extend to occupy all free space $align2 = new GtkAlignment(0.5, 0.5, 0, 0); //Creating a new button $button2 = new GtkButton('Centered, does not extend'); @@ -44,7 +47,8 @@ //Third GtkAlignment container. -//This container will center it's child, allowing it extend into 75% (0.75) of the *free space* in the container +//This container will center it's child, allowing it extend +// into 75% (0.75) of the *free space* in the container $align3 = new GtkAlignment(0.5, 0.5, 0.75, 0.75); //Creating a new button $button3 = new GtkButton("Centered, extends an extra \r\n75% of empty space"); http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkcolorselectiondialog/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkcolorselectiondialog/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkcolorselectiondialog/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkcolorselectiondialog/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkcolorselectiondialog/constructor.phpw:1.1 Fri Dec 2 23:27:20 2005 +++ php-gtk-doc/examples/reference/gtk/gtkcolorselectiondialog/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -6,7 +6,10 @@ //Let the Cancel button quit the program -$dlgColorsel->cancel_button->connect_simple('clicked', array($dlgColorsel, 'destroy')); +$dlgColorsel->cancel_button->connect_simple( + 'clicked', + array($dlgColorsel, 'destroy') +); //The OK button shows the current color $dlgColorsel->ok_button->set_label('Show color'); @@ -21,7 +24,13 @@ //we just want 8 bit, we shift the values by 8 bit $strColor = 'RGB: ' . ($color->red >> 8) . ' ' . ($color->green >> 8) . ' ' . ($color->blue >> 8); - $msg = new GtkMessageDialog(null, 0, Gtk::MESSAGE_INFO, Gtk::BUTTONS_OK, $strColor); + $msg = new GtkMessageDialog( + null, + 0, + Gtk::MESSAGE_INFO, + Gtk::BUTTONS_OK, + $strColor + ); $msg->run(); $msg->destroy(); }//function showColor($button) http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkdialog/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkdialog/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkdialog/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkdialog/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkdialog/constructor.phpw:1.1 Wed Dec 28 12:11:29 2005 +++ php-gtk-doc/examples/reference/gtk/gtkdialog/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -1,7 +1,14 @@ <?php /* Creating and initialising the dialog box */ -$dialogBox = new GtkDialog("This is a Dialog", NULL, Gtk::DIALOG_MODAL, -array(Gtk::STOCK_NO, Gtk::RESPONSE_NO, Gtk::STOCK_YES, Gtk::RESPONSE_YES)); +$dialogBox = new GtkDialog( + "This is a Dialog", + NULL, + Gtk::DIALOG_MODAL, + array( + Gtk::STOCK_NO, Gtk::RESPONSE_NO, + Gtk::STOCK_YES, Gtk::RESPONSE_YES + ) +); /* Creating and adding a question to the dialog */ $dialogQues = new GtkLabel("Do you like PHP-Gtk2?"); @@ -14,9 +21,9 @@ /* Running the dialog box */ $result = $dialogBox->run(); -/* Accessing the result and performing appropriate action */ -switch($result) -{ +/* Accessing the result and performing + appropriate action */ +switch($result) { case (Gtk::RESPONSE_YES): echo "Thanks!\n"; break; http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkentry/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkentry/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkentry/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkentry/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkentry/constructor.phpw:1.1 Sat Nov 19 10:06:48 2005 +++ php-gtk-doc/examples/reference/gtk/gtkentry/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -1,41 +1,37 @@ <?php -/* Checking for PHP-GTK 2 Module */ -if(!class_exists('gtk')) { - die('Please load the PHP-GTK 2 module in your php.ini'); -} - -/* Function to retrieve text from GtkEntry and Print it */ +//Function to retrieve text from GtkEntry and print it function get_input($entry) { - $input=$entry->get_text(); + $input = $entry->get_text(); echo "$input\r\n"; $entry->grab_focus(); $entry->set_text(""); } -/* Setting up the Window - Note the usage of connect_simple() - instead of deprecated connect_object() */ -$window = &new GtkWindow(); +//Setting up the Window +// Note the usage of connect_simple() +// instead of deprecated connect_object() +$window = new GtkWindow(); $window->set_position(Gtk::WIN_POS_CENTER); -$window->connect_simple('destroy', array('gtk', 'main_quit')); +$window->connect_simple('destroy', array('Gtk', 'main_quit')); -/* Adding a box to the Window to allow more than one Child */ -$box = &new GtkVBox(); +//Adding a box to the Window to allow more than one Child +$box = new GtkVBox(); $window->add($box); -/* Adding the GtkEntry widget and connecting - it to the callback function: get_text() */ -$entry = &new GtkEntry(); +//Adding the GtkEntry widget and connecting +// it to the callback function: get_text() +$entry = new GtkEntry(); $entry->connect('activate', 'get_input'); $box->add($entry); -/* Adding a GtkButton to the box and use connect_simple() so that it - will pass the GtkEntry to the callback function when it is clicked */ +//Adding a GtkButton to the box and use connect_simple() +// so that it will pass the GtkEntry to the callback +// function when it is clicked $button = &new GtkButton('Click Me to echo input!'); $button->connect_simple('clicked', 'get_input', $entry); $box->add($button); -/* Display everything and start the main loop */ +//Display everything and start the main loop $box->show_all(); $window->show_all(); Gtk::main(); http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkeventbox/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkeventbox/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkeventbox/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkeventbox/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkeventbox/constructor.phpw:1.1 Wed Dec 28 12:11:29 2005 +++ php-gtk-doc/examples/reference/gtk/gtkeventbox/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -1,51 +1,63 @@ <?php -/* Initialising the event box and adding an image to it */ +//Initialising the event box and adding an image to it $imageEvent = new GtkEventBox(); -$imageWidget = GtkImage::new_from_stock(Gtk::STOCK_DIALOG_WARNING, Gtk::ICON_SIZE_DIALOG); +$imageWidget = GtkImage::new_from_stock( + Gtk::STOCK_DIALOG_WARNING, + Gtk::ICON_SIZE_DIALOG +); $imageEvent->add($imageWidget); -/* Initialising another event box and adding a label to it */ +//Initialising another event box and adding a label to it $labelEvent = new GtkEventBox(); -$labelWidget = new GtkLabel("Click Something!"); +$labelWidget = new GtkLabel('Click something!'); $labelEvent->add($labelWidget); -/* Connecting the signals to the callback */ -$imageEvent->connect("button_press_event", "doSomething"); -$labelEvent->connect("button_press_event", "doSomething"); +//Connecting the signals to the callback +$imageEvent->connect('button_press_event', 'doSomething'); +$labelEvent->connect('button_press_event', 'doSomething'); -/* The callback function */ +//The callback function function doSomething($widget, $event) { - /* Determining which widget triggered the signal */ + //Determine which widget triggered the signal $widget = $widget->get_child()->get_name(); - if ($widget=='GtkImage') { + if ($widget == 'GtkImage') { $type = 'image'; } else { $type = 'label'; } - /* Displaying a dialog that displays a message */ - $dialog = new GtkMessageDialog(NULL,1,0,1,'You Clicked the '.$type.'!'); + //Show a dialog that displays a message + $dialog = new GtkMessageDialog( + null, + 0, + Gtk::MESSAGE_INFO, + Gtk::BUTTONS_OK, + 'You clicked the ' . $type . '!' + ); $dialog->run(); $dialog->destroy(); } -/* Creating a VBox to add the event boxes to */ +//Creating a VBox to add the event boxes to $vbox = new GtkVBox(); $seperator = new GtkHSeparator(); $vbox->pack_start($imageEvent); $vbox->pack_start($seperator); $vbox->pack_start($labelEvent); -/* Creating a window and adding the VBox to it */ +//Creating a window and adding the VBox to it $window = new GtkWindow(); $window->add($vbox); $window->set_position(Gtk::WIN_POS_CENTER); $window->set_default_size(200,150); $window->show_all(); $window->set_title("Event Boxes!"); -$window->connect_simple("destroy", array('gtk', 'main_quit')); +$window->connect_simple( + 'destroy', + array('Gtk', 'main_quit') +); -/* Starting main loop */ +//Starting main loop Gtk::main(); ?> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkexpander/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkexpander/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkexpander/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkexpander/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkexpander/constructor.phpw:1.1 Fri Dec 2 21:49:22 2005 +++ php-gtk-doc/examples/reference/gtk/gtkexpander/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -1,36 +1,30 @@ <?php -/* Creating the callbacks for handling basic window functions */ -function delete_event() -{ - return false; -} - -function destroy() +//Creating the callbacks for handling basic window functions +function onDestroy() { Gtk::main_quit(); } -/* Creating and initialising a new window to add our expander to */ +//Creating and initialising a new window to add our expander to $window = new GtkWindow(); -$window->connect('destroy', 'destroy'); -$window->connect('delete-event', 'delete_event'); +$window->connect('destroy', 'onDestroy'); $window->set_title('GtkExpander Demo'); -$window->set_default_size(250,60); +$window->set_default_size(250, 60); $window->set_border_width(10); -/* Creating a new expander object */ +//Creating a new expander object $expander = new GtkExpander('Expander'); -/* Creating a label to store details */ +//Creating a label to store details $label = new GtkLabel('Details can be shown or hidden'); -/* Adding the details to the expander */ +//Adding the details to the expander $expander->add($label); -/* Adding the expander to the window */ +//Adding the expander to the window $window->add($expander); -/* Displaying the window and starting the main loop */ +//Displaying the window and starting the main loop $window->show_all(); Gtk::main(); ?> \ No newline at end of file http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkfilechooserbutton/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkfilechooserbutton/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkfilechooserbutton/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkfilechooserbutton/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkfilechooserbutton/constructor.phpw:1.1 Tue Dec 20 22:43:29 2005 +++ php-gtk-doc/examples/reference/gtk/gtkfilechooserbutton/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -1,11 +1,15 @@ <?php -/* Creating and initialising a new window to add the FileChooser to */ +//Creating and initialising a new window +// to add the FileChooser to $window = new GtkWindow(); -/* Quit the main loop when window is destroyed */ -$window->connect_simple('destroy', array('gtk', 'main_quit')); +//Quit the main loop when window is destroyed +$window->connect_simple( + 'destroy', + array('Gtk', 'main_quit') +); -/* Setting parameters of the window */ +//Setting parameters of the window $window->set_title('GtkFileChooser Demo'); $window->set_default_size(250,60); $window->set_border_width(10); @@ -16,25 +20,30 @@ * will be performed when the open button of the * GtkFileChooserDialog widget is clicked */ -$thebutton = new GtkFileChooserButton('Select the File', -Gtk::FILE_CHOOSER_ACTION_OPEN); +$thebutton = new GtkFileChooserButton( + 'Select the File', + Gtk::FILE_CHOOSER_ACTION_OPEN +); -/* Creating a label and a quit button */ -$thelabel = new GtkLabel('Click to select a File: '); +//Creating a label and a quit button +$thelabel = new GtkLabel('Click to select a file: '); $toquit = new GtkButton('_Quit'); -$toquit->connect_simple('clicked', array($window, 'destroy')); +$toquit->connect_simple( + 'clicked', + array($window, 'destroy') +); -/* Creating a layout to add the elements */ +//Creating a layout to add the elements $thehbox = new GtkHBox(); $thevbox = new GtkVBox(); -/* Adding the elements to the layout */ +//Adding the elements to the layout $thehbox->pack_start($thelabel); $thehbox->pack_start($thebutton); $thevbox->pack_start($thehbox); $thevbox->pack_start($toquit); -/* Displaying the window and starting the main loop */ +//Displaying the window and starting the main loop $window->add($thevbox); $window->show_all(); Gtk::main(); http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkfileselection/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkfileselection/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkfileselection/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkfileselection/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkfileselection/constructor.phpw:1.1 Tue Dec 20 22:43:29 2005 +++ php-gtk-doc/examples/reference/gtk/gtkfileselection/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -1,28 +1,39 @@ <?php -/* Creating and initialising the file selection prompt */ +//Creating and initialising the file selection prompt $filePrompt = new GtkFileSelection('GtkFileSelection Demo'); -$filePrompt->connect_simple('destroy', array('gtk', 'main_quit')); +$filePrompt->connect_simple( + 'destroy', + array('Gtk', 'main_quit') +); -/* Adding a quit button that destroys the prompt */ +//Adding a quit button that destroys the prompt $filePrompt->cancel_button->set_label('Quit'); -$filePrompt->cancel_button->connect_simple('clicked', array($filePrompt, 'destroy')); +$filePrompt->cancel_button->connect_simple( + 'clicked', + array($filePrompt, 'destroy') +); -/* Add an OK button that displays the file selected on click */ +//Add an OK button that displays the file selected on click $filePrompt->ok_button->set_label('Show the file'); $filePrompt->ok_button->connect('clicked', 'showFile'); -/* Callback function that displays the file name */ +//Callback function that displays the file name function showFile($okbutton) { $filePrompt = $okbutton->get_toplevel(); $fileName = $filePrompt->get_filename(); - $message = new GtkMessageDialog(null, 0, Gtk::MESSAGE_INFO, - Gtk::BUTTONS_OK, 'You selected: ' . $fileName); + $message = new GtkMessageDialog( + null, + 0, + Gtk::MESSAGE_INFO, + Gtk::BUTTONS_OK, + 'You selected: ' . $fileName + ); $message->run(); $message->destroy(); } -/* Show the prompt and start the main loop */ +//Show the prompt and start the main loop $filePrompt->show(); Gtk::main(); ?> \ No newline at end of file http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkframe/shadows.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkframe/shadows.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkframe/shadows.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkframe/shadows.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkframe/shadows.phpw:1.1 Tue Jan 31 15:55:29 2006 +++ php-gtk-doc/examples/reference/gtk/gtkframe/shadows.phpw Thu Mar 16 21:17:33 2006 @@ -2,10 +2,9 @@ /** * Display the four border types */ - $wnd = new GtkWindow(); $wnd->set_title('Shadow types'); -$wnd->connect_simple('destroy', array('gtk', 'main_quit')); +$wnd->connect_simple('destroy', array('Gtk', 'main_quit')); $tbl = new GtkTable(2,2); $wnd->add($tbl); http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkiconview/constructor.phpw?r1=1.2&r2=1.3&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkiconview/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkiconview/constructor.phpw:1.2 php-gtk-doc/examples/reference/gtk/gtkiconview/constructor.phpw:1.3 --- php-gtk-doc/examples/reference/gtk/gtkiconview/constructor.phpw:1.2 Thu Oct 27 07:15:40 2005 +++ php-gtk-doc/examples/reference/gtk/gtkiconview/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -3,7 +3,7 @@ $wnd = new GtkWindow(); $wnd->set_title('GtkIconView'); $wnd->set_default_size(400, 400); -$wnd->connect_simple('destroy', array('gtk', 'main_quit')); +$wnd->connect_simple('destroy', array('Gtk', 'main_quit')); $iv = new GtkIconView(); @@ -27,7 +27,10 @@ //make it scrollable $scrollwin = new GtkScrolledWindow(); -$scrollwin->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); +$scrollwin->set_policy( + Gtk::POLICY_AUTOMATIC, + Gtk::POLICY_AUTOMATIC +); $scrollwin->add($iv); $wnd->add($scrollwin); http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtklabel/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtklabel/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtklabel/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtklabel/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtklabel/constructor.phpw:1.1 Sat Nov 5 08:29:09 2005 +++ php-gtk-doc/examples/reference/gtk/gtklabel/constructor.phpw Thu Mar 16 21:17:33 2006 @@ -1,9 +1,12 @@ <?php function rotate($label) { - $label->set_label($label->get_angle() . ' ' . 'label text - this <b>is</b> a' - . '<span foreground="#F00">very long label</span>' - . 'so we can see <span background="green" size="larger"' - . ' weight="bold">rotation</span> better'); + $label->set_label( + $label->get_angle() + . ' label text - this <b>is</b> a' + . '<span foreground="#F00">very long label</span>' + . 'so we can see <span background="green" size="larger"' + . ' weight="bold">rotation</span> better' + ); $label->set_angle($label->get_angle() + 1); return true; } @@ -11,7 +14,7 @@ $wnd = new GtkWindow(); $wnd->set_default_size(500,500); $wnd->set_title('GtkLabel::set_angle'); -$wnd->connect_simple('destroy', array('gtk', 'main_quit')); +$wnd->connect_simple('destroy', array('Gtk', 'main_quit')); $label = new GtkLabel('t_est', true); $label->set_use_markup(true); http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkmessagedialog/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkmessagedialog/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkmessagedialog/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkmessagedialog/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkmessagedialog/constructor.phpw:1.1 Mon Aug 1 18:07:21 2005 +++ php-gtk-doc/examples/reference/gtk/gtkmessagedialog/constructor.phpw Thu Mar 16 21:17:34 2006 @@ -6,7 +6,10 @@ Gtk::BUTTONS_YES_NO, 'Do you like PHP-Gtk2?' ); -$dialog->set_markup('Do <b>you</b> like PHP-Gtk <span foreground="red">2</span>?'); +$dialog->set_markup( + 'Do <b>you</b> like PHP-Gtk ' + . '<span foreground="red">2</span>?' +); $answer = $dialog->run(); $dialog->destroy(); http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtknotebook/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtknotebook/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtknotebook/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtknotebook/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtknotebook/constructor.phpw:1.1 Sat Feb 18 10:35:42 2006 +++ php-gtk-doc/examples/reference/gtk/gtknotebook/constructor.phpw Thu Mar 16 21:17:34 2006 @@ -6,7 +6,10 @@ $ntbk->append_page(new GtkLabel('This is the first child')); //Create the second page, this time with an extra label -$ntbk->append_page(new GtkLabel('This is the second child'), new GtkLabel('Second')); +$ntbk->append_page( + new GtkLabel('This is the second child'), + new GtkLabel('Second') +); //Create the third page, with an icon as label and //some nested childs @@ -16,14 +19,17 @@ $vbox->pack_start(new GtkButton('Test'), false, false); $ntbk->append_page( $vbox, - GtkImage::new_from_stock(Gtk::STOCK_ADD, Gtk::ICON_SIZE_MENU) + GtkImage::new_from_stock( + Gtk::STOCK_ADD, + Gtk::ICON_SIZE_MENU + ) ); //The rest of the setup is standard $wnd = new GtkWindow(); $wnd->set_default_size(300, -1); -$wnd->connect_simple('destroy', array('gtk', 'main_quit')); +$wnd->connect_simple('destroy', array('Gtk', 'main_quit')); $wnd->add($ntbk); $wnd->show_all(); Gtk::main(); http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtkseparator/separators.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtkseparator/separators.phpw diff -u php-gtk-doc/examples/reference/gtk/gtkseparator/separators.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtkseparator/separators.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtkseparator/separators.phpw:1.1 Sat Nov 5 08:32:13 2005 +++ php-gtk-doc/examples/reference/gtk/gtkseparator/separators.phpw Thu Mar 16 21:17:34 2006 @@ -1,17 +1,12 @@ <?php -//Checking for php-gtk -if( !class_exists('gtk')) { - die('Please load the php-gtk2 module in your php.ini' . "\r\n"); -} - -//The GtkBoxes we'll be using to arrange our demonstration +//The GtkBoxes we'll be using to arrange our demonstration $vbox = new GtkVBox(); $hbox = new GtkHBox(); //Labels that will identify each portion of the window -$label_top = new GtkLabel("Top"); -$label_br = new GtkLabel("Bottom right"); -$label_bl = new GtkLabel("Bottom left"); +$label_top = new GtkLabel('Top'); +$label_br = new GtkLabel('Bottom right'); +$label_bl = new GtkLabel('Bottom left'); //Our separators $vsep = new GtkVSeparator(); @@ -48,7 +43,7 @@ //Adding the GtkVBox to the window $win->add($vbox); //Connecting the destroy signal -$win->connect_simple('destroy', array('gtk','main_quit')); +$win->connect_simple('destroy', array('Gtk','main_quit')); //Showing the window's content $win->show_all(); //Main loop http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtktable/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtktable/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtktable/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtktable/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtktable/constructor.phpw:1.1 Wed Nov 23 09:14:03 2005 +++ php-gtk-doc/examples/reference/gtk/gtktable/constructor.phpw Thu Mar 16 21:17:34 2006 @@ -1,9 +1,4 @@ <?php -//Checking for php-gtk -if (!class_exists('gtk')) { - die('Please load the php-gtk2 module in your php.ini' . "\r\n"); -} - //Creating the window that will hold our example program $window = new GtkWindow(); //Title of the window @@ -11,9 +6,10 @@ //Initial placement of the window $window->set_position(Gtk::WIN_POS_CENTER); //Connecting the "destroy" signal -$window->connect_simple('destroy', array('gtk', 'main_quit')); +$window->connect_simple('destroy', array('Gtk', 'main_quit')); -//Creating our GtkTable - note that the homogeneous property defaults to false. +//Creating our GtkTable +// note that the homogeneous property defaults to false. $table = new GtkTable(3, 3, false); //Let's define the spacing between columns and rows to 10 pixels @@ -24,7 +20,8 @@ $window->add($table); //Now that we have a table, let's add some widgets to it -//Note the different AttachOptions: resize the window to see the effects of each +//Note the different AttachOptions: +// resize the window to see the effects of each $text = new GtkTextView(); $table->attach($text, 0, 3, 0, 1); @@ -37,20 +34,27 @@ $button3 = new GtkButton('Button 3 '); $table->attach($button3, 2, 3, 1, 2, Gtk::FILL, Gtk::EXPAND, 3, 3); -//Let's add a label with information. We'll use it to experiment with acessing -//widgets in a GtkTable -$label = new GtkLabel("Expand this window to see the difference \r\n" - . "between the GtkAttachOptions settings."); +//Let's add a label with information. +// We'll use it to experiment with acessing +// widgets in a GtkTable +$label = new GtkLabel( + "Expand this window to see the difference \r\n" + . "between the GtkAttachOptions settings." +); $table->attach($label, 0, 3, 2, 3, Gtk::SHRINK, Gtk::SHRINK); //Adding a button that will change the text in the label $button4 = new GtkButton('Change label text'); -//If you recall, we created a 3*3 table, but as we're out of space right now, -//this button will be placed on row 4. You can use resize(), but just attaching -//the child will cause the table to automatically change it's size + +//If you recall, we created a 3*3 table, but as we're out +// of space right now, this button will be placed on row +// 4. You can use resize(), but just attaching +// the child will cause the table to automatically change +// it's size $table->attach($button4, 0, 3, 3, 4, Gtk::FILL, Gtk::EXPAND, 3, 3); -//Let's connect button4 to a function that changes the text of the label +//Let's connect button4 to a function +// that changes the text of the label $button4->connect_simple('clicked', 'change_text'); //This function accesses the GtkLabel and changes it's content @@ -71,8 +75,10 @@ if (substr($current_text, 0, 6) == "Expand") { $children['1']->set_text("Have a nice day! \r\n"); } else { - $children['1']->set_text("Expand this window to see the difference \r\n" - . "between the GtkAttachOptions settings."); + $children['1']->set_text( + "Expand this window to see the difference \r\n" + . "between the GtkAttachOptions settings." + ); } } http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/reference/gtk/gtktextbuffer/constructor.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/reference/gtk/gtktextbuffer/constructor.phpw diff -u php-gtk-doc/examples/reference/gtk/gtktextbuffer/constructor.phpw:1.1 php-gtk-doc/examples/reference/gtk/gtktextbuffer/constructor.phpw:1.2 --- php-gtk-doc/examples/reference/gtk/gtktextbuffer/constructor.phpw:1.1 Thu Oct 27 07:15:45 2005 +++ php-gtk-doc/examples/reference/gtk/gtktextbuffer/constructor.phpw Thu Mar 16 21:17:34 2006 @@ -2,7 +2,7 @@ // Create a new window. $window = new GtkWindow(); // Properly handle closing of the window. -$window->connect_simple('destroy', array('gtk', 'main_quit')); +$window->connect_simple('destroy', array('Gtk', 'main_quit')); // Create a new buffer and a new view to show the buffer. $textBuffer = new GtkTextBuffer(); http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/tutorials/changes/extension_check.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/tutorials/changes/extension_check.phpw diff -u php-gtk-doc/examples/tutorials/changes/extension_check.phpw:1.1 php-gtk-doc/examples/tutorials/changes/extension_check.phpw:1.2 --- php-gtk-doc/examples/tutorials/changes/extension_check.phpw:1.1 Mon Dec 12 11:25:37 2005 +++ php-gtk-doc/examples/tutorials/changes/extension_check.phpw Thu Mar 16 21:17:34 2006 @@ -1,7 +1,7 @@ <?php if (!extension_loaded('php-gtk')) { - echo "The PHP-Gtk2 module is not available!\r\n"; - exit(1); + echo "The PHP-Gtk2 module is not available!\r\n"; + exit(1); } //..continue with your program ?> \ No newline at end of file http://cvs.php.net/viewcvs.cgi/php-gtk-doc/examples/tutorials/helloadvanced/helloadvanced.phpw?r1=1.1&r2=1.2&diff_format=u Index: php-gtk-doc/examples/tutorials/helloadvanced/helloadvanced.phpw diff -u php-gtk-doc/examples/tutorials/helloadvanced/helloadvanced.phpw:1.1 php-gtk-doc/examples/tutorials/helloadvanced/helloadvanced.phpw:1.2 --- php-gtk-doc/examples/tutorials/helloadvanced/helloadvanced.phpw:1.1 Wed Feb 15 15:17:45 2006 +++ php-gtk-doc/examples/tutorials/helloadvanced/helloadvanced.phpw Thu Mar 16 21:17:34 2006 @@ -14,9 +14,12 @@ * This function gets called as soon as the user * clicks on the Login button. * -* @param GtkWindow $wnd The login window, needed to close it when all is ok -* @param GtkEntry $txtUsername The username text field, used to get the username -* @param GtkEntry $txtPassword The password widget to retrieve the password +* @param GtkWindow $wnd The login window, needed to close it +* when all is ok +* @param GtkEntry $txtUsername The username text field, used to get +* the username +* @param GtkEntry $txtPassword The password widget to retrieve the +* password */ function login(GtkWindow $wnd, GtkEntry $txtUsername, GtkEntry $txtPassword) { @@ -36,8 +39,12 @@ if ($errors !== null) { //There was at least one error. //We show a message box with the errors - $dialog = new GtkMessageDialog($wnd, Gtk::DIALOG_MODAL, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, $errors); - $dialog->set_markup("The following errors occured:\r\n<span foreground='red'>" . $errors . "</span>"); + $dialog = new GtkMessageDialog($wnd, Gtk::DIALOG_MODAL, + Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, $errors); + $dialog->set_markup( + "The following errors occured:\r\n" + . "<span foreground='red'>" . $errors . "</span>" + ); $dialog->run(); $dialog->destroy(); } else { @@ -76,7 +83,7 @@ //Destroy the window when the user clicks Cancel $btnCancel->connect_simple('clicked', array($wnd, 'destroy')); //Call the login function when the user clicks on Login -$btnLogin ->connect_simple('clicked', 'login', $wnd, $txtUsername, $txtPassword); +$btnLogin->connect_simple('clicked', 'login', $wnd, $txtUsername, $txtPassword); //Lay out all the widgets in the table