本文整理汇总了PHP中GtkHBox::add方法的典型用法代码示例。如果您正苦于以下问题:PHP GtkHBox::add方法的具体用法?PHP GtkHBox::add怎么用?PHP GtkHBox::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GtkHBox
的用法示例。
在下文中一共展示了GtkHBox::add方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Class Constructor
* @param $name Name of the widget
*/
public function __construct($name)
{
parent::__construct();
$this->wname = $name;
$this->mask = 'yyyy-mm-dd';
$this->validations = array();
// creates the entry field
$this->entry = new TEntry($name);
$this->entry->setSize(200);
//set_size_request(200, 24);
$this->setMask($this->mask);
parent::add($this->entry);
// creates a button with a calendar image
$button = new GtkButton();
$button->set_relief(GTK::RELIEF_NONE);
$imagem = GtkImage::new_from_file('lib/adianti/images/tdate-gtk.png');
$button->set_image($imagem);
// define the button's callback
$button->connect_simple('clicked', array($this, 'onCalendar'));
parent::add($button);
// creates the calendar window
$this->popWindow = new GtkWindow(Gtk::WINDOW_POPUP);
// creates the calendar
$this->calendar = new GtkCalendar();
// define the action when the user selects a date
$this->calendar->connect_simple('day-selected-double-click', array($this, 'onSelectDate'));
$this->month = new TCombo('tdate-month');
$this->month->addItems(array(TAdiantiCoreTranslator::translate('January'), TAdiantiCoreTranslator::translate('February'), TAdiantiCoreTranslator::translate('March'), TAdiantiCoreTranslator::translate('April'), TAdiantiCoreTranslator::translate('May'), TAdiantiCoreTranslator::translate('June'), TAdiantiCoreTranslator::translate('July'), TAdiantiCoreTranslator::translate('August'), TAdiantiCoreTranslator::translate('September'), TAdiantiCoreTranslator::translate('October'), TAdiantiCoreTranslator::translate('November'), TAdiantiCoreTranslator::translate('December')));
$this->month->setCallback(array($this, 'onChangeMonth'));
$this->month->setSize(70);
for ($n = date('Y') - 10; $n <= date('Y') + 10; $n++) {
$years[$n] = $n;
}
$this->year = new TCombo('tdate-year');
$this->year->addItems($years);
$this->year->setCallback(array($this, 'onChangeMonth'));
$this->year->setSize(70);
$hbox = new GtkHBox();
$hbox->pack_start($this->month);
$hbox->pack_start($this->year);
$bt_today = new GtkButton(TAdiantiCoreTranslator::translate('Today'));
$bt_close = new GtkButton(TAdiantiCoreTranslator::translate('Close'));
$bt_today->connect_simple('clicked', array($this, 'selectToday'));
$inst = $this->popWindow;
$bt_close->connect_simple('clicked', array($inst, 'hide'));
$hbox2 = new GtkHBox();
$hbox2->pack_start($bt_today);
$hbox2->pack_start($bt_close);
$vbox = new GtkVBox();
$vbox->pack_start($hbox, FALSE, FALSE);
$vbox->pack_start($this->calendar);
$vbox->pack_start($hbox2, FALSE, FALSE);
// shows the window
$this->popWindow->add($vbox);
}
示例2: __construct
/**
* Class Constructor
* @param $name widget's name
*/
public function __construct($name)
{
parent::__construct();
$this->widget = GtkComboBox::new_text();
// create the combo model
$this->model = new GtkListStore(GObject::TYPE_STRING, GObject::TYPE_STRING);
$this->widget->set_model($this->model);
$this->widget->set_size_request(200, -1);
$this->wname = $name;
parent::add($this->widget);
$this->validations = array();
}
示例3: GtkWindow
<?php
/* Create base window */
$window = new GtkWindow();
$window->set_title('Notebooks and Pages');
$window->connect_simple('destroy', array('gtk', 'main_quit'));
$window->add($vbox = new GtkHBox());
$group = 'MyGroup';
$vbox->add($notebook1 = new GtkNoteBook());
$notebook1->append_page($label = new GtkLabel('This is the first page'));
$notebook1->set_tab_detachable($label, true);
$notebook1->append_page($label = new GtkLabel('This is the second page'));
$notebook1->set_tab_detachable($label, true);
$notebook1->append_page($label = new GtkLabel('This is the third page'));
$notebook1->set_tab_detachable($label, true);
$notebook1->set_group($group);
var_dump($notebook1->get_group());
$vbox->add($notebook2 = new GtkNoteBook());
$notebook2->append_page($label = new GtkLabel('This is the first page'));
$notebook2->set_tab_detachable($label, true);
$notebook2->append_page($label = new GtkLabel('This is the second page'));
$notebook2->set_tab_detachable($label, true);
$notebook2->append_page($label = new GtkLabel('This is the third page'));
$notebook2->set_tab_detachable($label, true);
$notebook2->set_group($group);
var_dump($notebook2->get_group());
unset($group);
$vbox->add($notebook3 = new GtkNoteBook());
$notebook3->append_page($label = new GtkLabel('This is the first page'));
$notebook3->set_tab_detachable($label, true);
$notebook3->append_page($label = new GtkLabel('This is the second page'));