dl('php_gtk.' . PHP_SHLIB_SUFFIX); } /* * Called when delete-event happens. Returns false to indicate that the event * should proceed. */ function delete_event() { return false; } /* * Create a new top-level window and connect the signals to the appropriate * functions. Note that all constructors must be assigned by reference. */ $window = new GtkWindow(); $window->connect_object('destroy', array('gtk', 'main_quit')); $window->connect('delete-event', 'delete_event'); /* * Create a button and connect its 'clicked' signal to destroy() function. */ $button = new GtkButton('Close'); $button->connect_object('clicked', array('gtk', 'main_quit')); /* * Create a vertical layout box. */ $box = new GtkVBox(false, 10); $box->set_border_width(10); /* * Create a list widget and populate it with month names. */ $list = new GtkList();
/** * Create the user interface. * * The user interface is pretty simple. It consists of a * menu, text entry, run button, some labels, a progress * indicator, and a couple of areas for notification of * any messages. * * @access private * @param none * @return void */ function _createUI() { // Create a window. $window = new GtkWindow(); $window->set_title('PHPUnit Gtk'); $window->set_usize(400, -1); // Create the main box. $mainBox = new GtkVBox(); $window->add($mainBox); // Start with the menu. $mainBox->pack_start($this->_createMenu()); // Then add the suite field entry. $mainBox->pack_start($this->_createSuiteEntry()); // Then add the report labels. $mainBox->pack_start($this->_createReportLabels()); // Next add the progress bar. $mainBox->pack_start($this->_createProgressBar()); // Then add the report area and the dump area. $mainBox->pack_start($this->_createReportAreas()); // Finish off with the status line. $mainBox->pack_start($this->_createStatusLine()); // Connect the destroy signal. $window->connect_object('destroy', array('gtk', 'main_quit')); // Assign the member. $this->gui =& $window; }