本文整理汇总了PHP中Gtk类的典型用法代码示例。如果您正苦于以下问题:PHP Gtk类的具体用法?PHP Gtk怎么用?PHP Gtk使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Gtk类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: iniciarGUI
public function iniciarGUI()
{
$this->conectarCampo();
//começa a contar o tempo
$this->tempo->iniciar($this, $this->tempoMax);
Gtk::main();
}
示例2: close
/**
* Close (hide) this window
*
*/
public function close()
{
$this->window->hide_all();
if ($this->initialized) {
Gtk::main_quit();
}
}
示例3: run
public function run()
{
$gladefile = BASEDIR . '/data/explorer.glade';
$config = \Explorer\Config::getInstance();
$main = new \Explorer\Controller\MainWindowController($gladefile);
\Gtk::Main();
}
示例4: on_menu_select
function on_menu_select($menu_item)
{
$item = $menu_item->child->get_label();
echo "menu selected: {$item}\n";
if ($item == '_Quit') {
Gtk::main_quit();
}
}
示例5: on_menu_select
function on_menu_select($button, $item)
{
// note 8
echo "menu item selected: {$item}\n";
if ($item == '_Quit') {
Gtk::main_quit();
}
}
示例6: ExecXMoney
function ExecXMoney()
{
CheckSistema();
ExecWizard();
ExecLogin();
ExecJanelaPrincipal();
Gtk::main();
}
示例7: __construct
function __construct()
{
require_once "knj/class_knj_eventmanager.php";
$this->em = new EventManager();
$this->em->addEvent(array("mouseclick", "north", "east", "south", "west", "northeast", "northwest", "southeast", "southwest"));
$this->proc = fopen("/dev/input/mice", "r") or die;
Gtk::io_add_watch($this->proc, GObject::IO_IN, array($this, "on_mouseevent_do"));
}
示例8: xmoney_close_clicked
function xmoney_close_clicked()
{
$dialog = new Question($this->Owner, 'Sair do X-Money?');
$result = $dialog->ask();
if ($result != Gtk::RESPONSE_YES) {
return;
}
Gtk::main_quit();
}
示例9: __construct
public function __construct()
{
parent::__construct();
$this->connect('expose-event', array($this, 'expose'));
$this->connect('button-press-event', array($this, 'button_press'));
$this->connect('button-release-event', array($this, 'button_release'));
$this->connect('motion-notify-event', array($this, 'motion_notify'));
$this->add_events(Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::POINTER_MOTION_MASK);
$this->update();
Gtk::timeout_add(1000, array($this, 'update'));
}
示例10: iniciar
public function iniciar($telaCampo, $tempoMax)
{
//Só vai contar o tempo se o $tempoMax for diferente den null.
//É usado quando o usuário escolhe a opção sem tempo.
if ($tempoMax != null) {
$this->contar = True;
$this->tempoMax = $tempoMax;
$this->telaCampo = $telaCampo;
$this->barraProgresso = $telaCampo->campoXML->get_widget('barra_tempo');
Gtk::timeout_add(1000, array($this, "contarTempo"));
}
}
示例11: init
public function init(GtkFrame $userList, GtkFrame $userForm, GtkFrame $rolePanel)
{
$mainVBox = new GtkVBox(false, 10);
$mainHBox = new GtkHBox(true, 10);
$mainVBox->pack_start($userList, true, true, 0);
$mainHBox->pack_start($userForm, true, true, 0);
$mainHBox->pack_start($rolePanel, true, true, 0);
$mainVBox->pack_start($mainHBox, false, false, 0);
$this->window->add($mainVBox);
$this->window->show_all();
Gtk::main();
}
示例12: __create_box
function __create_box()
{
$iv = new GtkIconView();
$model = new GtkListStore(GdkPixbuf::gtype, GObject::TYPE_STRING);
$iv->set_model($model);
$iv->set_columns(1);
$ids = Gtk::stock_list_ids();
sort($ids);
foreach ($ids as $id) {
$pixbuf = $iv->render_icon($id, Gtk::ICON_SIZE_DIALOG);
$model->set($model->append(), 0, $pixbuf, 1, $id);
}
$iv->set_pixbuf_column(0);
$iv->set_text_column(1);
//multi select incl. zooming up an rectangle to select icons
$iv->set_selection_mode(Gtk::SELECTION_MULTIPLE);
//labels at the right side
$iv->set_orientation(Gtk::ORIENTATION_HORIZONTAL);
//enough place for the text so that it doesn't wrap
$iv->set_item_width(200);
//spacing between icon and label
$iv->set_spacing(0);
//spacing between single rows
$iv->set_row_spacing(0);
//spacing between cols
//margin from the edges of the view widget -> like the CSS margin property
$iv->set_margin(5);
//in how many columns the view will be split
//Icon order (for 3 columns):
// 1 2 3
// 4 5 6
//FIXME: is there a way to arrange it horizontally so that it's arranged that way:
// 1 4 7
// 2 5 8
// 3 6 9 ?
//0 is auto-fit
$iv->set_columns(0);
$editor = new WidgetEditor($iv, array(array('selection_mode', GtkComboBox::gtype, 'Gtk::SELECTION_'), array('orientation', GtkComboBox::gtype, 'Gtk::ORIENTATION_'), array('item_width', GtkScale::gtype, 0, 500), array('spacing', GtkScale::gtype, -100, 100), array('row_spacing', GtkScale::gtype, -100, 100), array('column_spacing', GtkScale::gtype, -100, 100), array('margin', GtkScale::gtype, -100, 200), array('columns', GtkScale::gtype, 0, 20)));
$scrollwin = new GtkScrolledWindow();
$scrollwin->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
$scrollwin->add($iv);
return $scrollwin;
}
示例13: __construct
public function __construct($file)
{
$this->loadGlade($file);
$this->mainWindow = new \Explorer\GUI\MainWindow($this);
$status = $this->glade->get_widget('loadingprogress');
$r = new \ReflectionObject($this);
$methods = iterator_to_array(new InitFuncFilterIterator(new \ArrayIterator($r->getMethods())));
$count = count($methods);
$i = 0;
foreach ($methods as $method) {
$this->{$method}();
$status->set_pulse_step(++$i / $count);
while (\Gtk::events_pending()) {
\Gtk::main_iteration();
}
}
$this->glade->get_widget('loadingwindow')->set_visible(false);
$this->mainWindow->show();
}
示例14: lista_senha
function lista_senha()
{
global $arraytotal, $posicao, $tamanho, $lblsenha, $lblultima, $ultima_p, $ultima_n, $ultima_s;
if (sizeof($arraytotal) == 0) {
$posicao = 0;
$tamanho = 0;
$tela = "";
echo "sizeof: {$tamanho}\n";
} else {
$tela = $arraytotal[$posicao][0] . " " . $arraytotal[$posicao][1];
completa_ultimas($arraytotal[$posicao]);
echo "tela: {$tela}";
}
if ($posicao == $tamanho) {
completa_array();
$posicao = 0;
echo "completando array\n";
} else {
$posicao = $posicao + 1;
echo "incrementando posicao\n";
echo "proxima posicao: {$posicao}\n";
}
$lblsenha->set_label($tela);
if (trim($tela) != "") {
Gtk::timeout_add(100, 'toca_tchuru');
}
$telaultima = "";
if ($ultima_p[2] > 0) {
$telaultima = $telaultima . $ultima_p[1] . " " . $ultima_p[2];
}
if ($ultima_s[2] > 0) {
$telaultima = $telaultima . $ultima_s[1] . " " . $ultima_s[2];
}
if ($ultima_n[2] > 0) {
$telaultima = $telaultima . $ultima_n[1] . " " . $ultima_n[2];
}
$lblultima->set_label($telaultima);
echo "setando label\n\n\n";
return true;
}
示例15: __construct
function __construct()
{
parent::__construct(XMONEY_TITULO . ' - ' . XMONEY_DESCRICAO . ' - ' . XMONEY_DESC_VERSAO, 800, 600, 'logo.png');
$this->connect('delete_event', array($this, delete_event));
// Painel
$this->pack_start($hpaned = new GtkHPaned());
$hpaned->pack1($this->painel = new TPainel($this), false, true);
// Notebook
$hpaned->pack2($this->notebook = new TNotebook($this), true, true);
// status
$this->pack_start($hbox = new GtkHBox(), false);
$hbox->pack_start($filial = new GtkLabel());
$filial->set_markup('<b> Filial: </b>' . $GLOBALS['Filial']);
$hbox->pack_start($usuario = new GtkLabel());
$usuario->set_markup('<b>' . latin1(' Usuário: ') . '</b>' . $GLOBALS['Usuario']);
$hbox->pack_start($nome = new GtkLabel());
$nome->set_markup('<b> Nome: </b>' . $GLOBALS['Nome']);
$hbox->pack_start($this->data = new GtkLabel());
$this->children_show_all();
Gtk::timeout_add(1000, array($this, 'data_timeout'));
define('XMONEY_JANELA_PRINCIPAL', $this);
}