本文整理汇总了PHP中Gtk类的典型用法代码示例。如果您正苦于以下问题:PHP Gtk类的具体用法?PHP Gtk怎么用?PHP Gtk使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Gtk类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: iniciarGUI
public function iniciarGUI()
{
$this->conectarCampo();
//começa a contar o tempo
$this->tempo->iniciar($this, $this->tempoMax);
Gtk::main();
}
开发者ID:Kuroesu,项目名称:campo-minado-plp,代码行数:7,代码来源:telaCampo.php
示例2: close
/**
* Close (hide) this window
*
*/
public function close()
{
$this->window->hide_all();
if ($this->initialized) {
Gtk::main_quit();
}
}
开发者ID:Gamepay,项目名称:xp-contrib,代码行数:11,代码来源:GtkGladeDialogWindow.class.php
示例3: run
public function run()
{
$gladefile = BASEDIR . '/data/explorer.glade';
$config = \Explorer\Config::getInstance();
$main = new \Explorer\Controller\MainWindowController($gladefile);
\Gtk::Main();
}
开发者ID:johannes,项目名称:php-explorer,代码行数:7,代码来源:Application.php
示例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();
}
}
开发者ID:amitjoy,项目名称:php-gtk,代码行数:8,代码来源:menubar.php
示例5: on_menu_select
function on_menu_select($button, $item)
{
// note 8
echo "menu item selected: {$item}\n";
if ($item == '_Quit') {
Gtk::main_quit();
}
}
开发者ID:amitjoy,项目名称:php-gtk,代码行数:8,代码来源:toolbar2.php
示例6: ExecXMoney
function ExecXMoney()
{
CheckSistema();
ExecWizard();
ExecLogin();
ExecJanelaPrincipal();
Gtk::main();
}
开发者ID:eneiasramos,项目名称:xmoney,代码行数:8,代码来源:xmoney.php
示例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"));
}
开发者ID:kaspernj,项目名称:knjphpfw,代码行数:8,代码来源:class_gtk2_mousegestures.php
示例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();
}
开发者ID:eneiasramos,项目名称:xmoney,代码行数:9,代码来源:notebook.php
示例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'));
}
开发者ID:patricmutwiri,项目名称:php-gtk-src,代码行数:11,代码来源:cairo_support.php
示例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"));
}
}
开发者ID:Kuroesu,项目名称:campo-minado-plp,代码行数:12,代码来源:Time.php
示例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();
}
开发者ID:skyview059,项目名称:puremvc-php-demo-gtk-employeeadmin,代码行数:12,代码来源:LayoutComponent.php
示例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;
}
开发者ID:patricmutwiri,项目名称:php-gtk-src,代码行数:43,代码来源:gtkiconview.php
示例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();
}
开发者ID:johannes,项目名称:php-explorer,代码行数:19,代码来源:MainWindowController.php
示例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;
}
开发者ID:jesseaf,项目名称:Fila-Sistema-de-Atendimento,代码行数:40,代码来源:gtk_senha.php
示例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);
}
开发者ID:eneiasramos,项目名称:xmoney,代码行数:22,代码来源:janela_principal.php
示例16: create_model
private function create_model()
{
$store = new GtkListStore(GObject::TYPE_PHP_VALUE, GObject::TYPE_STRING);
$ids = Gtk::stock_list_ids();
sort($ids);
foreach ($ids as $id) {
$info = new StockItemInfo($id);
$stock_item = Gtk::stock_lookup($id);
if ($stock_item) {
$info->stock_item = $stock_item;
} else {
$info->stock_item = array('', '', 0, 0, '');
}
$icon_set = GtkIconFactory::lookup_default($id);
if ($icon_set) {
$sizes = $icon_set->get_sizes();
$size = $sizes[0];
for ($i = 0; $i < count($sizes); $i++) {
if ($sizes[$i] == Gtk::ICON_SIZE_MENU) {
$size = Gtk::ICON_SIZE_MENU;
break;
}
}
$info->small_icon = $this->render_icon($info->stock_id, $size);
if ($size != Gtk::ICON_SIZE_MENU) {
list($width, $height) = Gtk::icon_size_lookup(Gtk::ICON_SIZE_MENU);
$info->small_icon = $info->small_icon->scale_simple($width, $height, 'bilinear');
}
} else {
$info->small_icon = null;
}
if ($info->stock_item[3] == 0) {
$info->accel_str = '';
} else {
$info->accel_str = '<' . Gtk::accelerator_get_label($info->stock_item[3], $info->stock_item[2]) . '>';
}
$iter = $store->append();
$store->set($iter, 0, $info, 1, $id);
}
return $store;
}
开发者ID:patricmutwiri,项目名称:php-gtk-src,代码行数:41,代码来源:stock-browser.php
示例17: CloseWindow
function CloseWindow(){
Gtk::main_quit();
}
开发者ID:kaspernj,项目名称:knjRenamer,代码行数:3,代码来源:knjrenamer.php
示例18: DoEvents
/**
* Método que libera o loop principal do Gtk
*
* @name DoEvents()
*/
public function DoEvents()
{
// Espera enquanto existe evento pendente
while (Gtk::events_pending()) {
// Libera o loop
Gtk::main_iteration();
}
}
开发者ID:BGCX067,项目名称:fabulafw-svn-to-git,代码行数:13,代码来源:Fabula.class.php
示例19: onSaveClick
* Executado quando usuário clica no botão salvar
*/
public function onSaveClick()
{
// obtém os valores dos campos
$dados['id'] = $this->campos['id']->get_text();
$dados['nome'] = $this->campos['nome']->get_text();
$dados['endereco'] = $this->campos['endereco']->get_text();
$dados['telefone'] = $this->campos['telefone']->get_text();
$dados['id_cidade'] = $this->campos['id_cidade']->get_active();
try {
// instancia cliente SOAP
$client = new SoapClient(NULL, array('encoding' => 'ISO-8859-1', 'exceptions' => TRUE, 'location' => "http://127.0.0.1/server.php", 'uri' => "http://test-uri/"));
// realiza chamada remota de método
$retorno = $client->salvar($dados);
// exibe diálogo de mensagem
$dialog = new GtkMessageDialog(null, Gtk::DIALOG_MODAL, Gtk::MESSAGE_INFO, Gtk::BUTTONS_OK, 'Registro inserido com sucesso!');
$dialog->run();
$dialog->destroy();
} catch (SoapFault $excecao) {
// exibe diálogo de erro
$error = new GtkMessageDialog(null, Gtk::DIALOG_MODAL, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, $excecao->getMessage());
$error->run();
$error->destroy();
}
}
}
// instancia janela NovoCliente
new NovoCliente();
Gtk::Main();
开发者ID:ricardohenriq,项目名称:learn-php,代码行数:30,代码来源:NovoCliente.php
示例20: start
/**
* Inicia a captura (atualização) dos frames
*
* @name start()
*/
public function start()
{
$this->make_snapshot();
$this->resTimer = Gtk::timeout_add(600, array($this, "make_snapshot"));
}
开发者ID:BGCX067,项目名称:fabulafw-svn-to-git,代码行数:10,代码来源:FFWWebCam.widget.php
注:本文中的Gtk类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论