示例#1
0
 /**
  * Show the table and all aggregated rows
  */
 public function show()
 {
     if ($this->showed === FALSE) {
         $i = 0;
         if ($this->rows) {
             foreach ($this->rows as $row) {
                 $c = 0;
                 if ($row->getCells()) {
                     foreach ($row->getCells() as $column) {
                         $properties = $column->getProperties();
                         $properties['colspan'] = isset($properties['colspan']) ? $properties['colspan'] - 1 : 0;
                         $hbox = new GtkHBox();
                         if (isset($properties['width'])) {
                             $hbox->set_size_request($properties['width'], -1);
                         }
                         $hbox->set_border_width(1);
                         $hbox->pack_start($column->getContent(), false, false);
                         $column->getContent()->show();
                         //$hbox->pack_start(new GtkHBox, true, true);
                         parent::attach($hbox, $c, $c + 1 + $properties['colspan'], $i, $i + 1, GTK::FILL, 0, 0, 0);
                         $c++;
                     }
                 }
                 $i++;
             }
         }
         $this->showed = TRUE;
     }
     parent::show();
 }
示例#2
0
文件: link2.php 项目: amitjoy/php-gtk
$window = new GtkWindow();
$window->set_size_request(400, 200);
$window->set_title('launch browser');
$window->connect_simple('destroy', array('Gtk', 'main_quit'));
$window->add($vbox = new GtkVBox());
// displays a title
$title = new GtkLabel("Launch External Application in windows\n  without the flashing of cmd window");
$title->modify_font(new PangoFontDescription("Times New Roman Italic 10"));
$title->modify_fg(Gtk::STATE_NORMAL, GdkColor::parse("#0000ff"));
$title->set_size_request(-1, 40);
$vbox->pack_start($title, 0, 0);
$vbox->pack_start(new GtkLabel(''));
// create the clickable label
$clickable_label = new GtkHBox();
$clickable_label->set_size_request(-1, 24);
$vbox->pack_start($clickable_label, 0, 0);
$clickable_label->pack_start(new GtkLabel("reference: php-gtk2 "), 0, 0);
$clickable_label->pack_start(link("manual", "http://gtk.php.net/manual/en/gtkclasses.php"), 0, 0);
$clickable_label->pack_start(new GtkLabel(" and "), 0, 0);
$clickable_label->pack_start(link("mailing list", "http://www.nabble.com/Php---GTK---General-f171.html"), 0, 0);
//$vbox->pack_start(new GtkLabel(''));
$status = new GtkLabel('');
$status->set_alignment(0, 0);
$vbox->pack_start($status, 0, 0);
// function to setup the link
function link($title, $url)
{
    $label = new GtkLabel($title);
    $label->set_markup('<span color="blue"><u>' . $title . "</u></span>");
    $eventbox = new GtkEventBox();