Você está na página 1de 608

PHP-GTK Manual James Moore Steph Fox Andrei Zmievski et al.

Editado por Pablo Dall'Oglio Thomas Gonzalez Miranda Direitos Autorais 2001, 2002, 2003, 2004 por Grupo de Documentao PHP-GTK Copyright Este manual 2001 - 2004 para o Grupo de Documentao PHP-GTK. Os membros e editores esto listados na pgina inicial do manual. Copyright 2001 - 2004 Grupo de Documentao PHP-GTK. permitido copiar distribuir e/ou modificar este documento perante os termos da GNU Free Software Documentation License, verso 1.1 publicada pela Free Software Foundation; with no Invariant Sections, with no Front-Cover texts and with no Back-Cover texts. Uma cpia da licensa est includa na seo entitulada "GNU Free Documentation License". Sun Jan 29 20:57:59 CST 2006 _________________________________________________________________ ndice Prefcio Guia do Usurio Tutoriais sobre PHP-GTK Guia de Refercia Apndice Prefcio _________________________________________________________________ Este manual est divido em trs partes. A primeira parte o Guia do Usurio. Nela abordado os temas sobre conceitos gerais por trs da criao de aplicativos com Interfaces Grficas para Usurios (GUI). A segunda parte o Guia de Refercia. Nela explicado detalhadamente cada um dos objetos GTK bem como os mtodos e sinais que podem ser atribudos eles. Na terceira e ltima parte, h uma seo nomeada Tutoriais, onde voc poder obter alguns exemplos de aplicaes prontas feitas em PHP-GTK. Somente a seo de Referncia est includa no sistema de busca (nas verses em PHP).

O manual produzido usando uma verso modificada do Docbook DTD. As modificaes que foram feitas permitem documentao dos objetos usados pelo sistema do PHP-GTK. Os XML bsicos para cada uma das classes e seus mtodos so gerados automaticamente partir do cdigo fonte do PHP-GTK. Note que no possvel gerarl informaes sobre os sinais desta maneira, ex: se no h uma descrio textual sobre o sinal para uma classe, ento ela considerada incompleta e no includa. O gerador XML foi escrito por Andrei Zmievski, o autor original do PHP-GTK. A documentao transformada partir de um cdigo-fonte em XML para vrios outros formados usando folhas de estilos XSL bem como uma srie de outras ferramentas. O sistema de gerao do manual foi criado por James Moore e mantido por James Moore e Steph Fox. O manual est atualmente disponvel em formato texto puro, mltiplos arquivos HTML ou em um nico arquivo HTML e tambm em formatos que podem ser usados em sistemas de busca do PHP, todos eles podem ser baixados em PHP-GTK website. Guia do Usurio _________________________________________________________________ ndice Introduo oa PHP-GTK Comeando... Elementos Bsicos Introduo oa PHP-GTK Esta seo do manual fala sobre as idias e tecnologias por trs do PHP-GTK. ndice O que PHP-GTK? O que PHP? O que GTK+? Agradecimentos O que PHP-GTK? PHP-GTK uma extenso do PHP que permite voc escrever no lado-cliente, aplicaes multi-plataforma. Esta a primeira extenso para o PHP deste tipo, e foi escrita em parte para provar que o PHP capaz de ser uma linguagem de uso-geral que pode ser usado para muito mais do que somente escrever aplicaes no ambiente web. Esta extenso no ir permitir voc mostrar aplicaes GTK+ em um navegador-web. A inteno dela criar aplicaes GUI autnomas

(standalone). O que PHP? ndice A Histria do PHP O que o PHP faz? A Histria do PHP O PHP comeou e ainda usado principalmente como uma linguagem de scripting do lado-servidor embutida no HTML. PHP, conhecido originalmente como Personal Home Pages, foi primeiramente concebido no outono de 1994 por Rasmus Lerdorf. Ele a escreveu como um modo de rastrear os visitantes de seu CV online. A primeira verso foi realizada no incio de 1995, poca na qual Rasmus decidiu tornar seu projeto open-soruce, sendo assim, as pessoas corrigiriam seus bugs. A primeira verso era muito direta e tinha um parser simples que reconhecia algumas macros especiais e continha algumas utilidades que eram comumente usadas em hompages daquela poca. O parser foi reescrito em meados de 1995 e renomeado para PHP/FI version 2. O "FI" desta verso significava Form Interpreter, Rasmus ento adicionou ao PHP mais uma srie de funes que cobriam as necessidades das webpages daquela poca. PHP/FI ento comeou a ter um crescimento massivo, e outras pessoas comearam a contribuir com o cdigo regularmente. Em meados de 1997 Zeev Suraski e Andi Gutmans reescreveram o parser principal, e o PHP deixou de estar sob a tutela de Rasmus' para estar sob a orientao de um grupo. Com isto a formou-se base para o PHP3, agora chamado de PHP: Hypertext Preprocessor - um acrnimo recursivo. A ltima verso, o PHP4, outra reescrita feita por Suraski e Gutmans e baseada no mecanismo (tecnologia) Zend. O PHP agora tem mais de duzentos contribuintes regulares trabalhando em vrias partes do projeto. Tem uma quantidade gigantesca de extenses de terceiros, mdulos, suporte todos tipo de servidores populares nativamente, e tem suporte para MySql e ODBC embutido. A ltima estatstica mostra que o PHP agora usado por mais de 5,5 milhes de domnios, e tem tido uma taxa de uso crescente ano ps ano. Isto est longe de ser simplesmente o mdulo mais popular do Apache; Para se ter uma idia, o Apache atualmente est perto de 60% dos servidores de internet do mercado, enquanto que servidores IIS (que nativamente suportam ASP) esto presente em menos que a metade desta proporo. (Figuras obtidas em http://www.securityspace.com/ Maro 2001.) O que o PHP faz?

PHP uma linguagem para propsitos gerais. normalmente usada como linguagem de scripting embutida em html para se usar na web, mas tambm pode ser usada como linguagem de scripting shell ou mesmo como uma linguagem para escrever aplicaes "windowned", no formato PHP-GTK. Devido a natureza open-source do PHP, se h algo atualmente que voc no consegue fazer em PHP, no h nada que impessa voc de escrever um mdulo ou extenso em cdigo C para estender suas funcionalidades, sendo assim, voc pode fazer o que voc quiser com usando somente o PHP. Isto possvel atravs da documentao da API que muito bem feita e est disponvel para todos. O PHP4 tem duas partes principais: * O mecanismo (tecnologia) Zend parte do pacote PHP que mantm o registro de requisies, processa arquivos de scripting, e manipula variveis e recursos. Sua homepage pode ser acessada em http://www.zend.com/. * PHP implementa 90% das funcionalidades vistas pelo usurio final. Prov um extenso conjunto de mdulos tais como: MySQL, ODBC e suporte ao XML. O que GTK+? ndice A histria do GTK+ O que o GTK+ faz? A histria do GTK+ GTK+ foi originalmente desenvolvido para o GIMP, o GNU Image Manipulation Program. GTK+ faz parte do GIMP Tool Kit. GTK+ surgiu destes proprsitos iniciais e agora parte central do Gnome, e no projeto de ambiente para Desktop do GNU. GTK+ tambm tem sido portado para o BeOS e Win32, fazendo da linguagem a escolha perfeita para se usar como base para a extenso do PHP, mantendo o PHP multi-plataforma dentro do possvel e permitindo a criao de aplicaes "windowned" em PHP para Linux, BeOS e Windows. O que o GTK+ faz? GTK+ um conjunto de bibliotecas escritas em C para criar interfaces grficas. Tem uma arquitetura orientada a objetos desenvolvida em trs bibliotecas: * GLib prov vrias ferramentas para se usar quando se programa com GTK+. * GDK funes para construo de janelas em baixo nvel. * GTK prov um conjunto de widgets para se usar quando se cria uma GUI.

Agradecimentos A pessoa que Eu gostaria de agradecer muito James Henstridge, o autor do PyGTK (Python GTK+ Bindings). Os conselhos e ajuda dele foram de grande valia durante o desenvolvimento desta extenso, e uma grande quantidade do cdigo fonte baseada ou inspirada no cdigo que ele desenvolveu para o PyGTK. Eu tambm gostaria de agradecer Equipe do PHP por fazerem esta maravilhosa linguagem, e a Equipe do GTK+ por desenvolver o que tem sido a melhor ferramenta GUI baseada em C. Andrei Zmievski - Fev 2001 Comeando... Esta parte do manual explica o processo de instalao do PHP-GTK. ndice Obtendo a ltima Verso Instalando o PHP-GTK no Windows Instalando o PHP-GTK no Unix Como usar o PHP-GTK? Obtendo a ltima Verso O cdigo fonte e os binrios do PHP-GTK 1.0.0 para Windows podem ser encontrados em http://gtk.php.net/. Usurios do fonte precisaro tambm verificar a ltima verso do PHP usando o CVS - veja http://www.php.net/anoncvs.php. Instalando o PHP-GTK no Windows ndice Baixando o PHP-GTK Layout da Distribuio dos Binrios Como instalar Baixando o PHP-GTK Baixe os binrios do PHP-GTK 1.0.0 para win32 em http://gtk.php.net/. Voc talvez queira verificar se tem tem a ltima verso dos fontes do servidor CVS do php.net. Veja http://www.php.net/anoncvs.php para mais informaes. Layout da Distribuio dos Binrios A distribuio binria do PHP-GTK contm a seguinte estrutura: * \php4 arquivos binrios do PHP e do PHP-GTK 1.0.0 * \winnt o arquivo padro php.ini * \winnt\system32 binrios do GTK+ usados pela extenso * \test alguns exemplos demonstrando o uso do PHP-GTK

* README.TXT Como instalar 1. Se esta uma nova instalao voc deve criar um diretrio chamado C:\php4 e copiar os arquivos da pasta \php4 para este diretrio. Se voc j tem uma instalao do PHP (por exemplo, com Apache) ou pretende ter uma, voc ir precisar por seu arquivo php.ini l tambm. Os arquivos que esto nesta pasta pasta, por padro, so relacionados ao PHP ou PHP-GTK e iro todos precisar ser atualizads de tempos em tempos. Note que C:\php4 o diretrio padro e se voc instalar o PHP-GTK em outro lugar, voc precisar especificar o caminho completo na diretiva "extension_dir" na cpia do arquivo php.ini que ser usado pelo PHP. 2. Copie o contedo da pasta \winnt\system32 para o seu diretrio system32. No Windows NT e Windows 2000 o diretrio C:\winnt\system32. No Windows 95/98 ele pode ser C:\Windows\system ou C:\Windows\system32, escolha o seu. Este grupo de arquivos relacionado ao GTK e no estritamente necessria atualiz-los at que o PHP-GTK2 seja lanado. 3. Copie o contedo de \test para o local onde voc quer rodar seus scripts (ex: C:\php4\test). Instalando o PHP-GTK no Unix Usurios do Debian podem fazer download do binrio do PHP-GTK em http://www.debian.org/. O PHP-GTK depende do nmero de pacotes, que precisam ser instalados antes de comear a instalao do PHP-GTK: * PHP verso 4.3.4 ou maior * As bibliotecas GTK+, disponveis em http://www.gtk.org/download/, ou voc pode usar a verso que vem nos pacotes do seu sistema, ex: gtk e gtk-devel. * libtool, automake e autoconf. A combinao da libtool 1.4.2, do automake 1.4 e do autoconf 2.13 so as melhores para se trabalhar; isto pode variar dependendo das verses e combinaes que forem feitas. * Para opes extras, baixe as bibliotecas GtkHTML, as bibliotecas GtkScintilla e bibliotecas Gdk-Pixbuf. Novamente, voc pode pegar os pacotes disponveis para seu sistema, s tenha certeza de que voc instalou o pacote de desenvolvedor. A GtkHTML, tem um grande nmero de sub-depedncias, ex: GAL, que pode ser obtida em Gnome ftp site. Ns sugerimos que voc baixe a ltima verso do fonte em http://gtk.php.net/ ou partir do CVS (anonimamente) http://www.php.net/anoncvs.php. Rode o script ./buildconf que est dentro da distribuio. Ele ir configurar os arquivos necessrios e criar o script configure. Ele tambm ir verificar se voc tem uma verso correta do GTK+ 1.2.x (1.2.6 ou superior, disponvel em http://www.gtk.org/download/) e outros arquivos obrigatrios para a compilao, aps isto, ele criar

os arquivos Makefiles necessrios. O comando ./configure pode tambm ser usado para adicionar widgets adicionais, ex: ./configure --enable-scintilla --enable-gtkhtml. Para listar todas as opes disponveis use: ./configure --help. Lembre-se que cada widget adicional pode ter um nmero de depedncias necessrias que voc ir precisar para que o PHP-GTK compile com sucesso. Fincalmente, rode o comando make para compilar a extenso. Alguns arquivos fontes so gerados partir de arquivos .def pelo gerador de cdigo. Se voc ver mensagens como "Could not write...", isto significa que os objetos ou caracterstidas listadas no GTK+ no so suportados ainda. Se a compilao for bem sucedida, rode o comando make install para instalar a extenso em seu diretrio padro de extenses do PHP (geralmente /usr/local/lib/php/extensions). Soluo de problemas: problemas comuns com os comandos ./configure ou make * ./ltconfig: ltconfig : No such file or directory, configure: error: libtool configure failed ocorre quando no se tem um dos componentes da libtool, automake ou autoconf instalado. * ./aclocal.m4:813: error: m4_defn: undefined: _m4_divert_diversion ocorre quando h incompatibilidade de verses do autoconf, veja a recomendao das verses acima. * php_gtk+.c:33: parse error before `TSRMLS_DC' ocorre quando uma verso antiga do PHP encontrada pelo sistema de gerao ou quando se est tentando compilar o php-gtk com uma verso antiga do PHP - por favor atualize a sua verso do PHP para 4.3.4 para consertar este problema. * gen_gtk.c:1: parse error before '<' causada por um erro no gerador de cdigo. Geralmente este problema solucionado adicionando-se a linha ini_set("memory_limit", "32M"); na primeira linha do arquivo generator/generator.php. Voc ir precisar remover todos os arquivos gen_* de todos os diretrios aps fazer esta alterao. * checking for gnome-config... Unknown library `gtkhtml' (from ./configure) ocorre devido ao uso de um arquivo de cabealho antigo ou no disponvel - se voc instalou o PHP-GTK usando via rpm ou pacotes simalres do seu sistema voc precisar dos pacotes -devel. * Unable to find -lgal ou mensagens simalres esta, so causadas pela falta da biblioteca gal-devel ou alguma biblioteca simular esta. Geralmente ela uma sub-dependncia de alguns widgets mais complexos, como o gtkhtml. Para testar se a extenso foi instalada com sucesso, tente rodar um dos scripts de exemplo do diretrio test/ directory. Estes scripts tambm demonstram alguns modos nos quais o PHP-GTK e suas extenses podem ser usadas. Como usar o PHP-GTK? Aplicaes em PHP-GTK podem ser iniciadas partir da linha de comando

(ou um arquivo batch) usando esta sintaxe: C:\php4\php -q C:\caminho\para\o\script\php-gtk.php Elementos Bsicos Esta parte do manual fala sobre os elementos essnciais do PHP-GTK e mostra exemplos bsicos sobre seu uso. ndice Widgets e Containers Sinais e Callbacks Widgets e Containers ndice O que so Widgets? O que so Containers? O que so Widgets? widget qualquer interface com o usurio, e muito usado no mundo X. Um widget pode ser uma caixa de texto, rtulo, quadro, janela ou qualquer outro componente GUI. GTK widgets so todos derivados da classe GtkWidget, e herdam os mtodos, sinais e propriedades implementados nela. Do ponto de vista da programao um widget tem cinco partes durante seu ciclo de vida: 1. Criao No PHP-GTK isto feito criando um objeto, ex: $janela = &new GtkWindow(); 2. Colocao Nesta etapa o widget adicional um container. Isto feito no PHP-GTK usando a sintaxe $container->add($widget);. 3. Conexo com o Sinal Nesta etapa as funes de callback so configuradas. Um exemplo disto seria: $widget->connect("evento", "minha_func_focus"); , onde "evento" um estado pr-definido tal como "clicked" e "minha_func_focus" uma subrotina que chamada quando este "evento" ocorre. 4. Exposio Nesta etapa definidoo se o widget est visvel ou no para o usurio. Para mostrar o widget ao usurio usa-se: $widget->show(); e para escond-lo usa-se: $widget->hide();. 5. Destruio A destruio ocorre quando a funo gtk::main_quit() chamada. Todas as aes que so necessrias aqui so tratadas internamente. O que so Containers? Um container simplesmente um widget que capaz de conter outro

widget. A maioria dos wigets caem dentro desta classe; exemplos bvios disso so as classes GtkWindow, GtkTable e GtkBox. Exceto por esta propriedade eles so exatamente como qualquer outro widget, e podem ser adicionados outros containers, bem como filhos dos widgets do seu prprio tipo. Eles so derivados da classe base GtkContainer, que derivada da classe GtkWidget. Sinais e Callbacks ndice O que so Signals? O que so Callbacks? Herana dos sinais Conectando Sinais Usando Parmetros Personalizados Sinais e Eventos O que so Signals? Sinais so notificaes emitidas pelos widgets. Quando programando Graphical User Interfaces (GUI), freqentemente necessrio responder s aes realizadas pelo usurio ou iniciadas pelo programa. GNOME e GTK+ fazem isto atravs do uso de sinais. Sinais so usados para informar ao programa que alguma coisa aconteceu. Um sinal pode ser, por exemplo, um usurio clicando em um GtkButton, ou uma alterao sendo feito nos valores de GtkAdjustment. Um programa pode, por exemplo, fazer com que a clase GtkAdjustment emita seu sinal "value-changed" quando um dos wigets alterar um de seus valores. Este sinal em particular usado tanto internamente quanto externamente na classe GtkAdjustment, para que no seja sempre necessrio escrever este sinal em seu cdigo, digamos, para que a classe GtkProgressBar poder us-lo. Uma situao bem bvia pode ocorrer quando um usurio clica em uma instncia da classe GtkButton, causando a emio do sinal "clicked" pelo boto. Como programdor, voc pode configurar uma callbacks para reagir qualquer sinal emitido por um widget. O que so Callbacks? Callbacks so funes que so invocadas quando sinais so emitidos por um widgets. Callbacks so funes que so pr-definidas pelo programador para reagir sinais emitidos por widgets. Voc especifica a funo que deve ser chamada conectando-a ao sinal. Uma callback tambm conhecida como um mtodo do sinal da funo. Ela pode ser o evento padro dos widgets ou um evento definido pelo usurio, isto , uma funo escrita pelo programador. Herana dos sinais

O sinais so herdados dos objetos, bem como seus mtodos tambm. Um widget pode emitir qualquer um dos sinais que seu objeto (anterior) tenha definido, bem como seus prprios sinais especficos. Nos casos onde o sinal no relevante para o widget mas herdado por ele, no ser emitida nenhuma mensagem de erro quando o sinal chamado - mas igualmente, no haver nenhuma necessidade do widget emitir este sinal em particular. Conectando Sinais Conexes Simples Para reagir um sinal voc deve conect-lo especificando a funo de callback que o PHP-GTK ter de chamar quando este sinal for emitido. Conectar uma funo ao sinal feito chamando-se o mtodo connect() do objeto. A funo que voc registra como sendo callback para o sinal deve ter o prottipo (prototype) correto. Para saber qual prototype voc de usar veja ele na seo de reference do manual. Por exemplo, se voc quiser conectar o sinal "clicked" voc deve definir uma funo que aceita um parmetro, que ser o boto que foi clicado. O cdigo abaixo mostra como voc deve criar uma janela, adicionar um boto ela, esperar que ele seja clicado, e ento, quando o boto for clicado, abrir uma GtkWindow contendo uma mensagem. Exemplo 2.1. Sinais e Callbacks <?php dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')) || die("No foi possvel carregar o mdulo!\n"); function desligar() { print("Desligando...\n"); gtk::main_quit(); } function voce_clicou($botao) { $janela = &new GtkWindow(); $rotulo = &new GtkLabel("Voc clicou no boto"); $janela->add($rotulo); $janela->connect("destroy","desligar"); $janela->show_all(); return false; } $janela = &new GtkWindow(); $janela->connect("destroy", "desligar");

$janela->set_border_width(10); $botao = &new GtkButton("Clique Me!!"); $botao->connect("clicked", "voce_clicou"); $janela->add($botao); $janela->show_all(); gtk::main(); ?> A parte importante aqui onde ns chamamos $botao->connect();. O mtodo "connect" aqui registrado funo de callback voce_clicou() que ir ser invocada quando o sinal "clicked" emitido pelo widget GtkButton. Ns tambm registramos a funo desligar() como sendo um evento para o sinal "destroy" para ambas as janelas para que assim ns possamos finalizar o programa corretamente. Mltpiplas Conexes Com o PHP-GTK voc pode registrar mais de uma funo para ser chamada quando um sinal emitido por um widget. Ito permite voc configurar uma srie de funes para serem chamadas em respsta uma ao experada. Quando mais de uma funo conectada um sinal, as funes so chamadas na ordem em que foram registradas quando aquele sinal emitido. Exemplo 2.2. Ordem do Sinal da Callback <?php dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')) || die("No foi possvel carregar o mdulo!\n"); function primeira($botao) { print "Primeira funo foi chamada.\n"; } function segunda($botao) { print "Segunda funo foi chamada.\n"; } $janela = &new GtkWindow(); $janela->connect_object("destroy", array("gtk", "main_quit")); $botao = &new GtkButton("Clique Me!!"); $botao->connect("clicked","primeira"); $botao->connect("clicked","segunda"); $janela->add($botao);

$janela->show_all(); gtk::main(); ?> No exemplo acima ns conectamos duas funes para o sinal "clicked" de um boto. primeira chamada ao mtodo connect() conecta o sinal "clicked" funo primeira(), a segunda chamada ao sinal "clicked" conecta-se funo segunda(). A sada para este programa seria: Primeira funo foi chamada. Segunda funo foi chamada. Usando Parmetros Personalizados Passando dados personalizadso como parmetro Quando se est conectando sinais, possvel adicionar um parmetro personalizado adicional para callback. Isto til quando se quer passar um objeto que voc quer usar para executar uma ao, para a sua funo de callback. Por eemplo, quando um boto pressionado ns podemos destruir a instncia pai da GtkWindow qual uma instncia de GtkButton pode adicionada. Voc pode fazer isto incluindo um terceiro parmetro adicional chamada do mtodo connect() . Este terceiro parmetro ser passado para o seu manipulador de sinal de sua funo como sendo o ltimo parmetro da callback. Exemplo 2.3. Usando parmetros personalizados com o mtodo connect() . <?php dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')) || die("No foi possvel carregar o mdulo!\n"); function botao_clicado($botao, $janela) { $janela->destroy(); gtk::main_quit(); } $janela = &new GtkWindow(); $botao = &new GtkButton("sair"); $botao->connect("clicked","botao_clicado", $janela); $janela->add($botao); $janela->show_all(); gtk::main();

?> No cdigo acima voc pode ver que ns passamos no somente a varivel $botao, uma instncia da classe GtkButton, para o sinal "clicked" mas tambm passamos a varivel $janela, uma instncia da classe GtkWindow. Isto permite ns chamar o mtodo da janela destroy() . Voc pode ter quantos parmetros personalizados desejar. Ao passar a varivel $botao como parmetro objeto da chamada e a varivel $janela como sendo nosso parmetro personalizado, ns podemos usar a mesma callback para mais de um GtkButton em mais de uma GtkWindow. Note que os nomes dados aos parmetros junto com a callback so irrelevantes fora da funo de callback; o PHP-GTk escolhe as posies dos parmetros nas chamadas ao mtodo connect* e passa estas variveis listadas na declarao da callback como sendo arrays, para que qualquer instncia da conexo usando a mesmo estrutura de parmetro possam usar a mesma callback. Isto demonstrado no cdigo abaixo usando um nico parmetro personalizado, mas igualmente vlido para mais de um. Exemplo 2.4. Usando a mesma callback para mais de uma janela <?php dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')) || die("No foi possvel carregar o mdulo!\n"); function botao_clicado($botao, $janela) { $janela->set_title("entitulada"); } $janela1 = &new GtkWindow(); $janela1->connect_object("destroy", array("gtk", "main_quit")); $janela2 = &new GtkWindow(); $janela2->connect_object("destroy", array("gtk", "main_quit")); $botao1 = &new GtkButton("clique em mim"); $botao2 = &new GtkButton("ou em mim"); $botao1->connect("clicked", "botao_clicado", $janela1); $botao2->connect("clicked", "botao_clicado", $janela2); $janela1->add($botao1); $janela2->add($botao2); $janela1->show_all(); $janela2->show_all(); gtk::main(); ?> Usando o mtodo connect_object*

Ambos connect_object() e connect_object_after() permitem voc passar um objeto diferente do objeto que est sendo chamado como primeiro parmetro da sua funo callback. Isto muito usado para chamar funes estticas do PHP-GTK, como (por exemplo) a funo gtk::main_quit() : Exemplo 2.5. Usando o mtodo connect_object() para especificiar uma funo embitida como sendo uma funo de callback. <?php dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')) || die("No foi possvel carregar o mdulo!\n"); $janela = &new GtkWindow(); $janela->connect_object("destroy", array("gtk", "main_quit")); $janela->show(); gtk::main(); ?> Isto tambm poderia ser feito chamando qualquer funo esttica ou mtodo usando a sintaxe de expresso (array) gtkobject::method. Isto tambm significa que voc pode ter uma callback para mltiplos sinais. Por exemplo; voc pode criar uma janela contendo (desde que contenha os widgets e containers necessrios) um GtkMenuBar, uma GtkToolbar e um GtkButton. Quando Sair escolhido pelo usurio dentre um desses widgets, uma funo de "desligamento" pode ser invocada passando uma instncia de GtkWindow como primeiro parmetro, permitindo que a janela possa ser destruda de qualquer uma das conexes. A funo de callback e as conexes nesta instncia podem ser parecidas com esta: Exemplo 2.6. Usando o mtodo connect_object() para passar outro objeto como primeiro parmetro. <?php dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')) || die("No foi possvel carregar o mdulo!\n"); function destruir_janela($janela) { $janela->destroy(); gtk::main_quit(); } $janela = &new GtkWindow(); $botao_sair = &new GtkButton("Sair"); $botao_sair->connect_object("clicked", "destruir_janela", $janela); $janela->add($botao_sair); $janela->show_all(); gtk::main(); ?>

O mtodo connect_after* permite que os callbacks "rodem aps" o evento do sinal padro. Isto pode ser muito til em algumas situaes; por exemplo, onde voc quer destriuir somente uma das muitas janelas em uma dada circunstncia. Entretanto, o mtodo connect_after* somente iro funcionar quando o sinal for criado no cdigo fonte GTK usando a flag GTK_RUN_LAST. O sinal "destroy" e todos os sinais 'evento' tem esta flag; alm dela o nico jeito de fazer esta verificao testar o sinal usando o PHP-GTK ou lendo o cdigo fonte do GTK. Exemplo 2.7. Usando o mtodo connect_after() . <?php dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')) || die("No foi possvel carregar o mdulo!\n"); function rotina_sair($janela) { print("Desligando...\n"); gtk::main_quit(); } $janela1 = &new GtkWindow(); $janela1->set_title("Sair do loop principal"); $janela1->connect("destroy", "rotina_sair"); $janela2 = &new GtkWindow(); $janela2->set_title("Destruir esta janela"); $janela2->connect_after("destroy", "rotina_sair"); $janela1->show(); $janela2->show(); gtk::main(); ?> Veja tambm: GtkObject, connect_after() connect_object() e connect_object_after() . Sinais e Eventos Sinais GTK, Eventos GDK. Sinais no so eventos, e eventos no so sinais. Um sinal uma mensagem emitida pela instncia de um GtkObject em resposta algum elemento pr-determinado em seu ambiente (programa), ex: uma ao feita pelo usurio final, ou uma instruo de um mtodo ou funo. Sinais so sempre programados no cdigo, internamente dentro do GTK ou externamento pelo programador PHP-GTK. Eventos, por outro lado, so um circuito continuo dos impulsos que enviam mensagens a respeito das mudanas no ambiente (programa) nos sistemas de janelas. O loop principal do GTK feito atravs deste circuito de evnetos, e uma srie de outras coisas.

no possvel conectar uma funo de callback um GdkEvent diretamente. Qualquer widget que tenha sua prpria GdkWindow pode capturar eventos que so relevantes ela. Widgets falham na GdkWindow - aquelas criados com a flag GTK_NO_WINDOW - no podem fazer isso, no ser que eles tenham um GtkEventBox - um widget criado para este propsito especfico. H ocasies quando til poder capturar eventos; um exemplo bvio seria a criao de um GtkToolTips que provocado quando o widget captura o evento GDK_ENTER_NOTIFY e destrudo quando o mesmo widget captura o evento GDK_LEAVE_NOTIFY. Entretanto no possvel usar um evento para chamar uma callback do mesmo modo como feito com o sinal, h uma srie de sinais derivados da classe GtkWidget conhecidos como sinais 'evento'. Estas so maneiras eficientes de descriar um evento em termos de sinal, permitindo que callbacks sejam provocados diretamente atravs da captura de ocorrncias da maioria dos GdkEventTypes. O objeto GtkTooltips usa o mtodo connect_object e o sinal genrico (evento) a fim de monitorar o widget. O conceito de eventos no muito fcil. Por favor copie, cole e rode o script a seguir a fim de ter uma idia do que so eventos em um wiget quando esto em ao. Exemplo 2.8. Demonstrao do fluxo de eventos usando a classe GtkButton <?php dl("php_gtk." . (strstr(PHP_OS, "WIN") ? "dll" : "so")) || die("No foi possvel carregar o mdulo!\n"); function mostrar_tipo_de_evento($botao, $evento, $texto) { $tipo_de_evento = $evento->type; $texto_a_inserir = $texto->get_length(); $texto->freeze(); switch($tipo_de_evento) { case 2: $texto->insert_text("GDK_EXPOSE\n", $texto_a_inserir); break; case 3: $texto->insert_text("GDK_MOTION_NOTIFY\n", $texto_a_inserir); break; case 4: $texto->insert_text("GDK_BUTTON_PRESS\n", $texto_a_inserir); break; case 5: $texto->insert_text("GDK_2BUTTON_PRESS\n", $texto_a_inserir); $botao->hide(); break; case 7: $texto->insert_text("GDK_BUTTON_RELEASE\n", $texto_a_inserir); break;

case 8: $texto->insert_text("GDK_KEY_PRESS\n", $texto_a_inserir); break; case 9: $texto->insert_text("GDK_KEY_RELEASE\n", $texto_a_inserir); break; case 10: $texto->insert_text("GDK_ENTER_NOTIFY\n", $texto_a_inserir); break; case 11: $texto->insert_text("GDK_LEAVE_NOTIFY\n", $texto_a_inserir); break; case 12: $texto->insert_text("GDK_FOCUS_CHANGE\n", $texto_a_inserir); break; case 14: $texto->insert_text("GDK_MAP\n", $texto_a_inserir); break; case 15: $texto->insert_text("GDK_UNMAP\n", $texto_a_inserir); $botao->destroy(); $amarelo = &new GdkColor("#FFFFFF"); $preto = &new GdkColor("#000000"); $texto->insert(NULL, $amarelo, $preto, " \n* EVENTOS DO GDK E SINAIS DO GTK - stream de fundo vs mensagens de primeiro p lano * \n * A maioria dos GdkEventTypes fazem parte dos sinais do GTK, conhecidos como si nais do 'evento', implementados na GtkWidget. Os tipos que aparecem na tela est o l porque o GtkButton foi programado para emitir o sinal genrico 'evento' c ada vez que ele capturar um dos eventos stream do GDK que so feitos no loop pr incipal do GTK. Em qualquer um dos casos, o GdkEvent foi passado como sendo um parmetro de callback sendo assim que ele pode ser ter os valores dos seus tipo s numerado para que a funo possa trat-los. Veja acima uma srie de valores d e eventos que foram capturados durante sua recente interao com o widget GtkBu tton. * \n * Por favor, note que a maioria dos sinais do GTK NO correspondem aos eventos GDK nem aqui nem em nenhuma outra maneira! Por exemplo, o sinal de conexo \$bo tao->connect('pressed', 'qualquer_coisa'); no tem relao com o evento GDK_BUT TON_PRESS que gerado, que no caso, refere-se ao boto do mouse ativiado e no ao sinal 'pressed' do GtkButton. * \n "); break; } $texto->thaw(); return false; } $janela = &new GtkWindow(); $janela->set_position(GTK_WIN_POS_CENTER); $janela->set_default_size((gdk::screen_width()/1.5), (gdk::screen_height()-20))

; $janela->connect_object("destroy", array("gtk", "main_quit")); $janela->realize(); $caixa = &new GtkVBox(false, 5); $janela->add($caixa); $scrljan = &new GtkScrolledWindow(); $caixa->pack_start($scrljan, true, true, 0); $texto = &new GtkText(); $scrljan->add($texto); $botao = &new GtkButton("Clique aqui duas vezes para obter informaes.."); $botao->add_events(GDK_ALL_EVENTS_MASK); $botao->connect("event", "mostrar_tipo_de_evento", $texto); $caixa->pack_end($botao, false, false, 5); $janela->show_all(); gtk::main(); ?> Tutoriais sobre PHP-GTK _________________________________________________________________ ndice Tutorial do Ol Mundo Pixmaps Translation of PHP-Gtk applications Drag'n'drop with files Tutorial do Ol Mundo Quando voc est comeando aprender uma linguage de programao, o primeiro programa que voc escreve o famoso 'ol mundo'. Ento, apenas para no sermos do contra, o primeiro tutorial neste manual ser um tutorial do 'ol mundo'! Durante todos os tutorials ns esperamos que voc sinta-se como se estive-se programando em PHP. Os tutoriais so projetados para dar ao usurio uma idia de como usar o PHP-GTK, e as idias e tcnicas por trs dele. Neste tutorial voc ir criar uma simples janela com o texto "Ol Mundo!" dentro dela. Ns comearemos mostrando o programa e depois iremos explicar cada linha do programa, dando uma idia geral sobre uma aplicao bem bsica em PHP-GTK. Exemplo 1.1. Cdigo do programa Ol Mundo em PHP-GTK <?php

if (!class_exists('gtk')) { if (strtoupper(substr(PHP_OS, 0,3) == 'WIN')) dl('php_gtk.dll'); else dl('php_gtk.so'); } function deletar_evento() { return false; } function desligar() { print("Desligando...\n"); gtk::main_quit(); } function ola() { global $janela; print "Ol Mundo"; $janela->destroy(); } $janela = &new GtkWindow(); $janela->connect('destroy', 'desligar'); $janela->connect('delete-event', 'deletar_evento'); $janela->set_border_width(10); $botao = &new GtkButton('Ol Mundo!'); $botao->connect('clicked', 'hello'); $janela->add($botao); $janela->show_all(); gtk::main(); ?> Exemplo 1.2. Carregando o PHP-GTK <?php if (!class_exists('gtk')) { if (strtoupper(substr(PHP_OS, 0,3) == 'WIN')) dl('php_gtk.dll'); else dl('php_gtk.so'); } ?> Estas primeiras linhas fazem a checagem para ver se a extenso do PHP-GTK j est disponvel para uso, caso no ela carregada. Isto

feito usando os comandos dl('php_gtk.dll'); ou dl('php_gtk.so'); no Windows e Linux respectivamente. Exemplo 1.3. A funo deletar_evento() <?php function deletar_evento() { return false; } ?> A funo deletar_evento() registrada como sendo um evento (veja abaixo) do sinal "delete-event". Ela retorna false, dizendo ao PHP-GTK para disparar o alimentador para os eventos padres de sinais, o que nesse caso o mtodo destroy() . Se a funo retornar true, o PHP-GTK pararia o alimentador padro para os eventos de sinais que estive-se rodando no momento. bom saber isto se voc precisa escrever uma funo definida pelo usurio para substituir a funo destroy() - por exemplo, para produzir uma caixa de dilogo de confirmao onde o usurio pretende fechar um aplicativo. No estritamente necessrio que o retorno seja false para conectar o sinal "delete-event" ao mtodo destroy() . possvel no especificar nenhum comportamento para os sinais "delete-event" de todas as janelas, desde que o evento de sinal do "destroy" seja tratado corretamente, como est sendo feito aqui. Exemplo 1.4. A funo desligar() <?php function desligar() { print("Desligando...\n"); gtk::main_quit(); } ?> A funo desligar() registrada como sendo um evento para o sinal "destroy". A funo imprime o texto "Desligando...\n" para o console e depois chama a funo esttica gtk::main_quit() . Exemplo 1.5. A funo ola() <?php function ola() { global $janela; print "Ol Mundo!\n"; $janela->destroy(); }

?> A funo ola() registrada como sendo um evento para o sinal "clicked" do boto. Ela torna global a varivel $janela sendo assim ela pode ser acessada como sendo uma instncia da classe GtkWindow criada mais abaixo no script. Ela ento imprime o texto "Ol Mundo!" para o console antes de chamar o mtodo destroy() da janela, o qual dispara o sinal "destroy", que depois chama a funo shutdown(). Uma outra maneira da funo ola() acessar a varivel $janela se a varivel fosse passada como um parmetro personalizado. Exemplo 1.6. Configurando a Janela <?php $janela = &new GtkWindow(); $janela->connect('destroy', 'desligar'); $janela->connect('delete-event', 'deletar_evento'); $janela->set_border_width(10); ?> As quatro linhas seguintes configuram a janela. Primeiramente nso criamos uma instnica da classe GtkWindow. Uma vez criada com sucesso, ns chamamos o mtodo connect() da janela para que possamos registrar a funo desligar() como sendo um evento do sinal "destroy" e a a funo deletar_evento() como sendo um evento do sinal "delete-event". Finalmente, ns chamamos o mtodo set_border_width() para configurar a janela com uma bordar de 10-pixels na instncia da classe GtkWindow que ns havamos criamos. Exemplo 1.7. Configurando o Boto <?php $botao = &new GtkButton('Ol Mundo!'); $botao->connect('clicked', 'ola'); $janela->add($botao); $janela->show_all(); ?> Estas trs linhas criam e configuram um boto. A primeira linha do cdigo acima faz com que criemos uma instncia da classe GtkButton. O argumento passado para o construtor o texto que queremos mostrar na tela - no caso "Ol Mundo!". Ns ento chamamos o mtodo connect() para registrar a funo ola() que definimos anteriormente, como sendo um evento do sinal "clicked". Finalmente ns adicionamos o boto para a janela que ns criamos anteriormente chamando o mtodo add() da classe GtkContainer que est em $janela, e depois mostramos tudo que est em $janela chamando o mtodo show_all() , que tambm uma instncia de nossa classe GtkWindow. Exemplo 1.8. A chamada ao gtk::main

<?php gtk::main(); ?> A ltima linha do script chama a funo esttica gtk::main. Isto diz ao PHP-GTK que ns finalizamos nossa interface, e que o loop principal pode ser iniciado para que os eventos disparados pelo usurio interajam com as nossas funes callback (ola(), desligar(), etc.) que definimos no script, e tambm com que vrias aes sejam realizadas. Pixmaps ndice How To Use Pixmaps in PHP-GTK About XPM Image related php-gtk functions Examples Other things you can do with pixmaps How To Use Pixmaps in PHP-GTK Many applications are using graphical images: A nice splash screen indicating that the program is loading; the toolbar with new, open and other well-known icons or the nifty about dialog. This HowTo describes what you need to use images in your own php-gtk applications. About XPM The standard way to deal with images and mainly icons in php-gtk is using XPMs. XPM is short for XPixMap and describes an ASCII image format as well as a C library for dealing with the images. Originally the format was developed because the X libraries just had support for 1 bit depth images, the XBM (X BitMap) which is just not enough for applications on a graphical system. Although it is has not been standardized by the X Consortium, it is the de facto standard for icons in X. In this tutorial we will omit the library because we're programming in php and not in C. The XPM format was designed to fit the special need for icons: * Icons are usually small * Icons may need to be drawn differently depending on whether they are being displayed on color or monochrome screen * Icons may want to define symbolic colors, such as "Foreground" and "Background", that can be changed depending on the context in which the icons are used. * Icons can be of any shape, not just rectangular. The XPM image format An icon in XPM format is just an ASCII file which can be edited with a normal text editor. As it was designed to be included in C sources,

the only content is a C styled array with the image information. You can even have comments in the file - it's C source. The basic format of a XPM is an array composed as follows: /* XPM */ static char * <pixmap name>[] = { "Values-string", "Colors-strings", "Pixel-strings" }; Note that the header comment with only the word XPM in it is required. I leave out the Extension strings as we don't need them here. The Values-string has to contain four integer values: 1. Width of the image in pixels 2. Height of the image in pixels 3. Number of colors in the image 4. Number of characters per pixel Example: "16 16 8 1" defines an icon of size 16x16 pixels with 8 colors and 1 char for defining one pixel. First it may be strange that one has to define the number of characters per pixel, but this becomes clear if you consider the following: Each pixel is represented by a char, e.g. "b", with "b" having the color blue. Now you want another pixel in red, so you give it the char "r" and define "r" being the red color. The ASCII standard defines 128 chars, and with an extended codepage of 255 you would still be limited to somewhat of 250 colors (you can't use quotes and some other chars). To avoid this limitation you can use more than one char to describe a pixel and a color: If you use 2 chars per pixel it is possible to use about 250x250 = 62500 colors by defining pairs of chars to be one color, e.g. "mr" being a medium red and 'db' being a dark blue. The Colors-strings contains as many strings as there are colors. Each string has the following format: "chars key value [key value]*" The chars value is one or more chars (depending on the number of characters setting) which define the "pixel name" of the color. A key can have one of the following values: * m for a monochrome visual * c for a color visual * g4 for 4-level grayscale * g for grayscale with more than 4 levels * s for a symbolic name The color value itself can be the following: * A color name, e.g. "blue" * A hexadecimal RGB code like in HTML, e.h. '#FF8000' * The string "None" which means the transparent color

Different key-value pairs can be concatenated to optimize the image for several visuals "r m white c red", "b m black c blue" The example would define two colors: A color named "r" which is displayed white on a monochrome display and red on a color display. The second is named "b" and is displayed black on a monochrome visual and blue on a color one. The Pixel-strings are height string of which each is width * chars per pixel wide. Exemplo 2.1. A small sample XPM /* XPM */ static char * dot[] = { "5 5 2 1", ". c None", "X c Red", " X ", " XXX ", "XXXXX", " XXX ", " X ", }; As you probably don't want to create these images by hand, here is a list of programs which support the creation of XPMs: * The GIMP which should be on every linux system; it is also available for Windows. * ImageMagick is a command line tool which can be used to batch-convert other image formats to xpm. Available for unix and Windows. Image related php-gtk functions Images are displayed using the GtkPixmap widget which has to be invoked with two parameters; a map of type GdkPixmap and a mask of type GdkBitmap. The map defines all the pixels with its colors, and as the map is not able to contain transparent color information, the mask is a map of 1's and 0's telling which pixel is transparent and which not. There are two functions dedicated to reading of XPM images: * gdk::pixmap_create_from_xpm which creates a pixmap and a mask directly from a file. * gdk::pixmap_create_from_xpm_d which creates the pixmap and mask from an array. As both functions are identical in usage, I will describe pixmap_create_from_xpm_d only. list( $pixmap, $mask) = gdk::pixmap_create_from_xpm_d( $objWindow->window, $col Transparent, $arImage);

The function returns an array of size 2: the first is the map with all the pixels and colors, and the second is the mask with transparency information. We store them in two different variables here, although you can just use an array. The first parameter, $objWindow->window is the GdkWindow of your application's window. Please make sure that the GdkWindow exists by showing the GtkWindow or by calling the realize() function. The second parameter, $colTransparent defines which color the transparent color (color None) will get if the pixmask is not used when creating e.g. the GtkPixmap. The third parameter is the name of the image file (pixmap_create_from_xpm), or a normal php array with the structure as described in the XPM standard (pixmap_create_from_xpm_d). Examples The following example shows how to create a pixmap from an array, creating a button and attaching the pixmap along with the label to the button. It also uses the enter and leave signals to change the pixmap when the button is hovered by the mouse. The icon of the window is set, too - but this won't work on Windows. Exemplo 2.2. Pixmap button & highlighting example <?php if (!extension_loaded('gtk')) { dl('php_gtk.' . PHP_SHLIB_SUFFIX); } $arXPMs['ok'] = array( "32 32 7 1", " c None", ". c #005F00", "+ c #008A00", "@ c #00BB00", "# c #00E000", "$ c #00F709", "% c #4BE24A", " ", " ", " ", " ", " @@", " +@++", "+@ +@+@+ ", "+++ @+@++. ", "+@++ ++@%++. ", " +%++ +++%%@+ ", " +%@++ +++%%%++ ", " +@##++ +++%$$%++ ", " +$$%++ +++@$$$$++ ", " +#$$@+. +++@$$$$%++ ", " +@$$$#+.+.+@$$$$$#+. ", " .+$$$$@+.@#$$$$$@+. ", " +##$$$####$$$$++. ", " .@$#####$$###@.. ",

" .+##########+.. ", " .#########+.. ", " .@##@#@#@.. ", " .+@##@#@+. ", " ..#@@#@.. ", " .@@@@.. ", " .+@+.. ", " .++.. ", " ... ", " .. ", " ", " ", " ", "" ); $arXPMs['inbox'] = array( "16 16 6 1", " c None" , ". c #028800", "+ c #995700", "@ c #82E61D", "# c #FFBE58", "$ c #FCEF8E", " ", " .... ", " .$$$$. ", " .@@@@. ", " .@@@@. ", " ..@@@@.. ", " .@@@@@@@@. ", " .@@@@@@. ", " .@.@@. ", " ..@. ", "+++ .. +++", "+$$+ +$$+", "+$$++++++++++$$+", "+$#$$$$$$$$$$$#+", "+$#############+", "++++++++++++++++" ); $window =& new GtkWindow(); $window->set_title('pixmaps'); $window->set_default_size(200, 100); $window->connect_object('destroy', array('gtk', 'main_quit')); $window->realize(); $clTransparentTest =& new GdkColor('#000000'); $arPxTest = gdk::pixmap_create_from_xpm_d($window->window, $clTransparentTest, $arXPMs['ok']); $btnTest =& new GtkButton(); $pxmTest =& new GtkPixmap($arPxTest[0], $arPxTest[1]); $lblTest =& new GtkLabel('Button with icon'); $hboxTest =& new GtkHBox(); $hboxTest->pack_start($pxmTest);

$hboxTest->pack_end($lblTest); $btnTest->add($hboxTest); // hovering the button changes the image // to a highlighted version of itself function changePixmap( $btnTest, $strAction, &$pixmap) { $hbox = $btnTest->child; $arChildren = $hbox->children(); $hbox->remove($arChildren[0]); $hbox->pack_start($pixmap); $pixmap->show(); // underline the label $lblTest = $arChildren[1]; $strPattern = ''; if ($strAction == 'enter') { $strPattern = '________________'; } $lblTest->set_pattern($strPattern); } // generate a highlighted picture from the original $arXPMs['high'] = $arXPMs['ok']; $arData = explode(' ', $arXPMs['high'][0]); $nColors = $arData[2]; // change all colors | we know the first color is transparent for ($nA = 2; $nA < $nColors + 1; $nA++) { $arData = explode(' #', $arXPMs['high'][$nA]); // the following code is taken from PEAR::Image_Color $degree = 40; $color[] = hexdec(substr($arData[1], 0, 2)); $color[] = hexdec(substr($arData[1], 2, 2)); $color[] = hexdec(substr($arData[1], 4, 2)); for ($x = 0; $x < 3; $x++) { if (($color[$x] + $degree) < 256) { if (($color1[$x] + $degree) > -1) { $color[$x] += $degree; } else { $color[$x] = 0; } } else { $color[$x] = 255; } } $arData[1] = sprintf('%02X%02X%02X', $color[0], $color[1], $color[2]); $arXPMs['high'][$nA] = implode(' #', $arData); } $arPxTestH = gdk::pixmap_create_from_xpm_d($window->window, null, $arXPMs['high ']); $pxmTestHigh =& new GtkPixmap($arPxTestH[0], $arPxTestH[1]);

$btnTest->connect('enter', 'changePixmap', 'enter', $pxmTestHigh); $btnTest->connect('leave', 'changePixmap', 'leave', $pxmTest); $alBtn =& new GtkAlignment(0.5, 0.5, 0, 0); $alBtn->add($btnTest); list($pxWindow, $maskWindow) = gdk::pixmap_create_from_xpm_d($window->window, n ull, $arXPMs['inbox']); $gdkwindow = $window->window; $gdkwindow->set_icon($gdkwindow, $pxWindow, $maskWindow); $window->add($alBtn); $window->show_all(); gtk::main(); ?> Other things you can do with pixmaps Shaping widgets Another nice thing you can do with a pixmap or better a pixmask is defining your own shape for widgets or whole windows. This means you can have can have a button with rounded corners or a window with "holes" in it by using the shape_combine_mask method of GtkWidget. Symbolic names The XPM specification allows the use of symbolic color names in the xpm. For example, if your pixmap should display a symbol of a button, the button could have the real button colors: light shadow, dark shadow and the normal flat surface color. The only thing you would have to do is writing something like this: /* XPM */ static char * button[] = { "16 16 3 1", ". s foreground", "X s lightshadow", "X s darkshadow", "...pixels here" }; Unfortunately, the Gtk, unlike CDE, does not support symbolic color names. So you cannot use them unless you define your own names and write a function which replaces the symbolic names by real colors. Other graphics formats Pixmaps are nice, but what if you want to display a jpg or png image? As the gtk libraries don't support this, you could use the gd or gd2 to transform the image to xpm format and go on with the normal xpm functions.

Translation of PHP-Gtk applications ndice What it's all about Gettext Using gettext in PHP Translating glade files Some additional notes What it's all about You want to distribute your PHP-Gtk application on your webpage and make it reach a large number of people. The only problem between your application and all the people is not the functionality; your app is perfect in this way: It is the language. Even if some people don't or don't want to realize: There are lots of people out there which would use your program but don't speak your language or the language in which your program is. It would be nonsense to ignore them. The solution is easy: Translate the program. Just find a person who speaks the target language and who is willing to translate all the things your program contains. But the next step: How do you - technically - translate your program?. There are many ideas how to do this: * Take the program sources (and glade files), make a copy and translate them. This is the worst method: If you want to extend your program you will have to change every single file of the 20 translated versions. Even worse: The translator does not have to be a programmer, and requiring him to change the sources can cause serious problems with the code: Does the translator know how to deal with escape sequences? What if the translator accidently removes a end-quote? The program just won't run, and you will have a nice time searching bugs in all the translated versions. * Using a big array which contains all the texts. Put it in a translation file for each language, and include the right one when the program starts. This has the advantage that translation and code are segregated strictly, and the translator will have an easy job. Just what if you are using glade files for your GUI definitions? You would have to make a copy of each glade file and translate it; causing the same problems as the first option. Or you load every single widget and change the text of it. This would require a function in your application which knew every single widget and the string in the big translation array it should apply. * Using the text as normal in the sources, but having it and the glade files translated automatically. Impossible? No, the gettext extension of php makes this scenario real. This tutorial shows how to translate your apps the most easy way using the gettext extension of php. It covers normal string translation as well as the translation of glade files and shows a solution if the

gettext extension is not available on the user's system. Exemplo 3.1. The first and worst translation method //file: cart.en.php //... echo '<title>Shopping cart</title>'; //... echo 'Copying file ' . $strFile1 . ' to ' . $strFile2; //... //file: cart.de.php //... echo '<title>Einkaufswagen</title>'; //... echo 'Kopiere Datei ' . $strFile1 . ' nach ' . $strFile2; //... Exemplo 3.2. The second method //file: translationl.en.inc $arTranslation = array( 'title' => 'Shopping cart', 'copy_1' => 'Copying file ', 'copy_2' => ' to ' ); //file: translationl.de.inc $arTranslation = array( 'title' => 'Einkaufswagen', 'copy_1' => 'Kopiere Datei ', 'copy_2' => ' nach ' ); //file: cart.php include_once( 'translation.en.inc'); //... echo '<title>' . $arTranslation['title'] . '</title>'; //... echo $arTranslation['copy_1'] . $strFile1 . $arTranslation['copy_2'] . $strFile 2; //... Exemplo 3.3. Using gettext //file: cart.php //... echo '<title>' . _('Shopping cart') . '</title>'; //... echo sprintf( _('Copying file %s to %s'), $strFile1, $strFile2); //... Gettext Gettext is a set of tools, guidelines, directory naming conventions and a runtime library. Together, they are the standard way to translate applications in the *nix environment. Don't be scared, you

can use it on Windows as well. I don't want to describe the whole system here, just the things you need to translate your application you can read the manual if you want more information. The gettext system translates replaces whole strings with the translated equivalent in the target language. This means that you don't have to invent array keys but can keep the original string in the code, which makes it a lot more readable. The translations are written down in so-called .po-files, where "po" stands for "portable object". They contain the human-readable and human-editable translation of the strings to the target language. To speed up the live-translation process when the application is running, they are compiled to .mo-files, "machine object" files. These files are required to be in a certain directory structure: locale -languageLC_MESSAGES -applicationname-.po -applicationname-.mo de LC_MESSAGES appwizard.po appwizard.mo tuxracer.mo es LC_MESSAGES appwizard.mo tuxracer.mo Here you see, that there are 2 languages: german (de) and spanish (es). They contain both the machine object files for the applications AppWizard and TuxRacer. The original translation files are not required for running the program, and so only the german translation file for AppWizard is here. If you are on *nix, have a look at /usr/share/locale/. You will find the translations for many programs there. A .mo translation file looks the following way: # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Free Software Foundation, Inc. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2002-04-06 21:44-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: gettext_example.php:12

msgid "A string to be translated would go here" msgstr "Ein string der bersetzt werden soll steht hier" msgid "Really quit?" msgstr "Wirklich beenden?" msgid "This is a glade language test script" msgstr "Dies ist ein Glade Sprach-test script" The first 15 lines are a sort of header, which can be customized with dates and authors. After the header the translation begins: msgid tells what shall be translated, and msgstr is the translation. Special chars in strings can be escaped as usually with a backslash \. After translating your strings, you have to compiles the .po to .mo files which is done by using the msgfmt tool. On *nix, you should have it somewhere; on Windows you can get it with mingw32. Go to the LC_MESSAGES directory and just call the compiler: # msgfmt messages.po which will result in a messages.mo file. Using gettext in PHP Our sample application is the following: Exemplo 3.4. Basic sample application <?php if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); } $window = &new GtkWindow(); $window->set_default_size( 300, 200); $window->set_title( 'window title'); $vbox = &new GtkVBox(); $label = &new GtkLabel( 'Translation test'); $button = &new GtkButton( 'Close window'); $vbox->pack_start( $label); $vbox->pack_start( $button); $window->connect_object('destroy', array('gtk', 'main_quit')); $button->connect_object( 'clicked', array( 'gtk', 'main_quit')); $window->add( $vbox); $window->show_all(); gtk::main(); ?> We would like to have the "window title", "Translation test" and "Close window".

The first thing you need to do is loading the gettext extension, the same way you load php-gtk. This can be done by doing a if( !extension_loaded( 'gettext')) { if( !@dl( 'php_gettext.' . PHP_SHLIB_SUFFIX)) { die( 'gettext is not available'); } } The next step is to set the location of the translation file; this can be done with bindtextdomain( 'testapp', './locale'); which would assume that the .mo file would be in {CURRENT_DIR}/locale/{LANGUAGE}/LC_MESSAGES/testapp.mo. Language could be de_DE, depending on your system setting - this can be overridden with putenv( "LANG=" . 'de_DE'); //required on windows, because setlocale doesn't re ally work setlocale( LC_ALL, 'de_DE'); . You should always use the language identifier together with the country code as there have been problems on some systems when using only de or DE. The {CURRENT_DIR} assumes that the application is started with the working directory in the application directory; but this can't always be expected. It would be better to do a bindtextdomain( 'testapp', dirname( __FILE __) . '/locale'); which uses the real location of the current file as base. After setting the file location, you have to tell gettext which "domain" (part of the translation files) you want to use, in our case it would be "testapp": textdomain( 'testapp'); This allows you to use multiple domains in the same program, and you can switch between them everytime. The translation of strings if an ease: There is the function gettext which takes a string as parameter and returns the translated version. To make the code more readable, there is an alias of the function: _ (underscore). Now we change our code and get the following: Exemplo 3.5. Basic example with translation <?php if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); } putenv( "LANG=" . 'de_DE'); //required on windows, because setlocale doesn't re ally work setlocale( LC_ALL, 'de_DE'); if( !function_exists( 'gettext')) { //gettext not automatically loaded if( !@dl( 'php_gettext.' . PHP_SHLIB_SUFFIX)) {

die( 'gettext extension is not available!'); } } bindtextdomain( 'testapp', dirname( __FILE__) . '/locale'); textdomain( 'testapp'); $window = &new GtkWindow(); $window->set_default_size( 300, 200); $window->set_title( _('window title')); $vbox = &new GtkVBox(); $label = &new GtkLabel( _('Translation test')); $button = &new GtkButton( gettext('Close window')); $vbox->pack_start( $label); $vbox->pack_start( $button); $window->connect_object('destroy', array('gtk', 'main_quit')); $button->connect_object( 'clicked', array( 'gtk', 'main_quit')); $window->add( $vbox); $window->show_all(); gtk::main(); ?> When you start your application, you will see nothing translated: We forgot the translation file. Just copy the following into locale/de/LC_MESSAGES/testapp.po: # PHP-Gtk translation tutorial # Copyright (C) 2004 PHP-Gtk documentation team # Christian Weiske <cweiske@php.net>, 2004. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: 0.1N\n" "POT-Creation-Date: 2004-09-15 07:12+0100\n" "PO-Revision-Date: 2004-09-15 07:12+0100\n" "Last-Translator: Christian Weiske <cweiske@php.net>\n" "Language-Team: PHP-Gtk doc team germany <germany@example.com>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-1\n" "Content-Transfer-Encoding: 8bit\n" #: gettext_example.php:20 msgid "window title" msgstr "Fenstertitel" msgid "Translation test" msgstr "UEbersetzungstest" msgid "Close window" msgstr "Fenster schliessen" After doing this, compile it with msgfmt testapp.po and move the

created messages.mo to testapp.mo. Start the application again - you will see the app in the german language. Translating glade files Translating the strings in a glade file is really easy: If gettext is available and loaded and the textdomain is set, it automatically looks for translations - you just have to provide the translated .mo file in the right directory. Here is the example application, but with glade: Exemplo 3.6. Basic example with glade <?php if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); } putenv( "LANG=" . 'de_DE'); //required on windows, because setlocale doesn't wo rk setlocale( LC_ALL, 'de_DE'); if( !function_exists( 'gettext')) { //gettext not automatically loaded if( !@dl( 'php_gettext.' . PHP_SHLIB_SUFFIX)) { die( 'gettext extension is not available!'); } } bindtextdomain( 'testapp', dirname( __FILE__) . '/locale'); textdomain( 'testapp'); $glade =& new GladeXML( dirname( __FILE__) . "/example-tutorial-translation.gla de"); $window = $glade->get_widget( 'window'); $button = $glade->get_widget( 'button'); $window->connect_object('destroy', array('gtk', 'main_quit')); $button->connect_object( 'clicked', array( 'gtk', 'main_quit')); gtk::main(); ?> and here the glade file: <?xml version="1.0"?> <GTK-Interface> <project> <name>example-tutorial-translation</name> <program_name>example-tutorial-translation</program_name> <directory></directory> <source_directory>src</source_directory> <pixmaps_directory>pixmaps</pixmaps_directory> <language>C</language>

<gnome_support>False</gnome_support> <gettext_support>False</gettext_support> <output_translatable_strings>True</output_translatable_strings> <translatable_strings_file>example-tutorial-translation.strings</translatable _strings_file> </project> <widget> <class>GtkWindow</class> <name>window</name> <title>window title</title> <type>GTK_WINDOW_TOPLEVEL</type> <position>GTK_WIN_POS_NONE</position> <modal>False</modal> <default_width>300</default_width> <default_height>200</default_height> <allow_shrink>False</allow_shrink> <allow_grow>True</allow_grow> <auto_shrink>False</auto_shrink> <widget> <class>GtkVBox</class> <name>vbox</name> <homogeneous>False</homogeneous> <spacing>0</spacing> <widget> <class>GtkLabel</class> <name>label</name> <label>Translation test</label> <justify>GTK_JUSTIFY_CENTER</justify> <wrap>False</wrap> <xalign>0.5</xalign> <yalign>0.5</yalign> <xpad>0</xpad> <ypad>0</ypad> <child> <padding>0</padding> <expand>True</expand> <fill>True</fill> </child> </widget> <widget> <class>GtkButton</class> <name>button</name> <can_focus>True</can_focus> <label>Close window</label> <relief>GTK_RELIEF_NORMAL</relief> <child> <padding>0</padding> <expand>False</expand> <fill>False</fill> </child> </widget>

</widget> </widget> </GTK-Interface> Just start the script, and you will see a translated application as the string contents are already in testapp.mo. It can be quite boring to collect all the strings which shall be translated in a .glade file. Glade has the option "save translatable strings" which creates a file containing all the strings from a glade file - it's easy to convert them to a .po file. Some additional notes What to do if gettext is not available? As you can't assume that gettext is available and you want your app to work in all environments, you should provide a gettext "emulation": function _( $strString){return $strString;} function bindtextdomain( $strString){return $strString;} function dcgettext( $strDomain, $strString, $nCategory){ return $strString;} function dgettext( $strDomain, $strMessage) { return $strString;} function gettext( $strString){return $strString;} function textdomain( $strString){return $strString;} Replace the line die( 'gettext extension is not available!'); with the code above, and the gettext functions will be available even if gettext is not installed. They just return the original text, so that the apps will be in the original language. Dynamic sentences In message boxes you ask the user "There is a file "{FILENAME}". What shall I do with it?". The {FILENAME} could be on a totally different position in one of the target languages, so splitting the string is not an option. The solution is to replace the "{FILENAME}" with "%s" and use the sprintf() php function with the string. That way your strings are as portable as possible. Strings with multiple lines Sometimes you need to translate strings which are on multiple lines: They are noted in .po files on multiple lines as well, with quotes at the beginning and the end of a line. The first line is just a "". msgid "" "this is a" "multiline string" msgstr "" "Dies ist ein" "mehrzeiliger String"

Drag'n'drop with files ndice About this tutorial The application frame Receiving drops The text/uri-list format Dragging files to other applications The final program Further ideas About this tutorial This tutorial will show you how to use the drag'n'drop functions of PHP-Gtk and go deep into the topic "Files and DnD", as this is not as trivial as it might look. In the tutorial we will exemplarily build an application which has only one widget, a tree. This tree can be filled with branches and leaves by dropping files over it. You will be able to drag those files back to different programs, at least if you are not on Windows. Short: We build a bookmark manager for files. The application frame As the creation of the application's frame is not our topic, here is it: Exemplo 4.1. A working application skeleton <?php if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); } $fdnd = new FileDragNDrop(); $fdnd->buildDialog(); $fdnd->display(); class FileDragNDrop { function buildDialog() { $this->window =& new GtkWindow(); $this->window->set_title('FileDropper'); $this->window->set_default_size(200, 200); $this->window->connect_object('destroy', array('gtk', 'main_quit')); $scrolledwindow =& new GtkScrolledWindow(); $scrolledwindow->set_policy(GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC) ; $this->window->add($scrolledwindow); $this->tree =& new GtkCTree(3, 0, array('title', 'url', 'local path'));

$scrolledwindow->add($this->tree); $this->ndToplevel = $this->tree->insert_node(null, null, array('Files', '', ''), 0, null, null, null, null, false, true); $this->tree->connect('key-press-event', array(&$this, 'keyPressedTree') ); } function display() { $this->window->show_all(); gtk::main(); } function keyPressedTree($tree, $objEvent) { if ($objEvent->keyval == GDK_KEY_Delete) { $ar = $tree->selection; foreach ($ar as $objNode) { $tree->remove_node($objNode); } } } } ?> The code creates a window with a GtkCTree containing the root node. It is possible to delete nodes from the tree by pressing the "delete" key. Receiving drops After you have decided which type of data you want your application or widget to accept, you tell everyone about this decision by calling the drag_dest_set() function on the target widget. Since we want to accept files, we need the text/uri-list target type: Exemplo 4.2. Accepting files //at the end of buildDialog() $this->targets = array( array( 'text/uri-list', 0, 0)); $this->tree->drag_dest_set( GTK_DEST_DEFAULT_ALL, $this->targets, GDK_ACTION_CO PY | GDK_ACTION_MOVE); Let's analyze the code: * We want to accept files, and files indicated by the text/uri-list target type. * Drags shall be accepted from everywhere, so we give the second parameter a 0 and the third the same, as we don't have to distinguish between different target types. * The tree shall accept both copy and move requests. The move is very important, as all KDE applications (including Konqueror) seem to give their files to targets only which accept the move action. The Gtk knows now that we accept files, but we didn't say what to do

with them. The plan is to add all the dropped files to the tree, as children of the currently selected item. Exemplo 4.3. Handling the files //at the end of buildDialog() $this->tree->connect( 'drag-data-received', array( &$this, 'dragDataReceived')) ; // a new function function dragDataReceived($tree, $context , $x, $y, $data , $info, $time) { if (count($tree->selection) != 1) { $parent = $this->ndToplevel; } else { $parent = $tree->selection[0]; } $strData = $data->data; $arData = explode("\n", $strData); foreach ($arData as $strLine) { $strFile = trim($strLine); if ($strFile == '') { continue; } $tree->insert_node($parent, null, array(basename(urldecode($strFile)), $strFile, ''), 0, null, null, null, null, false, true); } $tree->columns_autosize(); } If you drop some files from your favorite file manager, you will see that they are added to the list. The text/uri-list format text/uri-list is the standard file listing format for drag and drop. It is specified as follows: * A list of files, each file per line. * Each line ends with a \r\n, carriage return and newline. * File names have to be valid, url-encoded URIs (Unique resource identifier). Exemplo 4.4. Example text/uri-list string file://localhost/usr/bin/opera[\r\n] file://localhost/c:/programs/myfile.txt[\r\n] file://server/data/software.xml[\r\n] http://gtk.php.net/apps/[\r\n] Now the world would not be the world we know if everyone followed the specs. As written on freedesktop.org, there are plenty of implementations, and most cook their own soup. Let it be the \r\n at the end of the line; most programs do that right but some just forget the \r. Some forget the terminating characters on the last line. That is easy to catch when implementing the routine in php.

The real problem are the URIs, or what the programmers think URIs are. URIs of some programs * Remember the correct URI: file://host/path/to/file * KDE programs like Konqueror, Kate and so pass the following: file:/path/to/file. Only one "/", totally incorrect. * Nautilus, gnome's file manager, passes file:///path/to/file. Correct protocol (file://), hostname left out (not really correct, but nearly), and the full path with a leading "/". * The Opera browser gives you a file://path/to/file. What is that? A relative filename? * When dragging links from Firefox, you get the same as with Nautilus: file:///path/to/file, nearly correct. The crux: Firefox doesn't drop files to targets accepting text/uri-list, only to text/plain ones. * The Windows' explorer is nearly correct like Nautilus and Firefox, giving a file:///c:/path/to/file. And beside files, there can be real URLs like http://gtk.php.net in the list. What does that tell us? We will have a hard time finding out where the file really is. We need a solution which accepts URIs that follow the standard AND is able to guess what files the source applications mean if the URI does not conform to the standard. The resulting code seems to be awkward, but that's the price for compatibility: Exemplo 4.5. Convert a (misformed) URI to a local path /** * converts a file path gotten from a text/uri-list * drop to a usable local filepath * @param string The line from the uri-list * @return string The usable local filepath */ function getPathFromUrilistEntry( $strUriFile) { $strUriFile = urldecode($strUriFile);//should be URL-encoded $bUrl = false; if (substr($strUriFile, 0, 5) == 'file:') { //(maybe buggy) file protocol if (substr($strUriFile, 0, 17) == 'file://localhost/') { //correct implementation $strFile = substr($strUriFile, 16); } else if (substr($strUriFile, 0, 8) == 'file:///') { //no hostname, but three slashes - nearly correct $strFile = substr($strUriFile, 7); } else if ($strUriFile[5] == '/') { //theoretically, the hostname should be the first //but no one implements it $strUriFile = substr($strUriFile, 5); for( $n = 1; $n < 5; $n++) { if ($strUriFile[$n] != '/') { break; } } $strUriFile = substr($strUriFile, $n - 1);

if (!file_exists($strUriFile)) { //perhaps a correct implementation with hostname??? $strUriFileNoHost = strstr(substr($strUriFile, 1), '/'); if (file_exists($strUriFileNoHost)) { //seems so $strUriFile = $strUriFileNoHost; } } $strFile = $strUriFile; } else { //NO slash after "file:" - what is that for a crappy program? $strFile = substr ($strUriFile, 5); } } else if (strstr($strUriFile, '://')) { //real protocol, but not file $strFile = $strUriFile; $bUrl = true; } else { //local file? $strFile = $strUriFile; } if (!$bUrl && $strFile[2] == ':' && $strFile[0] == '/') { //windows file path $strFile = str_replace('/', '\\', substr($strFile, 1)); } return $strFile; } Now that we have a nice conversion routine, we can extend our source to display the local path in the file tree: Exemplo 4.6. Displaying the local file path in the tree $tree->insert_node($parent, null, array(basename(urldecode($strFile)), $strFile , $this->getPathFromUrilistEntry($strFile)), 0, null, null, null, null, false, true); Dragging files to other applications It seems that Gtk 1.x on windows allows you to receive drops from other windows programs, but not to drag outside the application. This means you can use DnD inside your PHP-Gtk application, but use drop only when communicating with other programs. The good news: Unlike the drop problems, all tested programs (Konqueror, Kate, Firefox, Opera, Nautilus) seem to be able to handle correct URIs dragged to them in the right way. Even Firefox accepts text/uri-list data. The first step is again to tell the widget that it has the ability to act as a source for drag data. Furthermore, we need to provide the data we want to drag, which can be done by connecting the widget to the "drag-data-get" signal. Exemplo 4.7. Setting up the drag source

//at the end of buildDialog() $this->tree->drag_source_set(GDK_BUTTON1_MASK, $this->targets, GDK_ACTION_COPY) ; $this->tree->connect('drag-data-get', array(&$this, 'dragDataGet')); We told the widget the following: * Act as a drag source when the user uses the first (mostly left) mouse button * Provide one format for the dragging data, namely text/uri-list * Require the drop target to copy the file, not to move it. * When the target widget demands for the data, call the dragDataGet function of our class. Next is to provide the data for the drop target in the dragDataGet function: Exemplo 4.8. Setting the data to drag function dragDataGet( $tree, $context, $selection_data, $info, $time) { if( count( $tree->selection) < 1) { return false; } $node = $tree->selection[0]; $file = $tree->node_get_text( $node, 2); if( $file == '') { return false; } $selection_data->set($selection_data->target, 8, urlencode($this->getUriFro mFile($file)) . "\r\n"); } /** * converts a file name to a URI * useful to convert a file to the text/uri-list compatible format * @param string The file * @return string The URI */ function getUriFromFile( $strFile) { if (strstr($strFile, '://')) { //real URL $strUri = $strFile; } else { //normal file if (substr($strFile, 1, 2) == ':\\') { //windows path c:\programs\bla\blu\file.bli $strUri = 'file://localhost/' . str_replace('\\', '/', $strFile); } else { //should be nice unix file //@fixme: convert relative names to absolute ones? $strUri = 'file://localhost' . realpath($strFile); } } return $strUri; } The data are passed by overwriting the selection data via the set() method of the selection_data. As we want to follow the standards, the file name has to be converted to a full-flagged url-encoded URI, with the terminating \r\n at the end of the line. When nothing is selected

in the tree, we don't change the selection data. When trying to drag a file to your favorite application, you will note that nothing happens. Why? The URI passed to the program looks like that: file%3A%2F%2Flocalhost%2Fdata%2Fphp-gtk. Yes, urlencode doesn't take care of the character's meaning in the URI. Now it would cost some effort to make a function which does a correct encoding while taking care of special characters, as http URIs can contain slashes in a parameter which would have to be encoded, but slashes in the filename not. For that reason, only a simple back-translation of some chars is done after urlencoding the string: Exemplo 4.9. urlencode replacement function pathurlencode($uri) { $uri = urlencode($uri); $uri = str_replace('%3A', ':', $uri); $uri = str_replace('%2F', '/', $uri); $uri = str_replace('%26', '&', $uri); $uri = str_replace('%40', '@', $uri); $uri = str_replace('%3A', ':', $uri); $uri = str_replace('%3F', '?', $uri); return $uri; } With that, we can change our dragDataGet function: $selection_data->set($selection_data->target, 8, $this->pathurlencode($this->ge tUriFromFile($file)) . "\r\n"); The final program <?php if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); } $fdnd = new FileDragNDrop(); $fdnd->buildDialog(); $fdnd->display(); class FileDragNDrop { function buildDialog() { $this->window =& new GtkWindow(); $this->window->set_title('FileDropper'); $this->window->set_default_size(200, 200); $this->window->connect_object('destroy', array('gtk', 'main_quit')); $scrolledwindow =& new GtkScrolledWindow(); $scrolledwindow->set_policy(GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC) ; $this->window->add($scrolledwindow); $this->tree =& new GtkCTree(3, 0, array('title', 'url', 'local path')); $scrolledwindow->add($this->tree);

$this->ndToplevel = $this->tree->insert_node(null, null, array('Files', '', ''), 0, null, null, null, null, false, true); $this->tree->connect('key-press-event', array(&$this, 'keyPressedTree') ); $this->tree->connect( 'drag-data-received', array( &$this, 'dragDataRec eived')); $this->targets = array( array( 'text/uri-list', 0, 0)); $this->tree->drag_dest_set( GTK_DEST_DEFAULT_ALL, $this->targets, GDK_A CTION_COPY | GDK_ACTION_MOVE); $this->tree->drag_source_set(GDK_BUTTON1_MASK, $this->targets, GDK_ACTI ON_COPY); $this->tree->connect('drag-data-get', array(&$this, 'dragDataGet')); } function display() { $this->window->show_all(); gtk::main(); } function keyPressedTree($tree, $objEvent) { if ($objEvent->keyval == GDK_KEY_Delete) { $ar = $tree->selection; foreach ($ar as $objNode) { $tree->remove_node($objNode); } } } function dragDataReceived($tree, $context , $x, $y, $data , $info, $time) { if (count($tree->selection) != 1) { $parent = $this->ndToplevel; } else { $parent = $tree->selection[0]; } $strData = $data->data; $arData = explode("\n", $strData); foreach ($arData as $strLine) { $strFile = trim($strLine); if ($strFile == '') { continue; } $tree->insert_node($parent, null, array(basename(urldecode($strFile )), $strFile, $this->getPathFromUrilistEntry($strFile)), 0, null, null, null, n ull, false, true); } $tree->columns_autosize(); } /** * converts a file path gotten from a text/uri-list

* drop to a usable local filepath * @param string The line from the uri-list * @return string The usable local filepath */ function getPathFromUrilistEntry($strUriFile) { $strUriFile = urldecode($strUriFile);//should be URL-encoded $bUrl = false; if (substr($strUriFile, 0, 5) == 'file:') { //(maybe buggy) file protocol if (substr($strUriFile, 0, 17) == 'file://localhost/') { //correct implementation $strFile = substr($strUriFile, 16); } else if (substr($strUriFile, 0, 8) == 'file:///') { //no hostname, but three slashes - nearly correct $strFile = substr($strUriFile, 7); } else if ($strUriFile[5] == '/') { //theoretically, the hostname should be the first //but no one implements it $strUriFile = substr($strUriFile, 5); for( $n = 1; $n < 5; $n++) { if ($strUriFile[$n] != '/') { break; } } $strUriFile = substr($strUriFile, $n - 1); if (!file_exists($strUriFile)) { //perhaps a correct implementation with hostname??? $strUriFileNoHost = strstr(substr($strUriFile, 1), '/'); if (file_exists($strUriFileNoHost)) { //seems so $strUriFile = $strUriFileNoHost; } } $strFile = $strUriFile; } else { //NO slash after "file:" - what is that for a crappy program? $strFile = substr ($strUriFile, 5); } } else if (strstr($strUriFile, '://')) { //real protocol, but not file $strFile = $strUriFile; $bUrl = true; } else { //local file? $strFile = $strUriFile; } if (!$bUrl && $strFile[2] == ':' && $strFile[0] == '/') { //windows file path $strFile = str_replace('/', '\\', substr($strFile, 1)); } return $strFile; } function dragDataGet($tree, $context, $selection_data, $info, $time) { if( count( $tree->selection) < 1) { return false; }

$node = $tree->selection[0]; $file = $tree->node_get_text( $node, 2); if( $file == '') { return false; } $selection_data->set($selection_data->target, 8, $this->pathurlencode($ this->getUriFromFile($file)) . "\r\n"); } /** * converts a file name to a URI * useful to convert a file to the text/uri-list compatible format * @param string The file * @return string The URI */ function getUriFromFile($strFile) { if (strstr($strFile, '://')) { //real URL $strUri = $strFile; } else { //normal file if (substr($strFile, 1, 2) == ':\\') { //windows path c:\programs\bla\blu\file.bli $strUri = 'file://localhost/' . str_replace('\\', '/', $strFile ); } else { //should be nice unix file //@fixme: convert relative names to absolute ones? $strUri = 'file://localhost' . realpath($strFile); } } return $strUri; } function pathurlencode($uri) { $uri = urlencode($uri); $uri = str_replace('%3A', ':', $uri); $uri = str_replace('%2F', '/', $uri); $uri = str_replace('%26', '&', $uri); $uri = str_replace('%40', '@', $uri); $uri = str_replace('%3A', ':', $uri); $uri = str_replace('%3F', '?', $uri); return $uri; } } ?> Further ideas There is a PEAR package which solves exactly this problem: Gtk_FileDrop. One could extend the application to save and load the tree's contents. The XBEL (XML Bookmark Exchange Language) would be very ideal for this.

Make your applications user-friendly: Every text field which requires a filename or a path should accept drops from file managers. Guia de Refercia _________________________________________________________________ ndice Classes do GTK Classes do GDK GTK Extra Classes GTK Enums GDK Enums GtkExtra Enums Classes do Glade Classes do Scintilla Classes do Sqpane Classes do GTK Classes derivadas da Biblioteca GTK ndice GtkAccelGroup Uma estrutura que contm dados da chave do acelerador. GtkAccelLabel A label that can display an accelerator key next to the text. GtkAdjustment Represents an adjustable bounded value. GtkAlignment A container that controls the alignment and scale of its child. GtkArrow An arrow pointing in one of the four cardinal directions. GtkAspectFrame A frame that constrains its child to a particular aspect ratio. GtkBin Base class for containers with just one child. GtkBox Base class for box containers. GtkButton A container widget that emits a signal when clicked on.

GtkButtonBox Base class for GtkHButtonBox and GtkVButtonBox. GtkCalendar A calendar offering dates that can be selected and marked. GtkCheckButton Button that displays a discrete toggle indicator. GtkCheckMenuItem Menu item with a toggle indicator. GtkCList A multi-columned scrolling list widget. GtkColorSelection Widget that allows for selection of a color. GtkColorSelectionDialog Standard dialog box for selecting a color. GtkCombo Text entry field with a dropdown list. GtkContainer Base class for all container widgets. GtkCTree Widget that displays a hierarchical tree. GtkCurve Widget that allows editing of a curve. GtkData Abstract base class for objects containing data. GtkDialog Widget that eases creation of popup dialogs. GtkDrawingArea Widget for custom user interface elements. GtkEditable Base class for text-editing widgets. GtkEntry A single line text entry field. GtkEventBox Widget used to capture events for widgets with no GdkWindow. GtkFileSelection Widget for selecting a file or a directory.

GtkFixed Container that retains the sizes and positions of its children. GtkFontSelection Widget for selecting fonts. GtkFontSelectionDialog Standard dialog box for selecting fonts. GtkFrame Container with a decorative frame and an optional label. GtkGammaCurve A subclass of GtkCurve for editing gamma curves. GtkHandleBox Widget for detachable window portions. GtkHBox Horizontal box container. GtkHButtonBox Container for arranging a group of buttons horizontally. GtkHPaned Container with two panes arranged horizontally. GtkHRuler Horizontal ruler. GtkHScale Horizontal slider widget for selecting a value from a range. GtkHScrollbar Horizontal scrollbar. GtkHSeparator Horizontal separator. GtkImage Widget for displaying a graphical image. GtkInputDialog Standard dialog for configuring input devices. GtkInvisible Internally used widget which is not displayed. GtkItem Abstract base class for GtkMenuItem, GtkListItem, and GtkTreeItem. GtkItemFactory

A factory class for simplified menu creation. GtkLabel Widget that displays a small amount of text. GtkLayout Scrollable widget allowing multiple children in fixed positions. GtkList Widget displaying a list of selectable items. GtkListItem A single element in a GtkList. GtkMenu Popup container for menu items. GtkMenuBar Horizontal container for menu items. GtkMenuItem Widget used for item in menus. GtkMenuShell Abstract base class for menu objects. GtkMisc Base class for widgets having their own alignment and padding. GtkNotebook Widget that displays a set of pages with tabs. GtkObject The base class of the PHP-GTK class hierarchy. GtkOptionMenu Widget used to choose from a list of valid choices. GtkPacker GtkPaned Base class for widgets with two adjustable panes. GtkPixmap Widget displaying a graphical image or icon. GtkPlug Toplevel widget for embedding into other processes. GtkPreview Widget to display RGB or grayscale data.

GtkProgress Base class for GtkProgressBar. GtkProgressBar Widget that provides a visual indication of an operation's progress. GtkRadioButton Button that is part of a group, only one of which may be selected. GtkRadioMenuItem Menu item that is part of a group, only one of which may be selected. GtkRange Base class for widgets that manipulate the value of a GtkAdjustment. GtkRuler Base class for horizontal and vertical rulers. GtkScale Base class for GtkHScale and GtkVScale. GtkScrollbar Base class for GtkHScrollbar and GtkVScrollbar. GtkScrolledWindow Adds scrollbars to its child widget. GtkSeparator Base class for GtkHSeparator and GtkVSeparator. GtkSocket Container for widgets from other processes. GtkSpinButton Widget offering masked numerical entry and/or selection. GtkStatusbar Widget that provides a way to report messages of minor importance. GtkStyle A class that determines the appearance of widgets. GtkTable Container that provides a flexible grid for packing its children. GtkTearoffMenuItem Menu item used to tear off and reattach its menu.

GtkText Editable text-display widget. GtkTipsQuery Displays help about widgets in the user interface. GtkToggleButton Button that retains its state. GtkToolbar Container that creates bars of buttons and other widgets. GtkTooltips Adds tooltips to other widgets. GtkTree Widget for displaying hierarchical information. GtkTreeItem One node of a GtkTree widget. GtkVBox Vertical box container. GtkVButtonBox Container for arranging a group of buttons vertically. GtkViewport Provides scrolling capability for non-scrolling aware widgets. GtkVPaned Container with two panes arranged vertically. GtkVRuler Vertical ruler. GtkVScale Vertical slider widget for selecting a value from a range. GtkVScrollbar Vertical scrollbar. GtkVSeparator Vertical separator. GtkWidget Base class for user interface elements. GtkWindow Widget that provides windows for an application. GTK Functions

GTK functions not belonging to any class. GtkAccelGroup Uma estrutura que contm dados da chave do acelerador. Hierarquia do Objeto GtkAccelGroup Direct subclasses None. Descrio GtkAccelGroup uma classe que guarda os dados da chave do acelerador para todos os menus em uma GtkWindow. Ela geralmente colocada na janela para evitar confuses no aplicativo. A informao guardada em uma tabela hash das entradas GtkAccelEntry, cada uma delas precisa ser criada para cada acelerador. No PHP-GTK no h acesso direto essas entradas. Uma chave do acelerador o mesmo que um atalho do teclado para um GtkMenuItem. Veja tambm: add_accel_group() , add_accelerator() , GtkAccelLabel, GtkMenuItem. Construtor GtkAccelGroup (); -- Fornece a estrutura necessria para guardar informaes sobre uma tabela hash da chave do acelerador. Mtodos lock() Trava a informao do grupo do accelerator. unlock() Destrava a informao do grupo do accelerator. GtkAccelGroup Construtor GtkAccelGroup (); Embora no faa parte da hierarquia dos objetos do GTK, a classe GtkAccelGroup pode ser construda da mesma maneira que a maioria das classes GTK, ex: $accelgroup = &new GtkAccelGroup(); Na maioria dos casos, GtkAccelGroup contrudo poderia ser usado por

todos os menus pertencentes janela de primeir nvel(toplevel), e poderia ser adicionado usando a funo add_accel_group() . No sempre necessrio criar um grupo de aceleradores desta menira. O mtodo GtkMenu chama a funo ensure_uline_accel_group() da classe GtkAccelGroup usado internamente pelo menu para sublinhar os aceleradores (atalhos) pelo perodo de durao no qual o menu aparece. Se nenhum acelerador (atalho) for designiado, um novo grupo de aceleradores criado e usado. GtkAccelGroup::lock void lock(void); lock() impede futuras alteraes nas entradas dos aceleradores nas chamadas classe GtkAccelGroup. Para impedir que as chaves sejam alteradas, adicionadas ou removidas de uma nica entrada GtkAccelEntry, use a funo lock_accelerators() . GtkAccelGroup::unlock void unlock(void); A funo unlock() permite que as entradas dos aceleradores sejam alteradas, adicionadas ou removidas de um GtkAccelGroup previamente travado. Para permitir que uma chave secundria em uma lista GtkAccelEntry seja designada pelo usurio, use unlock_accelerators() . GtkAccelLabel A label that can display an accelerator key next to the text. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkMisc `-- GtkLabel `-- GtkAccelLabel Direct subclasses None. Descrio A GtkAccelLabel is a label capable of displaying any accelerator, modifier keys and signal set on a GtkMenuItem or similar widget. In PHP-GTK this is effectively an internal widget, as an accelerator label is created the moment a text string is passed to

a menu item. It is therefore unlikely that you will ever need to use the constructor, or any of the methods that this class directly provides. However, you may need to access it, for instance to parse an underline in a label's text string or to retrieve a menu's textual content. To access the GtkAccelLabel within an existing menu item, use the following code: $accel_label = $menu_item->child; You will then be able to call most of the methods available to a new instance of a GtkAccelLabel. Construtor GtkAccelLabel (string string); -- Constructs a label for displaying accelerator information. Mtodos get_accel_width() Sets width to accommodate accelerator information. set_accel_widget() Associates accelerator label with specified widget. refetch() Recreates accelerator information. GtkAccelLabel Construtor GtkAccelLabel (string string); This is effectively an internal construct in PHP-GTK, and there should be no reason to use it unless you are writing an original widget. See instead: GtkAccelLabel description, GtkLabel, add_accelerator() , parse_uline() . GtkAccelLabel::get_accel_width int get_accel_width(void); get_accel_width() is used within GTK+ in order to find the width needed by the target menu item to accommodate any accelerator information displayed on the label. There should be no reason to call this method unless you are writing an original widget. GtkAccelLabel::set_accel_widget

void set_accel_widget( GtkWidget accel_widget ); set_accel_widget() is called within GTK+ at the point where a GtkAccelLabel is added to a menu item. There should be no reason to call this method unless you are writing an original widget. GtkAccelLabel::refetch bool refetch(void); refetch() is called within GTK+ in order to create new accelerator information on a GtkAccelLabel following changes made to that information. There should be no reason to call this method unless you are writing an original widget. GtkAdjustment Represents an adjustable bounded value. Hierarquia do Objeto GtkObject `-- GtkData `-- GtkAdjustment Direct subclasses None. Descrio Any widget with a moving part has a GtkAdjustment at work behind it somewhere. The adjustment object is used to limit the range of values used by that moving part and also, in some widgets, to determine the size of the steps by which the value may be increased or decreased. Construtor GtkAdjustment (double value, double lower, double upper, double step_increment, double page_increment, double page_size); -- Creates the basis for an adjustable widget. Mtodos changed() Emits "changed" signal. value_changed()

Emits "value-changed" signal. clamp_page() Prevents bounds being exceeded. set_value() Sets adjustment value. Sinais "changed" Emitted when a property other than value changes. "value-changed" Emitted when the value of any property is changed. Propriedades value: Current value. lower: Lower bound. upper: Upper bound. step_increment: Smaller incremental step value. page_increment: Larger incremental step value. page_size: Displayed area. GtkAdjustment Construtor GtkAdjustment (double value, double lower, double upper, double step_increment, double page_increment, double page_size); Not every widget with an underlying adjustment object uses all six of the properties available. Where this occurs, null is not a valid parameter option; all the adjustment parameters take double values, and you will need to set them as 0.0 where they are not needed. The first parameter, value, is used by every widget with an adjustable part. It represents the current value, and should be set to the value that you want to see displayed on opening. That setting will most often be 0.0 for percentage-based values (e.g. in a GtkProgressBar or in a GtkScrollbar), or 1.0 for literal values (e.g. in a GtkSpinButton). lower and upper are the next two parameters. These represent the

limitations on the changing value; what is the lowest possible value, and what is the highest? Very often, the opening value is at the start of the rising scale, and will in that case be equal in value to the lower parameter setting. The way you choose to express the upper bound may depend on the step_increment, which is defined in the fourth parameter when it is used at all. For instance, you could set the upper bound at 100.0 and increment the value in steps of 1.0, or set it at 1.0 and increment the value in steps of 0.01, depending on what it is you are measuring or on your mood. Either goes the same distance. The final two parameters are page_increment and page_size. Where these are used, the page_increment should have roughly 90% of the page_size value. If you set the page size to the same value as the upper bound, a GtkScrollbar using these values will be extended so that it cannot be scrolled. This can be a way to test whether your values are being set. In some widgets - GtkCList, GtkLayout, GtkText and GtkViewport the adjustment values can be set internally by scrolling-aware container widgets, and these will override settings that are made manually. A GtkScrollbar, conversely, has no adjustment values until you set them. Caveat: if a scrollbar shares a GtkAdjustment object with a widget that has overriding pre-set values, the scrollbar will share the widget's adjustment settings as part of the process of becoming associated with that widget. See also: GtkCList, GtkLayout, GtkProgressBar, GtkRange, GtkScale, GtkScrollbar, GtkScrolledWindow, GtkSpinButton, GtkText, GtkViewport, set_focus_hadjustment() , set_focus_vadjustment() . GtkAdjustment::changed void changed(void); The changed() method makes the adjustment object fire the "changed" signal. This method is called internally whenever there is a change to any of the GtkAdjustment's properties. GtkAdjustment::value_changed void value_changed(void); The value_changed() method is called internally whereever a signal emission is needed. It causes the "value-changed" signal to be emitted. GtkAdjustment::clamp_page void clamp_page(double lower, double upper); clamp_page() is used internally to ensure that, if a page is being scrolled down, the incremental value is not added to the end of the page in terms of extra space at the bottom. It compares the set bounds and the page size with the current adjustment value and prevents them from adding up to more than the sum of their parts.

GtkAdjustment::set_value void set_value(double value); This method sets the adjustment value to a new level. It doesn't work where that value has already been set by a widget or widgets; widget settings always take precedence over manual settings. Where it is allowed, it causes a "value-changed" signal to be emitted, if the value is within the adjustment range. Adjustable widgets generally have their own wrapper method for setting the adjustment value, which should be used in preference where it exists. changed The "changed" signal is emitted when any of the properties other than the value is altered in a GtkAdjustment. This happens when the adjustment object has its values initialised or unset, or when a widget-owned scrollable object is resized, or when the adjustable widget has a configure() method and calls it. Note that a "value-changed" signal is also emitted under the same circumstances, regardless of whether the value itself has been changed. Funo Callback void callback(GtkAdjustment button); value-changed The "value-changed" signal is emitted when there is a change to any of the values in a GtkAdjustment. If the signal is accompanied by a "changed" emission, the altered property was something other than value. Funo Callback void callback(GtkAdjustment button); GtkAdjustment::value Access: Read Only Type: double The value property represents the current value of a GtkAdjustment. This may be initialized manually or, in some instances, by a scrolling-aware parent widget. Anything descended from GtkContainer falls into the latter category. In most cases, the value does not need any more attention after it has been set, and will be incremented or decremented purely through

GdkEvents initiated by the user and controlled by the other adjustment settings. This property gives a means of accessing that information across all adjustable widgets. GtkAdjustment::lower Access: Read Only Type: double lower is the lowest value that will be accepted by the GtkAdjustment. GtkAdjustment::upper Access: Read Only Type: double upper is the highest value that will be accepted by the GtkAdjustment. GtkAdjustment::step_increment Access: Read Only Type: double The step_increment is the smaller of the two incremental values, made manifest as a left click on a GtkSpinButton or GtkScrollbar arrow. This property is not used across the full range of adjustable widgets, and should return 0 when queried where this is the case. GtkAdjustment::page_increment Access: Read Only Type: double The page_increment is the larger of the two incremental values, responding to a right click on a GtkSpinButton arrow or as a click in the trough belonging to a GtkScrollbar. This property is not used across the full range of adjustable widgets, and should return 0 when queried where this is the case. GtkAdjustment::page_size Access: Read Only Type: double The page_size is the area of (for instance) text that is displayed at any given time. This property is not used across the full range of adjustable widgets, and should return 0 when queried where this is the case. GtkAlignment A container that controls the alignment and scale of its child. Hierarquia do Objeto

GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkAlignment Direct subclasses None. Descrio GtkAlignment is a container class that controls the alignment and scale of its child widget, relative to its own dimensions. Where the child widget has sizing responsibilites to a child or children of its own, these are fulfilled as a priority. For example, a GtkButton with a label will never be scaled down to the minimal size that the same widget with no label can; the label is the button's child, and the button must honour its size request. See also: GtkAspectFrame, GtkContainer, set_uposition() , set_usize() . Construtor GtkAlignment (double xalign, double yalign, double xscale, double yscale); -- Creates a container that determines its child's alignment and scale. Mtodos set() Sets new parameter values for an existing GtkAlignment. GtkAlignment Construtor GtkAlignment (double xalign, double yalign, double xscale, double yscale); A GtkAlignment object has control over its child widget's relative position and size. Each parameter is a double, with the minimum value being 0.0 and the maximum value being 1.0. The first two parameters describe the positioning of the child widget, with 0.0 being the left or top of the containing GtkAlignment and 1.0 being the right or bottom. A child with the setting 0.5, 0.5 as the first two parameters is fully centred, with scale being taken into consideration throughout. The second pair of parameters determine the scale of the child widget,

with the setting 1.0, 1.0 having the child widget fill the available area and the setting 0.0, 0.0 shrinking the child to its minimum possible size. If the widget has no children of its own, that can be just a couple of pixels in each direction - but it must obey the size requests made by any such children. GtkAlignment::set void set(double xalign, double yalign, double xscale, double yscale); This method sets new values for a GtkAlignment's parameters. Exemplo 1. Resetting GtkAlignment parameters. <?php dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); function change_it($align, &$i) { if($i%2) $align->set(1.0, 1.0, 0.4, 0.3); elseif($i%3) $align->set(0.0, 0.0, 0.6, 0.2); else $align->set(0.0, 1.0, 0.1, 0.2); $i++; } $window = &new GtkWindow(); $window->set_position(GTK_WIN_POS_CENTER); $window->set_default_size((gdk::screen_width()-10), (gdk::screen_height()-30)); $window->connect_object('destroy', array('gtk', 'main_quit')); $align = &new GtkAlignment(0.5, 0.5, 1.0, 1.0); $button = &new GtkButton("Click Here"); $i = 0; $button->connect_object('enter', 'change_it', $align, &$i); $align->add($button); $align->show_all(); $window->add($align); $window->show_all(); gtk::main(); ?> GtkArrow An arrow pointing in one of the four cardinal directions. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkMisc `-- GtkArrow

Direct subclasses None. Descrio The GtkArrow widget is a drawn triangle that has its "nose" pointing in the direction specified during construction. The look of the arrow is varied through the choice of GtkShadowType, and it inherits from the GtkMisc class the ability to have its own padding and alignment properties altered directly, both of which can also have a surprisingly big impact on the arrow's appearance. Construtor GtkArrow ( GtkArrowType arrow_type , GtkShadowType shadow_type ); -- Displays an arrow pointing in one of the four cardinal directions. Mtodos set() Sets new parameter values for an existing GtkArrow. Propriedades arrow_type: Direction of arrow's nose. shadow_type: Appearance of arrow. GtkArrow Construtor GtkArrow ( GtkArrowType arrow_type , GtkShadowType shadow_type ); For a simple widget, there are a lot of options in the construction of the GtkArrow - twenty different combinations in all. It may not be immediately obvious that the GtkArrow is made up entirely of lines of shadow. As a result of this, the GtkShadowType option GTK_SHADOW_NONE actually creates an invisible arrow - a potentially useful option to have, given that the parameters of the arrow can be redefined at any point using the set() method. The syntax to create a right-pointing, etched arrow would be: $arrow = &new GtkArrow(GTK_ARROW_RIGHT, GTK_SHADOW_ETCHED_IN); Exemplo 2. A list of GtkArrows <?php if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX);

} $window = &new GtkWindow(); $window->set_default_size( 600, 500); $window->connect_object('destroy', array('gtk', 'main_quit')); $table = &new GtkTable( 5, 6); $color = &new GdkColor( '#FF0000'); $arTxtArrowTypes = array( 'GTK_ARROW_UP', 'GTK_ARROW_DOWN', 'GTK_ARROW_LEFT', ' GTK_ARROW_RIGHT'); $arTxtShadowTypes = array( '', 'GTK_SHADOW_NONE', 'GTK_SHADOW_IN', 'GTK_SHADOW_ OUT', 'GTK_SHADOW_ETCHED_IN', 'GTK_SHADOW_ETCHED_OUT'); for( $nA = 0; $nA < 6; $nA++) { $label = &new GtkLabel( $arTxtShadowTypes[$nA]); $table->attach( $label, 0, 1, $nA, $nA+1); for( $nB = 0; $nB < 5; $nB++) { if( $nA == 0) { $widget = &new GtkLabel( $arTxtArrowTypes[$nB]); } else { $widget = &new GtkArrow( $nB, $nA-1); $style = $widget->style; $style->bg[GTK_STATE_NORMAL] = $color; // $widget->set_style( $style); } $table->attach( $widget, $nB+1, $nB+2, $nA, $nA+1, GTK_EXPAND|G TK_FILL, GTK_EXPAND|GTK_FILL); } } $window->add( $table); $window->show_all(); gtk::main(); ?> GtkArrow::set void set( GtkArrowType arrow_type , GtkShadowType shadow_type ); This method redefines the parameters for an existing GtkArrow. It would typically be used within a callback function where the arrow was required to point in another direction, change its appearance and/or vanish. Exemplo 3. Setting the direction of a GtkArrow dynamically <?php if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); } $window = &new GtkWindow();

$window->set_default_size( 150, 150); $window->connect_object('destroy', array('gtk', 'main_quit')); $table = &new GtkTable( 3, 3); $arButtons = array( array( 'Up', GTK_ARROW_UP, 1, 0), array( 'Left', GTK_ARROW_LEFT, 0, 1), array( 'Right', GTK_ARROW_RIGHT, 2, 1), array( 'Down', GTK_ARROW_DOWN, 1, 2), ); $color = &new GdkColor( '#FF0000'); $arrow = &new GtkArrow( GTK_ARROW_UP, GTK_SHADOW_NONE); $table->attach( $arrow, 1, 2, 1, 2, GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL); $style = $arrow->style; $style->bg[GTK_STATE_NORMAL] = $color; //$arrow->set_style( $style); function setArrow( $objButton, $objArrow, $nDirection) { $objArrow->set( $nDirection, GTK_SHADOW_OUT); } foreach( $arButtons as $arButtonDesc) { $button = &new GtkButton( $arButtonDesc[0]); $table->attach( $button, $arButtonDesc[2], $arButtonDesc[2]+1, $arButto nDesc[3], $arButtonDesc[3]+1); $button->connect( 'clicked', 'setArrow', $arrow, $arButtonDesc[1]); } $window->add( $table); $window->show_all(); gtk::main(); ?> GtkArrow::arrow_type Access: Read Only Type: GtkArrowType The arrow_type property is a GtkArrowType enumerated value which can be queried to test in which direction the arrow is currently pointing. GtkArrow::shadow_type Access: Read Only Type: GtkShadowType The shadow_type property is a GtkShadowType enumerated value which can be queried to test the current style of the arrow's appearance.

GtkAspectFrame A frame that constrains its child to a particular aspect ratio. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkFrame `-- GtkAspectFrame Direct subclasses None. Descrio Construtor GtkAspectFrame ([string label = NULL , [double xalign = 0.5 , [double yalign = 0.5 , [double ratio = 1.0 , [bool obey_child = TRUE ]]]]]); -Mtodos set() GtkAspectFrame Construtor GtkAspectFrame ([string label = NULL , [double xalign = 0.5 , [double yalign = 0.5 , [double ratio = 1.0 , [bool obey_child = TRUE ]]]]]); GtkAspectFrame::set void set(double xalign, double yalign, double ratio, bool obey_child); GtkBin Base class for containers with just one child. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin Direct subclasses GtkAlignment, GtkButton, GtkEventBox, GtkFrame, GtkHandleBox,

GtkInvisible, GtkItem, GtkScrolledWindow, GtkViewport, GtkWindow Descrio GtkBin is a container widget that is capable of holding only one child. All widgets derived from GtkBin therefore also can only contain one immediate child, although this child may itself contain multiple widgets. Note that GtkBin is an abstract base class and cannot be constructed directly. See also: GtkBox, GtkContainer. Propriedades child: The child widget. GtkBin::child Access: Read Only Type: GtkWidget This property allows access to the child widget contained by the GtkBin object. It can be treated like any other GtkWidget. If the value of this property is NULL, then GtkBin object does not contain a child widget. $button->remove($button->child); GtkBox Base class for box containers. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBox Direct subclasses GtkButtonBox, GtkHBox, GtkVBox Descrio GtkBox is a base class providing box containers GtkHBox and GtkVBox with properties and methods for packing any number of child widgets. Note that GtkBox is an abstract class and cannot be constructed

directly. See also: GtkBin, GtkBoxChild, GtkContainer, GtkTable. Mtodos pack_start() Packs from top or left of box container. pack_end() Packs from bottom or right of box container. pack_start_defaults() Packs from top or right using default settings. pack_end_defaults() Packs from bottom or left using default settings. set_homogeneous() Toggles equality of child sizing. set_spacing() Sets spacing between children. reorder_child() Sets new position for child. set_child_packing() Sets packing parameters for child. query_child_packing() Queries packing parameters for child. Propriedades children: Array of child packing information. spacing: Universal spacing policy. homogeneous: Universal sizing policy. GtkBox::pack_start void pack_start( GtkWidget child , [bool expand = true , [bool fill = true , [int padding = 0 ]]]); pack_start() packs the child widget from the top or left of the box container. The expand parameter is a boolean value that determines whether the child can expand when the parent container is resized. The second parameter fill is also a boolean value, and determines whether the child should fill the space available to it. The third parameter

padding is an integer describing the padding around the child widget, in pixels. The default values are true, true, 0. Calls to pack_start() can be mixed with calls to pack_end() or even add() , within the same box container. GtkBox::pack_end void pack_end( GtkWidget child , [bool expand = true , [bool fill = true , [int padding = 0 ]]]); pack_end() packs the child widget from the bottom or right of the box container. The expand parameter is a boolean value that determines whether the child can expand when the parent container is resized. The second parameter fill is also a boolean value, and determines whether the child should fill the space available to it. The third parameter padding is an integer descrbing the padding around the child widget, in pixels. The default values are true, true, 0. pack_end() calls may be interspersed with pack_start() calls within the same box container widget. GtkBox::pack_start_defaults void pack_start_defaults( GtkWidget widget ); pack_start_defaults() packs the given child widget from the top or from the left of the box container using the default parameter values true, true, 0. The same result can be achieved by using $box->pack_start($child); without specifying any further parameters. GtkBox::pack_end_defaults void pack_end_defaults( GtkWidget widget ); pack_end_defaults() packs the given child widget from the bottom or from the right of the box container using the default parameter values true, true, 0. The same result can be achieved by using $box->pack_end($child); without specifying any further parameters. GtkBox::set_homogeneous void set_homogeneous(bool homogeneous); set_homogeneous() sizes all the child widgets in the container to the dimensions of the largest child widget if set to true. The default

setting is false. Note that the homogeneous property corresponding to this function refers to the child sizing in only one dimension, that is, the height in a row or the width in a column. GtkBox::set_spacing void set_spacing(int spacing); set_spacing() is used to set the universal minimum spacing between the child widgets, in pixels. The default setting is 0. GtkBox::reorder_child void reorder_child( GtkWidget child , int position); reorder_child() moves the child's position in the children array to the position given as the second parameter. GtkBox::set_child_packing void set_child_packing( GtkWidget child , bool expand, bool fill, int padding, GtkPackType pack_type ); set_child_packing() sets the GtkBoxChild parameters for the child widget. GtkBox::query_child_packing array query_child_packing( GtkWidget child ); query_child_packing() is a way to query the GtkBoxChild parameters expand, fill, padding and pack_type for an individual child widget. GtkBox::children Access: Read Only Type: array The packing information for the individual child widgets is stored in children as an array of GtkBoxChild objects. GtkBox::spacing Access: Read Only Type: int The spacing property represents the minimum amount of space between the child widgets, in pixels. This setting is universal across the box container.

To set the spacing for an individual child widget, use pack_start() , pack_end() , set_child_packing() , or the padding property in GtkBoxChild. GtkBox::homogeneous Access: Read Only Type: bool The homogeneous property is a boolean value which, when set to true, will make all child widgets in the container the same size as the largest child. Use set_homogeneous() to set the value. Note that the value of this property only affects one dimension, as the children will always fit the height of a row, or the width of a column, regardless of settings. GtkBoxChild Helper class for GtkBox. Hierarquia do Objeto GtkBoxChild Direct subclasses None. Descrio GtkBox is a base class providing box container widgets with properties and methods related to packing multiple child widgets. GtkBoxChild is a helper class that allows access to the widget and packing information for each individual child. The children property in GtkBox is an array of GtkBoxChild objects corresponding to packed child widgets. Note that neither GtkBox nor GtkBoxChild can be constructed directly. Propriedades widget: Child widget. padding: Child padding. expand:

Child expand toggle. fill: Child fill toggle. pack: Child packing type. GtkBoxChild::widget Access: Read Only Type: GtkWidget The widget property provides access to the child widget object. It is possible to access methods, properties and signals belonging to widget as with any GtkWidget of the same type. <?php $button = $vbox->children[5]->widget; $label = $button->child; $label->set_text("New Button Label"); ?> GtkBoxChild::padding Access: Read Only Type: int The padding property is an integer showing the padding around the widget, in pixels. The default setting for padding is 0. GtkBoxChild::expand Access: Read Only Type: bool The expand property is a boolean value describing whether or not the space around the widget should be allowed to expand when the parent container is resized. The child widget is centered within its available space. The default setting for expand is true. GtkBoxChild::fill Access: Read Only Type: bool The fill property is a boolean value describing whether or not the

widget should be allowed to fill the space available to it. Where the expand property is false and the fill property is true, the child widget is positioned as close as its padding will allow to that edge of its available space determined by its pack value. GtkBoxChild::pack Access: Read Only Type: GtkPackType The pack property is a GtkPackType enum indicating where the child widget is packed in reference to the parent widget - start or end. GtkButton A container widget that emits a signal when clicked on. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkButton Direct subclasses GtkOptionMenu, GtkToggleButton Descrio The GtkButton widget is a container widget that can hold any valid child widget derived from GtkWidget. The most commonly used child widget is a GtkLabel. This is therefore built into the constructor as an optional parameter. The GtkButton widget is mainly used to call some function when the button is pressed. To change the label after the button is created, you can use the children() function of the container class: //$obj is the button object $childs = $obj->children(); $childs[0]->set_text('new button title'); Construtor GtkButton ([string label ]); -- Creates a button. Mtodos

pressed() Emits "pressed" signal. released() Emits "released" signal. clicked() Emits "clicked" signal. enter() Emits "enter" signal. leave() Emits "leave" signal. set_relief() Sets the button relief style. get_relief() Gets the button relief style. Sinais "enter" Emitted when the cursor is over the button. "pressed" Emitted when the button is initially pressed. "clicked" Emitted when the button is clicked. "released" Emitted when the button is released. "leave" Emitted when the cursor leaves the button area. GtkButton Construtor GtkButton ([string label ]); This function creates and returns a GtkButton widget. If the optional label is passed, the button will contain a GtkLabel widget with the given text. If the parameter is left empty, there will be no child widget. Note that, as GtkButton is descended from GtkBin, it may contain only one child. Exemplo 4. Adding more than one widget to a GtkButton <?php

dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); $window = &new GtkWindow(GTK_WINDOW_DIALOG); $window->set_position(GTK_WIN_POS_MOUSE); $window->connect_object('destroy', array('gtk', 'main_quit')); $window->realize(); list ($gdkpixmap, $mask) = gdk::pixmap_create_from_xpm($window->window, null, "test.xpm"); $pixmap = &new GtkPixmap($gdkpixmap, $mask); $label = &new GtkLabel("Open"); $vbox = &new GtkVBox(); $vbox->pack_start($pixmap); $vbox->pack_start($label); $button = &new GtkButton(); $button->add($vbox); $vbox->show_all(); $window->add($button); $window->show_all(); gtk::main(); ?> GtkButton::pressed void pressed(void); Makes the button emit the "pressed" signal. GtkButton::released void released(void); Makes the button emit the "released" signal. GtkButton::clicked void clicked(void); Makes the button emit the "clicked" signal. GtkButton::enter void enter(void); Makes the button emit the "enter" signal. GtkButton::leave

void leave(void); Makes the button emit the "leave" signal. GtkButton::set_relief void set_relief( GtkReliefStyle newstyle ); Sets the relief style of the button widget edges using one of the three GtkReliefStyle settings. The default relief style is GTK_RELIEF_NORMAL. GtkButton::get_relief GtkReliefStyle get_relief (void); Returns the current GtkReliefStyle setting for the button. enter The "enter" signal is emitted when the cursor enters the area of the screen where the button is positioned. Funo Callback void callback(GtkButton button); pressed The "pressed" signal is emitted when the user presses down the mouse-button and the cursor is over the widget. Funo Callback void callback(GtkButton button); clicked The "clicked" signal is emitted at the midpoint between pressing and releasing the mouse-button. This is the most commonly used GtkButton signal, and holds an advantage over the other signals listed here in that it also responds to enter or spacebar keypresses as though they were mouse-clicks. Signals that have this property are wrappers for an internal GtkWidget signal named 'activate_signal'; all interactive widgets contain one such method/signal pair, with appropriate keyboard bindings. Note that the "clicked" signal will not fire when the mouse-button is released after the cursor has left the widget's region. The activate type of signals are by nature region-specific. Use one of the connect() methods in order to emit the signal and connect it to your function. The connected function is known as the callback or signal-handler function:

Exemplo 5. Making a simple connection <?php dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); function my_function() { echo "The button was clicked\n"; } $window = &new GtkWindow(); $window->set_position(GTK_WIN_POS_MOUSE); $window->connect_object('destroy', array('gtk', 'main_quit')); $button = &new GtkButton("Click Me"); $button->connect('clicked', 'my_function'); $window->add($button); $window->show_all(); gtk::main(); ?> For further information about connecting signals, refer to the Signals and Callbacks chapter in the PHP-GTK Userguide. Funo Callback void callback(GtkButton button); released The "released" signal is emitted when the user releases the mouse-button, regardless of the cursor position. Funo Callback void callback(GtkButton button); leave The "leave" signal is emitted when the cursor leaves the area of the screen where the button is positioned. Funo Callback void callback(GtkButton button); GtkButtonBox Base class for GtkHButtonBox and GtkVButtonBox. Hierarquia do Objeto

GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBox `-- GtkButtonBox Direct subclasses GtkHButtonBox, GtkVButtonBox Descrio GtkButtonBox is a base class providing a series of layout options for buttons packed into GtkHButtonBox and GtkVButtonBox container widgets. Please note that in GTK+ 2.0 all reference to spacing will be completely removed; this is because these values are always relative in GtkButtonBox classes, and should be adjusted internally. Mtodos get_spacing() Returns spacing between buttons. *deprecated in GTK2* get_layout() Retrieves the layout style setting. set_spacing() Sets spacing between buttons. *deprecated in GTK2* set_layout() Sets the button layout style. set_child_size() Sets minimum child size. *deprecated in GTK2* set_child_ipadding() Sets child's internal padding. *deprecated in GTK2* GtkButtonBox::get_spacing int get_spacing(void); get_spacing() returns the integer value representing the spacing in pixels between the buttons contained in a GtkButtonBox. Note that this method is deprecated in GTK+ 2.0 and should not be used where forward compatibility is an issue. GtkButtonBox::get_layout GtkButtonBoxStyle get_layout (void);

get_layout() retrieves the current GtkButtonBoxStyle setting. GtkButtonBox::set_spacing void set_spacing(int spacing); set_spacing() sets the spacing between the buttons, in pixels. See also gtk::hbutton_box_set_spacing_default() or gtk::vbutton_box_set_spacing_default() to set the spacing default across an entire application. If you don't change it, the default setting is currently 10 pixels for GtkVButtonBox, or 30 for GtkHButtonBox. Note that this method is deprecated in GTK+ 2.0. Where forward compatibility is an issue, use set_layout() instead. GtkButtonBox::set_layout void set_layout( GtkButtonBoxStyle layout_style ); set_layout() sets the spacing arrangement of the buttons in accordance with one of the five GtkButtonBoxStyle settings. The default setting is always the GTK_BUTTONBOX_DEFAULT_STYLE, which is itself pre-set to GTK_BUTTONBOX_EDGE. This can be reset for an entire application by using gtk::hbutton_box_set_layout_default() or gtk::vbutton_box_set_layout_default() . GtkButtonBox::set_child_size void set_child_size(int min_width, int min_height); set_child_size() sets the minimum size for any child in the GtkButtonBox widget, in pixels. The default setting is (85, 27). Note that this method is deprecated, and that minimum sizing will be set internally in future versions of GTK+. GtkButtonBox::set_child_ipadding void set_child_ipadding(int ipad_x, int ipad_y); set_child_ipadding() sets the amount to increase the width and height of the space requested by the buttons. The default settings are currently (7, 0). Note that this method is deprecated, and that internal padding will be set by the widget itself in future versions of GTK+. GtkCalendar

A calendar offering dates that can be selected and marked. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkCalendar Direct subclasses None. Descrio A GtkCalendar is a widget consisting of a grid container displaying a calendar, with an optional label allowing month/year navigation and an optional header giving abbreviated day names. Both the day and the month names are supplied by the system locale, and cannot be overwritten. Unfortunately, under win32 there are severe problems with internationalization in the GDK source currently used by PHP-GTK. Non-standard ISO8859-1/2 characters cannot be drawn in this widget as a result of a wide character conversion failure under Windows. Multibyte characters are not recognised, and as they are supplied directly by the system to the widget there is no option to convert them using PHP. This issue is gradually being addressed by the PHP-GTK development team on a widget-by-widget basis. Assuming that your locale and your operating system will allow you to use this widget's headers, the only other point to keep in mind is that a marked date is differentiated from the other dates by being drawn on a slightly bigger base rectangle, making it appear bold while actually using the same font as the rest of the widget. This is less effective in some fonts than in others, and can become a very negligable distinction. Construtor GtkCalendar (void); -- Creates a calendar widget. Mtodos select_month() Determines the month and year displayed. select_day() Determines the selected day. mark_day() Marks the given day.

unmark_day() Unmarks the given day, if marked. clear_marks() Clears all marked dates. display_options() Sets flags determining the appearance of the calendar. get_date() Returns currently selected date. freeze() Freezes the display to allow updates. thaw() Thaws the display following updates. Sinais "month-changed" Emitted whenever the displayed month is changed. "day-selected" Emitted when a day is selected. "day-selected-double-click" Emitted when the mouse is clicked twice on a day. "prev-month" Emitted when user chooses to go back one month. "next-month" Emitted when user chooses to go forward one month. "prev-year" Emitted when user chooses to go back one year. "next-year" Emitted when user chooses to go forward one year. Propriedades month: Currently selected month. year: Currently selected year. selected_day: Currently selected day. num_marked_dates:

Number of marked dates held. marked_date: Array of marked dates. GtkCalendar Construtor GtkCalendar (void); Creates a calendar widget, set to display the current month and year. Exemplo 6. Changing the style of a GtkCalendar <?php dl("php_gtk." . (strstr(PHP_OS, "WIN") ? "dll" : "so")); $window = &new GtkWindow(); $window->set_position(GTK_WIN_POS_CENTER); $window->connect_object("destroy", array("gtk", "main_quit")); /* create the calendar and add it to the window. */ $calendar = &new GtkCalendar(); $window->add($calendar); /* create a new style for the calendar, based on the old one */ $oldstyle = $calendar->style; $newstyle = $oldstyle->copy(); $font = gdk::font_load('-unknown-Arial-normal-r-normal--*-160-*-*-p-0-iso8859-1'); $red = &new GdkColor(255*255, 0, 0); $newstyle->font = $font; $newstyle->fg[GTK_STATE_SELECTED] = $red; $calendar->set_style($newstyle); /* have today's date highlighted on opening */ $calendar->select_day(date('d')); $window->show_all(); gtk::main(); ?> GtkCalendar::select_month int select_month(int month, int year); This method determines the month and year displayed on opening. The default setting is the current month and year, taken from the operating system. If the display option flag GTK_CALENDAR_NO_MONTH_CHANGE is set, the

user will be unable to switch from the month and year passed as parameters. Note that the month must be in the range 0 to 11, similar to PHP's date('m'). The year is in 4-digit format, as in 2002 the format returned by date('Y'). GtkCalendar::select_day void select_day(int day); select_day() specifies the day number that will be selected (i.e. highlighted). Note that if there are no further instructions, the same day will be highlighted throughout the months and years in the calendar. The default selected day is 1, with the range being 1 to 31. Selecting an impossible day within that range - e.g. February 30th - does not return an error message, as the day number is not associated with the month and year information in this method. GtkCalendar::mark_day int mark_day(int day); Switches the appropriate marked_date to true and marks the day number by making it appear bold. If no further instructions are given, the same day number will be marked throughout the calendar. There is no limit to the number of marked days in a month. There is also no limit to the range. GtkCalendar::unmark_day int unmark_day(int day); Switches the appropriate marked_date to false, if it is true, and unmarks the day. If the day was not marked, this method has no effect whatever. GtkCalendar::clear_marks void clear_marks(void); Given that marked dates are identical on every calendar page, you will probably need to clear them and set a new bunch of marked dates when the month is changed. These are best stored in a file or files, e.g. <?php function new_month($calendar) { $calendar->clear_marks(); $selected = $calendar->get_date();

$month = ($selected[1]+1); $year = $selected[0]; if(file_exists("diary/$year/marked_dates_$month.txt")) { $dates = fopen("diary/$year/marked_dates_$month.txt", 'r'); $string = explode(',', fgets($dates)); $calendar->freeze(); for($i = 0; $i < 31; $i++) { if($string[$i]==true) $calendar->mark_day($i+1); } $calendar->thaw(); fclose($dates); } } $calendar->connect('month-changed', 'new_month'); ?> GtkCalendar::display_options void display_options( GtkCalendarDisplayOptions flags ); Use display_options() to choose which elements of the calendar should be displayed via GtkCalendarDisplayOptions. The default setting is GTK_CALENDAR_SHOW_HEADING | GTK_CALENDAR_SHOW_DAY_NAMES. GtkCalendar::get_date array get_date(void); get_date() returns the currently selected calendar date as an array. The contents are the year (e.g. 2002), the month (1 - 12), and the day (1 - 31), in that order. The range for the month is 1 - 12 here, but 0 - 11 in the select_month() method. Marked dates also run from 0. Beware! GtkCalendar::freeze void freeze(void); freeze() is used to prevent the screen flickering during an update as each string in the monthly array is evaluated and redrawn. Place it before an update loop. See also: thaw() . GtkCalendar::thaw void thaw(void);

thaw() is the corollary to freeze() , and is placed after an update routine. month-changed The "month-changed" signal is emitted whenever the month on display changes, regardless of the way in which this is achieved. As the month and year information are tied, January 2002 is not the same month as January 2003 - the signal will be fired for a year change, too. Funo Callback void callback(GtkCalendar calendar); day-selected The "day-selected" signal is emitted when a day has been selected, regardless of the way in which this is achieved. Funo Callback void callback(GtkCalendar calendar); day-selected-double-click The "day-selected-double-click" signal is fired when the user clicks the mouse on a day number twice in quick succession. Funo Callback void callback(GtkCalendar calendar); prev-month The "prev-month" signal is emitted when the user either clicks on the month arrow back, or when the user selects a greyed-out day from the previous month. It cannot be emitted through the program itself; use "month-changed" if you need to do this. Funo Callback void callback(GtkCalendar calendar); next-month The "next-month" signal is emitted when the user either clicks on the month arrow forward, or when the user selects a greyed-out day from the following month. It cannot be emitted through the program itself; use "month-changed" if you need to do this. Funo Callback void callback(GtkCalendar calendar);

prev-year The "prev-year" signal is emitted when the user either clicks on the year arrow back, or when the user selects a greyed-out day from the previous December when January is currently displayed. It cannot be emitted through the program itself; use "month-changed" if you need to do this. Funo Callback void callback(GtkCalendar calendar); next-year The "next-year" signal is emitted when the user either clicks on the year arrow forward, or when the user selects a greyed-out day from the following January when December is currently displayed. It cannot be emitted through the program itself; use "month-changed" if you need to do this. Funo Callback void callback(GtkCalendar calendar); GtkCalendar::month Access: Read Only Type: int The month property is an integer representing the currently selected month. This will be in the range 0 - 11. GtkCalendar::year Access: Read Only Type: int The year property is an integer representing the currently selected year. This is in the 4-digit format, i.e. 2002. GtkCalendar::selected_day Access: Read Only Type: int The selected_day property is an integer representing the currently selected day. This will be in the range 1 - 31. GtkCalendar::num_marked_dates Access: Read Only Type: int

The num_marked_dates property is an integer representing the number of marked dates set to true in the current marked_date array. If you are using GtkCalendar fully, you are likely to have several of these arrays - one for each month, at a minimum. This property is tied to the array. GtkCalendar::marked_date Access: Read Only Type: array The marked_date property is an array of 31 comma-separated values, all of which are either the default false or, if marked, true. The array count begins at zero, whereas the days in the calendar begins at 1. You will need to add 1 to an integer representing the position of a marked date, to compensate for this mismatch. GtkCheckButton Button that displays a discrete toggle indicator. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkButton `-- GtkToggleButton `-- GtkCheckButton Direct subclasses GtkRadioButton Descrio The GtkCheckButton widget is basically a different style of GtkToggleButton. Instead of the entire button acting as the toggle indicator, a small button to the left of the text position appears 'pressed in' when the toggle is in the GTK_STATE_ACTIVE state. See also: GtkRadioButton, GtkStateType, GtkToggleButton. Construtor GtkCheckButton ([string label ]); -- Creates a button with a small toggle indicator. GtkCheckButton Construtor GtkCheckButton ([string label ]);

$checkbutton = &new GtkCheckButton("GtkCheckButton label"); instantiates a normal-sized GtkButton with a small draw_indicator toggle to the left of the button's label area. The indicator displays the GtkShadowType GTK_SHADOW_IN when the check button's GtkStateType is set as GTK_STATE_ACTIVE. See also: GtkButton, GtkCheckMenuItem, GtkToggleButton. GtkCheckMenuItem Menu item with a toggle indicator. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkItem `-- GtkMenuItem `-- GtkCheckMenuItem Direct subclasses GtkRadioMenuItem Descrio A GtkCheckMenuItem is a normal GtkMenuItem that contains a toggle indicator positioned to the left of any GtkAccelLabel text. The indicator does not necessarily have to be displayed during the time that the menu item is set to its inactive state, but is always displayed when the state is set as active. Construtor GtkCheckMenuItem ([string label ]); -- Creates a GtkMenuItem with a toggle indicator. Mtodos set_active() Toggles the active state. set_show_toggle() Determines whether toggle indicator should be displayed. toggled() Emits the "toggled" signal. Sinais

"toggled" Emitted when the toggled() method is called. Propriedades active: 'Active' toggle. GtkCheckMenuItem Construtor GtkCheckMenuItem ([string label ]); $checkmenuitem = &new GtkCheckMenuItem("CheckMenuItem's Label"); is the syntax that will create a new menu item with an indigenous toggle indicator placed to the left of any existing text. The GtkCheckMenuItem may be set to the active state - GtkStateType GTK_STATE_ACTIVE - or to the inactive state, GTK_STATE_NORMAL. When it is in the inactive state, the toggle indicator need not be displayed. GtkCheckMenuItem::set_active void set_active(bool is_active); set_active() sets the state of the calling GtkCheckMenuItem to either the GTK_STATE_ACTIVE or the GTK_STATE_NORMAL GtkStateType. When the menu item is in its active state, the toggle indicator is always displayed. $checkmenuitem->set_active(true); will set the GtkCheckMenuItem's state to active. The default setting is false. GtkCheckMenuItem::set_show_toggle void set_show_toggle(bool always); set_show_toggle() determines whether the toggle indicator should be visible at all times, or only when the menu item is active. The default setting is false. GtkCheckMenuItem::toggled void toggled(void); toggled() causes the calling GtkCheckMenuItem to emit the "toggled" signal. toggled The "toggled" signal is emitted when the toggled() method is called.

This is called internally when the GtkCheckMenuItem's "activate" signal is emitted - that is, when a user clicks on the menu item or presses the Enter or Space key while the item is selected. The signal is also emitted when calling the set_active() method. Note that the state-switching triggered by activation is not directly related to the "toggled" signal. Funo Callback void callback( GtkCheckMenuItem checkmenuitem ); GtkCheckMenuItem::active Access: Read Only Type: bool The active property provides a means of testing whether the GtkCheckMenuItem is currently in the active state - in which case the returned value will be true - or otherwise. <?php $active_state = $checkmenuitem->active; if($active_state == 1) echo "This GtkCheckMenuItem is active\n"; ?> GtkCList A multi-columned scrolling list widget. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkCList Direct subclasses GtkCTree Descrio A GtkCList allows you to display tabular data in rows, divided into multiple columns. Note that is it not possible to create new columns after the widget has been instantiated. A workaround is to create a number of columns and hide the ones you don't need. GtkCList has been deprecated since GTK+ 2.0 and should not be used in newly written code.

Construtor GtkCList (int columns, Array titles]); -- Creates a new GtkCList object Mtodos set_hadjustment() Allows you to set the GtkAdjustment to be used for the horizontal aspect of the GtkCList widget. set_vadjustment() Allows you to set the GtkAdjustment to be used for the vertical aspect of the GtkCList widget. get_hadjustment() Gets the GtkAdjustment currently being used for the horizontal aspect. get_vadjustment() Gets the GtkAdjustment currently being used for the vertical aspect. set_shadow_type() Set the outer border (shadow) of the widget set_selection_mode() Sets the selection mode for the specified CList. set_reorderable() Sets whether the CList's rows are re-orderable using drag-and-drop. set_use_drag_icons() Determines whether the GtkCList should use icons when doing drag-and-drop operations. set_button_actions() Sets the action(s) that the specified mouse button will have on the list. freeze() Causes the GtkCList to stop updating its visuals. thaw() Causes the specified GtkCList to allow visual updates. column_titles_show() Makes the column titles visible. column_titles_hide() Hides the column titles. column_title_active()

Sets the specified column to become selectable. column_title_passive() Causes the specified column title button to not respond to events. column_titles_active() Causes all column title buttons to become active. column_titles_passive() Causes all column title buttons to become passive. set_column_title() Set the title of the specified column. get_column_title() Returns the title of the specified column. set_column_widget() Sets a widget to be used as the specified column's title. get_column_widget() Returns the custom widget for the given column. set_column_justification() Sets the justification to be used for all text in the specified column. set_column_visibility() Allows you to set whether a specified column in the GtkCList should be hidden or shown. set_column_resizeable() Lets you specify whether a specified column should be resizeable by the user. set_column_auto_resize() Lets you specify whether a column should be automatically resized by the widget when data is added or removed. columns_autosize() Auto-sizes all columns in the CList and returns the total width of the CList. optimal_column_width() Gets the required width in pixels that is needed to show everything in the specified column. set_column_width() Causes the column specified to be set to a specified width. set_column_min_width() Causes the column specified to have a minimum width. set_column_max_width()

Causes the column specified to have a maximum width. set_row_height() Causes the GtkCList to have a specified height for its rows. moveto() Tells the CList widget to visually move to the specified row and column. row_is_visible() Checks how the specified row is visible. get_cell_type() Checks the type of cell at the location specified. set_text() Sets the displayed text in the specified cell. get_text() Gets the text for the specified cell. set_pixmap() Sets a pixmap for the specified cell. set_pixtext() Sets text and a pixmap/bitmap on the specified cell. set_foreground() Sets the foreground color for the specified row. set_background() Sets the background color for the specified row. set_cell_style() Sets the style for the specified cell. get_cell_style() Gets the current style of the specified cell. set_row_style() Sets the style for all cells in the specified row. get_row_style() Gets the style set for the specified row. set_shift() Sets the vertical and horizontal shift of the specified cell. set_selectable() Sets whether the specified row is selectable or not. get_selectable() Gets whether the specified row is selectable or not.

prepend() Adds a row to the list at the top. append() Adds a row to the list at the bottom. insert() Adds a row of text to the list at the specified position. remove() Removes the specified row from the list. select_row() Selects the specified row. unselect_row() Unselects the specified row. undo_selection() Undoes the last selection for an "extended selection mode" list. clear() Removes all the rows. select_all() Selects all rows in the CList. unselect_all() Unselects all rows in the list. swap_rows() Swaps the two specified rows with each other. row_move() Allows you to move a row from one position to another in the list. set_sort_column() Sets the sort column of the clist. set_sort_type() Sets the sort type of the GtkClist. sort() Sorts the list. set_auto_sort() Turns on or off auto sort of the GtkCList. Sinais "select-row" This signal is emitted when the user selects a row in the list. "unselect-row"

This signal is emitted when the user unselects a row in the list. "row-move" This signal is emitted when a row is moved. "click-column" This signal is emitted when a column title is clicked. "resize-column" This signal is emitted when a column is resized. Propriedades focus_row: Number of the row having the focus. rows: Returns the number of rows. row_list: Returns all rows in the list. selection: Array of selected rows. selection_mode: Returns the current selection mode. sort_column: The current row after which the list shall be sorted. sort_type: The current sort type (order). GtkCList Construtor GtkCList (int columns, Array titles]); Creates a new GtkCList object with the given number of columns. The optional second parameter is an array of strings which are uses as column titles. The columns can be resized with the set_column_width function. <?php if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); } $win = &new GtkWindow(); $win->set_default_size(200,300); $win->connect('destroy', 'destroy'); function destroy() { Gtk::main_quit();

} $arStatistics = array( array( 'Paris', 9.1), array( 'Moscow', 9.0), array( 'London', 6.8), array( 'Rome', 3.8), array( 'Berlin', 3.4), array( 'Athena', 3.0) ); $scrolled_win = &new GtkScrolledWindow(); $scrolled_win->set_policy( GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); $list = &new GtkCList( 2, array( "City", "Inhabitants (M)")); foreach( $arStatistics as $arStat) { $list->insert( 0, $arStat); } $list->set_column_width( 0, 90); $scrolled_win->add( $list); $win->add( $scrolled_win); $win->show_all(); GTK::main(); ?> The numbering of a position parameter for a column or row starts at 0. GtkCList::set_hadjustment void set_hadjustment(GtkAdjustment adjustment); Allows you to set the GtkAdjustment to be used for the horizontal aspect of the GtkCList widget. GtkCList::set_vadjustment void set_vadjustment(GtkAdjustment adjustment); Allows you to set the GtkAdjustment to be used for the vertical aspect of the GtkCList widget. GtkCList::get_hadjustment GtkAdjustment get_hadjustment(void); Gets the GtkAdjustment currently being used for the horizontal aspect. GtkCList::get_vadjustment GtkAdjustment get_vadjustment(void);

Gets the GtkAdjustment currently being used for the vertical aspect. GtkCList::set_shadow_type void set_shadow_type(GtkShadowType type); Set the outer border (shadow) of the widget. The whole widget is surrounded with a special border, which can look flat, inset or outset. You can best see the effect when you add the following lines to the example given in the constructor: $scrolled_win->set_border_width( 10); $list->set_shadow_type( GTK_SHADOW_ETCHED_OUT); GtkCList::set_selection_mode void set_selection_mode(GtkSelectionMode mode); Sets the selection mode for the specified CList. This allows you to set whether only one or more than one item can be selected at a time in the widget. Note that setting the widget's selection mode to one of GTK_SELECTION_BROWSE or GTK_SELECTION_SINGLE will cause all the items in the GtkCList to become deselected. GtkCList::set_reorderable void set_reorderable(bool reorderable); Sets whether the CList's rows are re-orderable using drag-and-drop. If it is set to true, the user can select one with the mouse, hold the left mouse button and move it to another position in the list. The row-move signal is emmited when the user did so. GtkCList::set_use_drag_icons void set_use_drag_icons(bool use_icons); Determines whether the GtkCList should use icons when doing drag-and-drop operations. In every case the cursor is changed when moving a selected row. The difference is, that a standard cursor is used when the value is set to false, and an icon if it is true. The icon looks nicer, but causes ugly effects sometimes (UI not fully redrawn). GtkCList::set_button_actions void set_button_actions(int button, GtkButtonAction button_actions); Sets the action(s) that the specified mouse button will have on the list. The button_actions can be one or several, logically OR'ed actions.

GtkCList::freeze void freeze(void); Causes the GtkCList to stop updating its visuals until a matching call to thaw is made. This function is useful if a lot of changes will be made to the widget that may cause a lot of visual updating to occur. Note that calls to gtk_clist_freeze() can be nested. GtkCList::thaw void thaw(void); Causes the specified GtkCList to allow visual updates which were stopped with freeze. GtkCList::column_titles_show void column_titles_show(void); Makes the column titles visible. GtkCList::column_titles_hide void column_titles_hide(void); Hides the column titles. GtkCList::column_title_active void column_title_active(int column); Sets the specified column in the GtkCList to become selectable. You can then respond to events from the user clicking on a title button, and take appropriate action. You can make all columns titles active by using column_titles_active. GtkCList::column_title_passive void column_title_passive(int column); Causes the specified column title button to become passive, i.e., does not respond to events, such as the user clicking on it. You can make all columns titles passive by using column_titles_passive. GtkCList::column_titles_active void column_titles_active(void); Causes all column title buttons to become active. The same as calling

column_title_active for each single column. GtkCList::column_titles_passive void column_titles_passive(void); Causes all column title buttons to become passive. The same as calling column_title_passive for each single column. GtkCList::set_column_title void set_column_title(int column, string title); Set the title of the specified column. GtkCList::get_column_title string get_column_title(int column); Returns the title of the specified column. GtkCList::set_column_widget void set_column_widget(int column, GtkWidget widget); Sets a widget to be used as the specified column's title. This can be used to place a pixmap or something else as the column title, instead of the standard text. Exemplo 7. Using a custom widget in title of a GtkCList <?php if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); } $win = &new GtkWindow(); $win->set_default_size(250,250); $win->connect('destroy', 'destroy'); function destroy() { Gtk::main_quit(); } $arStatistics = array( array( 'Paris', 9.1), array( 'Moscow', 9.0), array( 'London', 6.8), array( 'Rome', 3.8), array( 'Berlin', 3.4), array( 'Athena', 3.0) ); $scrolled_win = &new GtkScrolledWindow(); $scrolled_win->set_policy( GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

$list = &new GtkCList( 2, array( "City", "Inhabitants")); foreach( $arStatistics as $arStat) { $list->insert( 0, $arStat); } $list->set_column_width( 0, 90); $list->set_selection_mode( GTK_SELECTION_MULTIPLE); function mnuActivated( $mnuItem, $strLabel) { global $list; $chShow = $strLabel[0]; for( $nA = 0; $nA < count( $list->row_list); $nA++) { $nSize = $list->get_text( $nA, 1); if( $chShow == 'A' || ( $chShow == '<' && $nSize < 5) || ( $chShow == '>' && $nSize >= 5)) { $list->select_row( $nA, 0); } else { $list->unselect_row( $nA, 0); } } } $arMenus = array( 'All', '> 5 million', '< 5 million', 'none'); $mnuSizes = &new GtkMenu(); foreach( $arMenus as $strLabel) { $mnu = &new GtkMenuItem( $strLabel); $mnu->connect( 'activate', 'mnuactivated', $strLabel); $mnuSizes->append( $mnu); } $mnuSizes->show_all(); $om = &new GtkOptionMenu(); $om->set_menu( $mnuSizes); $list->set_column_widget( 1, $om); $scrolled_win->add( $list); $win->add( $scrolled_win); $win->show_all(); GTK::main(); ?> GtkCList::get_column_widget GtkWidget get_column_widget(int column); Returns the custom widget for the given column. GtkCList::set_column_justification

void set_column_justification(int column, GtkJustification justification); Sets the justification to be used for all text in the specified column. GtkCList::set_column_visibility void set_column_visibility(int column, bool visible); Allows you to set whether a specified column in the GtkCList should be hidden or shown. At least one column must always be showing, so attempting to hide the last visible column will be ignored. GtkCList::set_column_resizeable void set_column_resizeable(int column, bool resizeable); Lets you specify whether a specified column should be resizeable by the user. Note that turning on resizeability for the column will automatically shut off auto-resizing, but turning off resizeability will NOT turn on auto-resizing. This must be done manually via a call to set_column_auto_resize. GtkCList::set_column_auto_resize void set_column_auto_resize(int column, bool auto_resize); Lets you specify whether a column should be automatically resized by the widget when data is added or removed. Enabling auto-resize on a column explicity disallows user-resizing of the column. GtkCList::columns_autosize int columns_autosize(void); Auto-sizes all columns in the GtkCList and returns the total width of the CList. GtkCList::optimal_column_width int optimal_column_width(int column); Gets the required width in pixels that is needed to show everything in the specified column. GtkCList::set_column_width void set_column_width(int column, int width); Causes the column specified for the GtkCList to be set to a specified width.

GtkCList::set_column_min_width void set_column_min_width(int column, int min_width); Causes the column specified to have a minimum width, preventing the user from resizing it smaller than that specified. GtkCList::set_column_max_width void set_column_max_width(int column, int max_width); Causes the column specified to have a maximum width, preventing the user from resizing it larger than that specified. GtkCList::set_row_height void set_row_height(int height); Causes the GtkCList to have a specified height for its rows. Setting the row height to 0 allows the GtkCList to adjust automatically to data in the row. GtkCList::moveto void moveto(int row, int column, double row_align, double col_align); Tells the CList widget to visually move to the specified row and column. FIXME: Example GtkCList::row_is_visible GtkVisibility row_is_visible(int row); Checks how the specified row is visible. GtkCList::get_cell_type GtkCellType get_cell_type(int row, int column); Checks the type of cell at the location specified. GtkCList::set_text void set_text(int row, int column, string text); Sets the displayed text in the specified cell. GtkCList::get_text String get_text(int row, int column);

Gets the text for the specified cell. GtkCList::set_pixmap void set_pixmap(int row, int column, GdkPixmap pixmap, GdkBitmap mask); Sets a pixmap for the specified cell. Note that the normal text is not visible anymore, you have to use set_pixtext instead. GtkCList::set_pixtext void set_pixtext(int row, int column, string text, int spacing, GdkPixmap pixmap, GdkBitmap mask); Sets text and a pixmap/bitmap on the specified cell. The spacing parameter is the space between the picture and the pixtext. GtkCList::set_foreground void set_foreground(int row, GdkColor color); Sets the foreground color for the specified row. GtkCList::set_background void set_background(int row, GdkColor color); Sets the background color for the specified row. GtkCList::set_cell_style void set_cell_style(int row, int column, GtkStyle style); Sets the style for the specified cell. GtkCList::get_cell_style GtkStyle get_cell_style(int row, int column); Gets the current style of the specified cell. GtkCList::set_row_style void set_row_style(int row, GtkStyle style); Sets the style for all cells in the specified row. GtkCList::get_row_style GtkStyle get_row_style(int row);

Gets the style set for the specified row. GtkCList::set_shift void set_shift(int row, int column, int vertical, int horizontal); Sets the vertical and horizontal shift of the specified cell. GtkCList::set_selectable void set_selectable(int row, bool selectable); Sets whether the specified row is selectable or not. This is useful if you want to separate rows from each other to e.g. categorize them. You should also set the background color so that the user can distinguish between selectable and not selectable cells. GtkCList::get_selectable bool get_selectable(int row); Gets whether the specified row is selectable or not. GtkCList::prepend void prepend(Array text); Adds a row to the list at the top. The parameter is an array of strings, one for each column. GtkCList::append int append(Array text); Adds a row to the list at the bottom. The parameter is an array of strings, one for each column. GtkCList::insert void insert(int row, Array text); Adds a row of text to the list at the specified position. The parameter is an array of strings, one for each column. GtkCList::remove void remove(int row); Removes the specified row from the list. GtkCList::select_row void select_row(int row, int column);

Selects the specified row. Causes the "select-row" signal to be emitted for the specified row and column. GtkCList::unselect_row void unselect_row(int row, int column); Unselects the specified row. Causes the "unselect-row" signal to be emitted for the specified row and column. GtkCList::undo_selection void undo_selection(void); Undoes the last selection for an "extended selection mode" list. GtkCList::clear void clear(void); Removes all the rows from the list. GtkCList::select_all void select_all(void); Selects all rows in the CList. This function has no affect for a list in "single" or "browse" selection mode. GtkCList::unselect_all void unselect_all(void); Unselects all rows in the list. GtkCList::swap_rows void swap_rows(int row1, int row2); Swaps the two specified rows with each other. GtkCList::row_move void row_move(int source_row, int dest_row); Allows you to move a row from one position to another in the list. GtkCList::set_sort_column void set_sort_column(int column); Sets the sort column of the clist. The sort column is used by the default compare function to determine which column to sortby.

GtkCList::set_sort_type void set_sort_type(GtkSortType sort_type); Sets the sort type (direction) of the GtkClist. This is either GTK_SORT_ASCENDING for ascening sort or GTK_SORT_DESCENDING for descending sort. It can be read via the sort_type property. GtkCList::sort void sort(void); Sorts the GtkClist according to the settings of sort column and sort type. The sort function knows to distinguish between normal text and pixtext, so that a mixture of normal and pixtext will be sorted right. The items are handled as text when being compared, so numbers will be not in a "natural" order. Here is an example how to let the user sort the list by columns when he clicks on a column title. The sort order (type) is changed everytime he clicks on the same column title. Exemplo 8. Sorting GtkCList rows by clicking the title function sortList( $objList, $nColumn) { if( $nColumn != $objList->sort_column ) { $objList->set_sort_column( $nColumn); $objList->set_sort_type( GTK_SORT_ASCENDING); } else { if( $objList->sort_type == GTK_SORT_ASCENDING) { $objList->set_sort_type( GTK_SORT_DESCENDING); } else { $objList->set_sort_type( GTK_SORT_ASCENDING); } } $objList->sort(); } $objList->connect( 'click-column', 'sortList'); GtkCList::set_auto_sort void set_auto_sort(bool auto_sort); Turns on or off auto sort of the GtkCList. If auto sort is on, then the list will be resorted when a row is inserted into the list. select-row This signal is emitted when the user selects a row in the list. It is emitted for every row that is selected in a multi-selection or by calling select_all.

Funo Callback void callback(GtkCList widget, int row, int column, GdkEvent event); unselect-row This signal is emitted when the user unselects a row in the list. It is emitted for every row that is unselected in a multi-selection or by calling unselect_all. It is also emitted for the previously selected row in a "single" or "browse" mode GtkCList. Funo Callback void callback(GtkCList widget, int row, int column, GdkEvent event); row-move This signal is emitted when a row is moved. Funo Callback void callback(GtkCList widget, int source_row, int destination_row); click-column This signal is emitted when a column title is clicked. Here would be a good starting point if you want to make the list sortable by the user. Funo Callback void callback(GtkCList widget, int column); resize-column This signal is emitted when a column is resized. It is also emitted if the size has not changed (but the user tried to). Funo Callback void callback(GtkCList widget, int column, int size); GtkCList::focus_row Access: Read Only Type: int Returns the number of the row which currently has the focus. Note that the focus doesn't mean the row is selected - see GtkSelectionMode for a detailed explanation. GtkCList::rows Access: Read Only

Type: int Returns the number of rows/entries in the list. GtkCList::row_list Access: Read Only Type: array Returns an array of GtkCListRows containing all the rows of the list. GtkCList::selection Access: Read Only Type: array Returns an array of int values which describe the row number of the selected row. This is independent of the selection_mode - it is always an array. GtkCList::selection_mode Access: Read Only Type: GtkSelectionMode Returns the current selection mode set with set_selection_mode() . GtkCList::sort_column Access: Read Only Type: int The current row after which the list shall be sorted. GtkCList::sort_type Access: Read Only Type: GtkSortType The current sort type (order) after which the list shall be sorted. Can be GTK_SORT_ASCENDING or GTK_SORT_DESCENDING. GtkCListRow Hierarquia do Objeto GtkCListRow Direct subclasses None. Descrio

Propriedades state:

foreground: background: style: fg_set: bg_set: selectable: GtkCListRow::state Access: Read Only Type: int GtkCListRow::foreground Access: Read Only Type: GdkColor GtkCListRow::background Access: Read Only Type: GdkColor GtkCListRow::style Access: Read Only Type: GtkStyle GtkCListRow::fg_set Access: Read Only Type: bool GtkCListRow::bg_set Access: Read Only Type: bool GtkCListRow::selectable

Access: Read Only Type: bool GtkColorSelection Widget that allows for selection of a color. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBox `-- GtkVBox `-- GtkColorSelection Direct subclasses None. Descrio Construtor GtkColorSelection (void); -Mtodos set_update_policy() set_opacity() set_color() get_color() GtkColorSelection Construtor GtkColorSelection (void); GtkColorSelection::set_update_policy void set_update_policy(GtkUpdateType policy); GtkColorSelection::set_opacity void set_opacity(int use_opacity);

GtkColorSelection::set_color XXX set_color(XXX); GtkColorSelection::get_color XXX get_color(XXX); GtkColorSelectionDialog Standard dialog box for selecting a color. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkWindow `-- GtkColorSelectionDialog Direct subclasses None. Descrio Construtor GtkColorSelectionDialog (string title); -GtkColorSelectionDialog Construtor GtkColorSelectionDialog (string title); GtkCombo Text entry field with a dropdown list. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBox `-- GtkHBox `-- GtkCombo Direct subclasses None.

Descrio A GtkCombo appears to be the equivalent of the select element in HTML. This can be misleading if you're coming directly from a web development background; a GUI widget is largely about appearance, and carrying hidden values is not something this one will do without a little programming. Luckily, there are a trio of invaluable GtkObject methods that will do just that, with any object and with any form of data. These are get_data() , set_data() and remove_data() . See the sample under GtkCombo's constructor to get an idea of their usage. There are a few key bindings in the combo widget. Most of them have some bearing on searches. Tabela 1. Key bindings in GtkCombo Key combination Function Return (from the entry box) Opens up the list. If the entry contains text that fully matches a list item's content, that list item will be selected on opening. Tab + MOD_1 mask (from the entry box) The MOD_1 modifier is usually Alt. This key combination auto-completes a partial entry. Arrow up (from the entry box) If use_arrows has been set to true, scrolls up through the list without opening the list window. Can also be achieved with keypad arrow or Alt + p. Arrow down (from the entry box) If use_arrows has been set to true, scrolls down through the list without opening the list window. Can also be achieved with keypad arrow or Alt + n. Return (from the list box) Toggles the list item that has current focus. Spacebar (from the list box) Selects the list item that has current focus. Up arrow (from the list box) Scrolls up through the list items. Down arrow (from the list box) Scrolls down through the list items. Esc (from the list box) Removes grab from the list box, which closes it. The normal but annoying behaviour is that the first entry is selected when you open the dropdown. This can be stopped by doing the following: $objList = $objCombobox->list; $objList->set_selection_mode( GTK_SELECTION_SINGLE); See also: GtkEditable, GtkEntry, GtkItem, GtkList, GtkListItem, GtkOptionMenu. GtkCombo has been deprecated since GTK+ 2.0 and should not be used in newly written code. Construtor GtkCombo (void);

-- Creates an entry box with a dropdown list. Mtodos set_value_in_list() Toggles whether entry value must be matched in list. set_use_arrows() Toggles whether list can be scrolled within entry box. set_use_arrows_always() Toggles whether entry box list-scrolling should loop. set_case_sensitive() Toggles whether matching should be case-sensitive. set_item_string() Sets string associated with list item. set_popdown_strings() Simple list construction. disable_activate() Prevents return key from opening dropdown list. Propriedades entry: Text entry field. list: Dropdown list. GtkCombo Construtor GtkCombo (void); When the GtkListItem has been selected in a GtkCombo, the combo's entry text is picked up from the item, and the combo's list is searched for a data match. The "unselect-child" signal is fired by the list during this routine in order to clear previously existing data. If you connect to either that or the "deselect" signal, your callback function will run twice. The same applies to the "select-child" and "select" signals, as the deselection allows the item to be selected again - which it is, when select_child() is called immediately afterwards. There are many ways of working around this. One is given in the sample below. Exemplo 9. Associating data with a GtkListItem <?php if( !extension_loaded('gtk')) {

dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); } function on_click($item, $event, $i) { echo $item->get_data($i)."\n"; flush(); } function on_key($item, $i) { echo $item->get_data($i)."\n"; flush(); } $window = &new GtkWindow(); $window->set_position(GTK_WIN_POS_CENTER); $window->connect_object("destroy", array("gtk", "main_quit")); $combo = &new GtkCombo(); /* The GtkEntry and GtkList are accessible through the combo's properties */ $entry = $combo->entry; $entry->set_text('Choose some fruit'); $list = $combo->list; $list->set_selection_mode(GTK_SELECTION_SINGLE); $fruit = array('apples', 'bananas', 'cherries', 'damsons', 'eggplants', 'figs', 'grapes'); for($i = 0; $i < count($fruit); $i++) { $item = &new GtkListItem(); /* You can put pretty much anything into a GtkListItem */ $box = &new GtkHBox(); $arrow = &new GtkArrow(GTK_ARROW_RIGHT, GTK_SHADOW_OUT); $box->pack_start($arrow, false, false, 5); $label = &new GtkLabel('Item '.($i+1)); $box->pack_start($label, false, false, 10); $item->add($box); $combo->set_item_string($item, "You chose $fruit[$i]"); $data = $fruit[$i]; /* This data will be carried with the $item. The key here is $i. */ $item->set_data($i, $data); /* Two separate signals to get around the 'select' problem. */ $item->connect('button-press-event', 'on_click', $i); $item->connect('toggle', 'on_key', $i); $list->add($item); $item->show_all(); } $window->add($combo); $window->show_all(); gtk::main(); ?>

GtkCombo::set_value_in_list void set_value_in_list(bool val, bool ok_if_empty); This method used to make the combo emit a beep if the entry value could not be matched in the list. It no longer does this, and nor does it print an error message when the search string is invalid. Effectively broken. GtkCombo::set_use_arrows void set_use_arrows(bool val); set_use_arrows() , when set to false prevents the Up and Down arrow keys from being used to scroll the list within the combo's entry box. The default value is true, which allows such scrolling where there is a match between the entry text and one of the list item strings. GtkCombo::set_use_arrows_always void set_use_arrows_always(bool val); This method is the adult version of set_use_arrows() . The chief difference is that the entry box text does not need to match the text string in a list item in order for the arrows to be used. The secondary difference is that the scrolling loops back to the start of the list when the final item is reached, and vice versa. GtkCombo::set_case_sensitive void set_case_sensitive(bool val); set_case_sensitve, if set to true, will not match items that are dissimilar with regard to case -in other words, Cat is not the same thing as cat. The default behaviour is that a string in the combo's entry box that is accurate in all the ways other than case will be altered to match the list version of that string. GtkCombo::set_item_string void set_item_string( GtkItem item , string item_value); As you may have noticed in the GtkCombo constructor example, it is not by any means essential that the items in a GtkList are GtkListItems. This method is intended to provide a way to give an alternative to the entry box, where only the string data type is allowed. set_item_string() can be set regardless of whether there is already text in the list item, and in either case will provide the string that is compared against the entry's text content during search routines.

This method determines the string that will be displayed in the entry field after the list item has been selected. GtkCombo::set_popdown_strings array set_popdown_strings(array item_labels); Use this method to create the GtkListItems to populate the list, where only the labels themselves are necessary data. Exemplo 10. The easy way to fill a GtkCombo's list <?php dl("php_gtk." . (strstr(PHP_OS, "WIN") ? "dll" : "so")); function print_this($list, $item) { $label = $item->child; echo $label->get()."\n"; flush(); } $window = &new GtkWindow(); $window->set_position(GTK_WIN_POS_CENTER); $window->connect_object("destroy", array("gtk", "main_quit")); $combo = &new GtkCombo(); $fruit = array('apples', 'bananas', 'cherries', 'damsons', 'eggplants', 'figs', 'grapes'); $combo->set_popdown_strings($fruit); /* We don't have handles for these list items, so we connect them through the GtkList. The child is passed to the callback with the select-child signal. */ $list = $combo->list; $list->connect('select-child', 'print_this'); $window->add($combo); $window->show_all(); gtk::main(); ?> GtkCombo::disable_activate void disable_activate(void); Normally the "activate" signal is emitted when the return key is pressed and the GtkEntry has keyboard grab. This signal emission results in the dropdown list being exposed. disable_activate() simply disconnects the "activate" signal when it is set.

GtkCombo::entry Access: Read Only Type: GtkEntry The entry property provides a way of retrieving information directly from the GtkEntry part of the combo widget. GtkCombo::list Access: Read Only Type: GtkList The list property provides a way of retrieving information directly from the GtkList part of the combo widget. GtkContainer Base class for all container widgets. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer Direct subclasses GtkBin, GtkBox, GtkCList, GtkFixed, GtkLayout, GtkList, GtkMenuShell, GtkNotebook, GtkPacker, GtkPaned, GtkSocket, GtkTable, GtkToolbar, GtkTree, GtkSheet, GtkSQPane Descrio GtkContainer is an abstract base class providing all widgets derived from it with the ability to contain child widgets. It also endows those child widgets with a resizing mechanism. Mtodos set_border_width() Sets border width. add() Adds child widget to container. remove() Removes child widget from container. set_resize_mode() Sets priority of resize requests.

check_resize() Emits check_resize signal. children() Returns array of container's child widgets. focus() Queues child focus in a given direction. set_reallocate_redraws() Toggles whether redraws are necessary. set_focus_child() Sets initial child focus. set_focus_vadjustment() Sets focus on a vertical GtkAdjustment. set_focus_hadjustment() Sets focus on a horizontal GtkAdjustment. register_toplevel() Registers container as toplevel. unregister_toplevel() Unregisters a toplevel container. resize_children() Resizes child widgets. child_type() Describes expected child type. Sinais "add" Emitted when the add() method is called. "remove" Emitted when the remove() method is called. "check-resize" Emitted when the check_resize() method is called. "focus" Emitted when the focus() method is called. "set-focus-child" Emitted when the set_focus_child() method is called. GtkContainer::set_border_width void set_border_width(int border_width);

set_border_width() sets the width of the container's border, in pixels. The default setting is 0. GtkContainer::add void add( GtkWidget widget ); add() adds the child widget passed as the parameter to the container. See also: GtkBin, GtkBox, pack_start() , pack_end() . GtkContainer::remove void remove( GtkWidget widget ); remove() removes the child widget passed as the parameter from the container, regardless of the method used to pack that child. GtkContainer::set_resize_mode void set_resize_mode( GtkResizeMode resize_mode ); set_resize_mode() sets the priority of any resize requests for the container widget calling the method. The standard behaviour is to have any such requests added to a queue; setting the resize mode to GTK_RESIZE_IMMEDIATE bypasses that queue. GtkContainer::check_resize void check_resize(void); check_resize() emits the "check-resize" signal, which triggers a series of functions to check exactly what needs to be resized before either resetting the container's size allocation or calling the resize_children() method. This method is mostly used internally. GtkContainer::children array children(void); children() provides an alternative means of accessing a container's child widgets, the other being through the container's properties. The chief and potentially useful difference is that the array returned by this method consists of the child widget itself rather than a sub-array of information related to the child's packing dimensions. Note that the array returned by either method is reversed, so that the last item added to the container has the position [0]. GtkContainer::focus

int focus( GtkDirectionType direction ); focus() creates an internal array of the child widgets able to have focus, and sorts it according to the direction given. The first child in the array will receive focus on opening. To be included in this array, child can be taken as any widget having the container in its ancestry; it need not be a direct child of the container. GtkContainer::set_reallocate_redraws void set_reallocate_redraws(bool needs_redraws); set_reallocate_redraws() toggles whether redraws are necessary for the container, and if set to true will initiate the GtkWidget method queue_draw() as appropriate, allowing the content of the container to be re-set on the fly. The default setting is false. GtkContainer::set_focus_child void set_focus_child( GtkWidget child ); set_focus_child() is used to denote which child widget should receive focus on opening. GtkContainer::set_focus_vadjustment void set_focus_vadjustment( GtkAdjustment adjustment ); set_focus_vadjustment() sets a vertical instance of a GtkAdjustment to have focus. In practice, this means that the adjustment will respond to changes made by the user, e.g. the position of a vertical scrollbar's handle in a GtkScrolledWindow will reflect the current focus within the scrolled window, when called from the scrolled window's container. There is a method named get_vadjustment() which is implemented in all the classes where this method is likely to be utilised. Use it to provide the parameter. GtkContainer::set_focus_hadjustment void set_focus_hadjustment( GtkAdjustment adjustment ); set_focus_hadjustment() sets a horizontal instance of a GtkAdjustment to have focus, allowing it to act in synchronicity with the movement of the adjusted widget. See also: set_focus_vadjustment() , GtkAdjustment.

GtkContainer::register_toplevel void register_toplevel(void); register_toplevel() adds the calling container to an internal array of widgets having toplevel status within that application. Registering a container as toplevel can speed up some of the processing involved in resizing. GtkContainer::unregister_toplevel void unregister_toplevel(void); unregister_toplevel() removes the calling container from an internal array of widgets having toplevel status. Note that the container must first have been prepended to this array using register_toplevel() ; simply declaring a container as toplevel does not add it to the registry. GtkContainer::resize_children void resize_children(void); resize_children() resizes child widgets following an alteration in their size requests. GtkContainer::child_type int child_type(void); child_type() returns an integer describing the type of child the container is expecting to be packed into it. This is mostly for internal use, but could perhaps be useful for diagnosis. The return values are as follows from most containers: GTK_TYPE_NONE = 1 (generated where no widget can be added, e.g. by a descendant of GtkBin already containing a child, or a GtkPaned already containing both children, or a GtkOptionMenu) GTK_TYPE_WIDGET = 39701 (generated where non-specific widgets may be added, e.g. by GtkBox descendants, GtkNotebook, GtkFixed, GtkPacker or GtkTable) The exceptions are GTK_TYPE_LIST_ITEM, GTK_MENU_ITEM and GTK_TREE_ITEM, all of which can be any of a variety of widget types depending on how the items are produced. add The "add" signal is emitted when the add() method is called. It is generally used internally.

Funo Callback void callback(GtkContainer container, GtkWidget child); remove The "remove" signal is emitted when the remove() method is called. It is generally used internally. Funo Callback void callback(GtkContainer container, GtkWidget child); check-resize The "check-resize" signal is emitted when the check_resize() method is called. It is generally used internally. Funo Callback void callback(GtkContainer container); focus The "focus" signal is emitted when the focus() method is called. It is generally used internally. Funo Callback void callback(GtkContainer container, GtkDirectionType direction); set-focus-child The "set-focus-child" signal is emitted when the set_focus_child() method is called. It is generally used internally. Funo Callback void callback(GtkContainer container, GtkWidget child); GtkCTree Widget that displays a hierarchical tree. Hierarquia do Objeto GtkObject

`-- GtkWidget `-- GtkContainer `-- GtkCList `-- GtkCTree Direct subclasses None. Descrio GtkCTree has been deprecated since GTK+ 2.0 and should not be used in newly written code. Construtor GtkCTree (int nColumns, int nTreeGraphicCol, array arColTitles]); -- Creates a new CtkCTree object. Mtodos insert_node() Inserts a new node in the tree. remove_node() Removes the given node from the tree post_recursive() Recursively apply a function to all nodes of the tree at or below a certain node. post_recursive_to_depth() Recursively apply a function to nodes up to a certain depth pre_recursive() Recursively apply a function to all nodes of the tree at or below a certain node. pre_recursive_to_depth() Recursively apply a function to nodes up to a certain depth. is_viewable() This function checks whether the given node is viewable i.e. so that all of its parent nodes are expanded. last() Returns the last child of the last child of the last child... of the given node. node_nth() Returns the node in row X find()

Checks if child is on some level a child (grandchild...) of the node. find_by_row_data() FIXME find_by_row_data() FIXME is_ancestor() Checks if node is an ancestor of child. is_hot_spot() Checks if the given coordinates lie on an expander button. move() Move a node in the tree to another location. expand() Expand one node. expand_recursive() Expand one node and all nodes underneath. expand_to_depth() Expand a node and its children up to the depth given. collapse() Collapse one node. collapse_recursive() Collapse one node and all its subnodes. collapse_to_depth() Collapse a node and its children up to the depth given. toggle_expansion() Toggle a node, i.e. if it is collapsed, expand it and vice versa. toggle_expansion_recursive() Toggle the expansion of a node and all its children. select() Cause the given node to be selected and emit the appropriate signal. select_recursive() Cause the given node and its subnodes to be selected and emit the appropriate signal(s). unselect() Unselect the given node and emit the appropriate signal. unselect_recursive() Unselect the given node and its subnodes and emit the appropriate

signal(s). node_set_text() Set the column text of the specific row. node_set_pixmap() Sets an icon into a column of the node. node_set_pixtext() Sets the pixmap and the corresponding text of a column of a row. set_node_info() Changes all the values set by the insert_node function. node_set_shift() Shift the column of the given cell the given amounts in pixels. node_set_selectable() Sets whether this node can be selected by the user. node_get_selectable() Whether this node can be selected by the user. node_get_cell_type() Returns the type of the given cell. node_get_text() Returns the column text of a given row. node_get_pixtext() Returns the column pixtext of a given row. get_node_info() GGet information corresponding to a node. node_set_row_style() Set the style of a row. node_get_row_style() Get the style of a row. node_set_cell_style() Set the style of an individual cell. node_get_cell_style() Get the style of an individual cell. node_set_foreground() Set the foreground color of a row. node_set_background() Set the background color of a row. node_set_row_data()

Associate a custom object with the row. node_get_row_data() Returns the custom object associated with the node. node_moveto() This function makes the given column of the given node visible by scrolling. node_is_visible() True if the node is currently inside the bounds of the window. set_indent() Sets the number of pixels to shift the levels of the tree. set_spacing() Sets the spacing between the tree graphic and the actual node content. set_show_stub() FIXME set_line_style() Set the line style of the tree. set_expander_style() Set the expander style of the tree. sort_node() Sort the children of a node. sort_recursive() Sort the descendants of a node. Sinais "tree-select-row" Emitted when a row is selected. "tree-unselect-row" Emitted when a node is unselected. "tree-expand" Emitted when a node is expanded. "tree-collapse" Emitted when a node is collapsed. "tree-move" Emitted when a node is moved. Propriedades clist:

FIXME row_list: Array of viewable nodes. selection: Array of selected rows (nodes). GtkCTree Construtor GtkCTree (int nColumns, int nTreeGraphicCol, array arColTitles]); Create a new CtkCTree object with a number of columns. The second parameter contains the index of the column in which the tree lines shall be visible (indent and +/-) and the third parameter can be an array with the column titles. Notice how much of the code here is actually the arrays of data needed to populate the GtkCTree. It would probably be cleaner to keep your data generation in an include file. Exemplo 11. Setting up a GtkCTree <?php if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); } /* start of data generation arrays */ $widgets_ = array( /*level 0*/ array('Object'), /*level 1*/ array('Widget', 'Data', 'ItemFactory'), /*level 2*/ array('Misc', 'Container', 'Calendar', 'DrawingArea', 'Editable', 'Ruler', 'Range', 'Separator', 'Preview', 'Progress'), array('Adjustment', 'Tooltips'), /*level 3*/ array('Label', 'Arrow', 'Image', 'Pixmap'), array('Bin', 'Box', 'CList', 'Fixed', 'Notebook', 'Paned', 'Layout', 'List', 'MenuShell', 'Packer', 'Socket', 'Table', 'Toolbar', 'Tree'), array('Curve'), array('Entry', 'Text'), array('HRuler', 'VRuler'), array('Scale', 'Scrollbar'), array('HSeparator', 'VSeparator'), array('ProgressBar'), /*level 4*/ array('AccelLabel', 'TipsQuery'), array('Alignment', 'Frame', 'Button', 'Item', 'Window', 'EventBox', 'HandleBox', 'ScrolledWindow', 'Viewport', 'Invisible'), array('ButtonBox', 'HBox', 'VBox'), array('CTree'), array('FontSelection'),

array('HPaned', 'VPaned'), array('MenuBar', 'Menu'), array('SpinButton'), array('HScale', 'VScale'), array('HScrollbar', 'VScrollbar'), /*level 5*/ array('AspectFrame'), array('ToggleButton', 'OptionMenu'), array('ListItem', 'MenuItem', 'TreeItem'), array('ColorSelectionDialog', 'Dialog', 'FileSelection', 'FontSelectionDialog', 'Plug'), array('HButtonBox', 'VButtonBox'), array('Combo', 'Statusbar'), array('ColorSelection', 'GammaCurve'), /*level 6*/ array('CheckButton'), array('CheckMenuItem', 'TearoffMenuItem'), array('InputDialog'), /*level 7*/ array('RadioButton'), array('RadioMenuItem') ); $row = array(0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 4, 5, 5, 5, 5, 5, 5, 7, 9, 9, 13, 13, 13, 13, 14, 14, 14, 23, 24, 25, 29, 30); $class = array(0, 0, 1, 0, 1, 3, 4, 5, 6, 7, 9, 0, 0, 1, 2, 4, 5, 8, 0, 0, 1, 1, 2, 3, 4, 0, 1, 2, 0, 1, 1, 0, 0); /* end of data generation arrays */ $window = &new GtkWindow(); $window->set_title('The GTK Class Hierarchy'); $window->set_position(GTK_WIN_POS_CENTER); $window->set_default_size(300, (gdk::screen_height()-30)); $window->connect_object('destroy', array('gtk', 'main_quit')); $scrolledwindow = &new GtkScrolledWindow(); $scrolledwindow->set_policy(GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); $window->add($scrolledwindow); $ctree = &new GtkCTree(1, 0); $ctree->set_line_style(GTK_CTREE_LINES_SOLID); for($x = 0; $x < count($widgets_); $x++) { $sibling[$x] = array(); switch($x) { case 0: $parent = null; break; default: $parent = $sibling[$row[$x-1]][$class[$x-1]]; break; } for ($i = 0; $i < count($widgets_[$x]); $i++) {

$widgets[0] = "Gtk".$widgets_[$x][$i]; $sibling[$x][$i] = $ctree->insert_node($parent, $sibling[$x][], $widgets, 5, null, null, null, null, false, true); } } $scrolledwindow->add($ctree); $ctree->show(); $window->show_all(); gtk::main(); ?> GtkCTree::insert_node GtkCTreeNode insert_node(GtkCTreeNode parent, GtkCTreeNode sibling, Array labels, int pixmap_spacing, GdkPixmap pixmap_closed, GdkBitmap mask_closed, GdkPixmap pixmap_open, GdkBitmap mask_open, boolean is_leaf, boolean is_expanded); This function creates a new node and inserts it into the tree. The first parameter is the parent node; if it's NULL the node will be the root. The "labels" parameter is an array of strings which are shown in the tree, for each column one. pixmap_spacing is the spacing between the pixmap and the text. The sibling parameter determines the position of the new node. If it is NULL, it will be appended to the parents childen as the last element. If the sibling is given, the new node will be inserted just before it. GtkCTree::remove_node void remove_node( GtkCTreeNode node ); Removes the given node from the tree. Children nodes are removed recursively. GtkCTree::post_recursive void post_recursive(GtkCTreeNode node, String callback, ??? own_parameter]); Recursively apply a function to all nodes of the tree at or below a certain node. The function is called for each node after it has been called for that node's children. The callback parameter can be a function name as a string; this function will be called. If you want to use the function of an object, just use array( &$obj, "function") The third parameter is optional, it will be passed to the called

function. You can have as many own parameters as you like. The calling function needs to implement at least 2 parameters: The first is the tree object, the second the specific node. GtkCTree::post_recursive_to_depth void post_recursive_to_depth(GtkCTreeNode node, int depth, String callback, mixed own_parameter]); Recursively apply a function to nodes up to a certain depth. The function is called for each node after it has been called for that node's children. The depth parameter determines, how many levels below the given node the function shall be applied. Note that a depth of "0" does nothing, the depth of "1" will apply the function just to the given node. Only "2" will apply the given function to the first level below the node. If depth is negative, this function just calls post_recursive. The callback parameter can be a function name as a string; this function will be called. If you want to use the function of an object, just use array( &$obj, "function") The fourth parameter is optional, it will be passed to the called function. You can have as many own parameters as you like. The calling function needs to implement at least 3 parameters: The first is the tree object, the second the specific node and the third contains the callback itself (String or array). GtkCTree::pre_recursive void pre_recursive(GtkCTreeNode node, String callback, ??? own_parameter]); Recursively apply a function to all nodes of the tree at or below a certain node. The function is called for each node after it has been called for its parent. For a in-detail description, see post_recursive. GtkCTree::pre_recursive_to_depth void pre_recursive_to_depth(GtkCTreeNode node, int depth, String callback, ??? own_parameter]); Recursively apply a function to nodes up to a certain depth. The function is called for each node after it has been called for that node's children. For a in-detail description, see post_recursive_to_depth.

GtkCTree::is_viewable bool is_viewable( GtkCTreeNode node ); This function checks whether the given node is viewable i.e. so that all of its parent nodes are expanded. This is different from being actually visible: the node can be viewable but outside the scrolling area of the window. GtkCTree::last GtkCTreeNode last ( GtkCTreeNode node ); Returns the last child of the last child of the last child... of the given node. GtkCTree::node_nth GtkCTreeNode node_nth (int row); Returns the node which is in the given row. Count begins with 0 as usual. Only expanded, means viewable nodes are counted! GtkCTree::find bool find( GtkCTreeNode node , GtkCTreeNode child ); Checks if child is on some level a child (grandchild...) of the node. GtkCTree::find_by_row_data GtkCTreeNode find_by_row_data( GtkCTreeNode node , ??? ???); GtkCTree::find_by_row_data Array find_by_row_data( GtkCTreeNode node , ??? ???); GtkCTree::is_ancestor bool is_ancestor( GtkCTreeNode node , GtkCTreeNode child ); Checks if node is an ancestor (parent, grandparent, grand...parent) of child. GtkCTree::is_hot_spot bool is_hot_spot(int x, int y); Returns true if the given coordinates lie on an expander button. GtkCTree::move void move( GtkCTreeNode node , GtkCTreeNode new_parent , GtkCTreeNode

new_sibling ); Move a node in the tree to another location. The parent node and the sibling are handled the same way as in insert_node GtkCTree::expand void expand( GtkCTreeNode node ); Expand one node. GtkCTree::expand_recursive void expand_recursive([ GtkCTreeNode node = NULL ]); Expand one node and all nodes underneath. GtkCTree::expand_to_depth void expand_to_depth( GtkCTreeNode node , int depth); Expand a node and its children up to the depth given. GtkCTree::collapse void collapse( GtkCTreeNode node ); Collapse one node. GtkCTree::collapse_recursive void collapse_recursive([ GtkCTreeNode node = NULL ]); Collapse one node and all its subnodes. GtkCTree::collapse_to_depth void collapse_to_depth( GtkCTreeNode node , int depth); Collapse a node and its children up to the depth given. GtkCTree::toggle_expansion void toggle_expansion( GtkCTreeNode node ); Toggle a node, i.e. if it is collapsed, expand it and vice versa. GtkCTree::toggle_expansion_recursive void toggle_expansion_recursive( GtkCTreeNode node ); Toggle the expansion of a node and all its children.

GtkCTree::select void select( GtkCTreeNode node ); Cause the given node to be selected and emit the appropriate signal. GtkCTree::select_recursive void select_recursive([ GtkCTreeNode node = NULL ]); Cause the given node and its subnodes to be selected and emit the appropriate signal(s). GtkCTree::unselect void unselect( GtkCTreeNode node ); Unselect the given node and emit the appropriate signal. GtkCTree::unselect_recursive void unselect_recursive([ GtkCTreeNode node = NULL ]); Unselect the given node and its subnodes and emit the appropriate signal(s). GtkCTree::node_set_text void node_set_text(int row, int column, string text); Set the column text of the specific row. The row number begins with 0 and counts only viewable rows. GtkCTree::node_set_pixmap void node_set_pixmap( GtkCTreeNode node , int column, GdkPixmap pixmap , GdkBitmap mask ); Sets an icon into a column of the node. The normal text in that column is replaced by the icon and not visible anymore. Use the node_set_pixtext function to add an extra text after that icon. If you once expand/collapse the node, the icon is gone because the open/closed icons you set at the insert_node are used then. To prevent this, use the set_node_info function. GtkCTree::node_set_pixtext void node_set_pixtext( GtkCTreeNode node , int column, string text, int spacing, GdkPixmap pixmap , GdkBitmap mask ); Sets the pixmap and the corresponding text of a column of a row. The pixmap and mask parameters may not be NULL.

If you once expand/collapse the node, the icon is gone because the open/closed icons you set at the insert_node are used then. To prevent this, use the set_node_info function. The text stays visible. GtkCTree::set_node_info void set_node_info( GtkCTreeNode node , string text, int spacing, GdkPixmap pixmap_closed , GdkBitmap mask_closed , GdkPixmap pixmap_opened , GdkBitmap mask_opened , bool is_leaf, bool expanded); Changes all the values set by the insert_node function. GtkCTree::node_set_shift void node_set_shift( GtkCTreeNode node , int column, int vertical, int horizontal); Shift the column of the given cell the given amounts in pixels. Moves the column display inside the area reserved for the display. E.g. when you set the vertical to 20 and the height of the row is just 10, then the cell won't be visible any more. This function can be used to move the icon or the text a given amount left/right from the +/- symbols (horizontal). GtkCTree::node_set_selectable void node_set_selectable( GtkCTreeNode node , bool selectable); Sets whether this node can be selected by the user. This is useful if you have separators in the tree which have no function except that they separate something and shall not be selectable by the user. GtkCTree::node_get_selectable bool node_get_selectable( GtkCTreeNode node ); Whether this node can be selected by the user. GtkCTree::node_get_cell_type GtkCellType node_get_cell_type ( GtkCTreeNode node , int column); Returns the type of the given cell. GtkCTree::node_get_text String node_get_text( GtkCTreeNode node , int column); Returns the column text of a given row. The column in which the expanders/lines are visible cannot use this

function (nTreeGraphic in the Constructor). You have to use node_get_pixtext in this case. Note that this function can also not be used if you used the functions node_set_pixtext or node_set_pixmap to that column. You should use node_get_pixtext instead. GtkCTree::node_get_pixtext Array node_get_pixtext( GtkCTreeNode node , int column); Returns the column pixtext of a given row. The array has a length of 4 and contains the following values: * 0 - String - Pixtext * 1 - int - Spacing between icon and text * 2 - GdkPixmap Pixmap * 3 - GdkBitmap Pixmask GtkCTree::get_node_info Array get_node_info( GtkCTreeNode node ); Get information corresponding to a node. Any of the return parameters can be null. The array has a size of 8 and contains the same values in the same order as you set them with insert_node or set_node_info. GtkCTree::node_set_row_style void node_set_row_style( GtkCTreeNode node , GtkStyle style ); Set the style of a row. GtkCTree::node_get_row_style GtkStyle node_get_row_style ( GtkCTreeNode node ); Get the style of a row. GtkCTree::node_set_cell_style void node_set_cell_style( GtkCTreeNode node , int column, GtkStyle style ); Set the style of an individual cell. GtkCTree::node_get_cell_style GtkStyle node_get_cell_style ( GtkCTreeNode node , int column); Get the style of an individual cell. GtkCTree::node_set_foreground

void node_set_foreground( GtkCTreeNode node , GdkColor color ); Set the foreground (text) color of a row. GtkCTree::node_set_background void node_set_background( GtkCTreeNode node , GdkColor color ); Set the background color of a row. This is useful in connection with node_set_selectable so that the user can distinguish between selectable and not selectable rows. But then don't forget to change the foreground color to a contrast color. GtkCTree::node_set_row_data void node_set_row_data( GtkCTreeNode node , Object custom); Associate a custom object with the row. If you have e.g. a file tree, then you could add the open file handles to the corresponding node. GtkCTree::node_get_row_data Object node_get_row_data( GtkCTreeNode node ); Returns the custom object associated with the node. GtkCTree::node_moveto void node_moveto( GtkCTreeNode node , int column, double row_align, double col_align); This function makes the given column of the given node visible by scrolling. GtkCTree::node_is_visible GtkVisibility node_is_visible ( GtkCTreeNode node ); True if the node is currently inside the bounds of the window. Note that this function can return true even if the node is not viewable, if the node's ancestor is visible. GtkCTree::set_indent void set_indent(int indent); Sets the number of pixels to shift the levels of the tree. GtkCTree::set_spacing void set_spacing(int spacing);

Sets the spacing between the tree graphic and the actual node content. GtkCTree::set_show_stub void set_show_stub(bool show_stub); GtkCTree::set_line_style void set_line_style( GtkCTreeLineStyle line_style ); Set the line style of the tree. GtkCTree::set_expander_style void set_expander_style( GtkCTreeExpanderStyle expander_style ); Set the expander style of the tree. GtkCTree::sort_node void sort_node( GtkCTreeNode node ); Sort the children of a node. The details of sorting can be set with the GtkCList functions set_sort_column and set_sort_type. GtkCTree::sort_recursive void sort_recursive([ GtkCTreeNode node = NULL ]); Sort the descendants of a node. The details of sorting can be set with the GtkCList functions set_sort_colum and set_sort_type. tree-select-row Emitted when a row is selected. The use of the third parameter is not known, only that is has something to do with the selection mode. Funo Callback void callback(GtkCTree widget, GtkCTreeNode node, int unknown, ??? userparam1]); tree-unselect-row Emitted when a node is unselected. The use of the third parameter is not known, only that is has something to do with the selection mode. Funo Callback

void callback(GtkCTree widget, GtkCTreeNode node, int unknown, ??? userparam1]); tree-expand Emitted when a node is expanded. Funo Callback void callback(GtkCTree widget, GtkCTreeNode node, ??? userparam1]); tree-collapse Emitted when a node is collapsed. Funo Callback void callback(GtkCTree widget, GtkCTreeNode node, ??? userparam1]); tree-move Emitted when a node is moved. Funo Callback void callback(GtkCTree widget, GtkCTreeNode node, GtkCTree new_parent, GtkCTreeNode new_sibling, ??? userparam1]); GtkCTree::clist Access: Read Only Type: GtkCTree GtkCTree::row_list Access: Read Only Type: Array Array of viewable nodes. This means that if a node is not expanded, its children won't occur on that list. GtkCTree::selection Access: Read Only Type: Array Array of selected rows (nodes). GtkCTreeNode Represents one row in a GtkCTree Hierarquia do Objeto

GtkCTreeNode Direct subclasses None. Descrio Represents a row in a GtkCTree. To obtain information like the text of the row, you have to use the get_node_info function of the tree object. Propriedades parent:

sibling: children: pixmap_closed: pixmap_opened: mask_closed: mask_opened: level: is_leaf: expanded: row: GtkCTreeNode::parent Access: Read Only Type: GtkCTreeNode GtkCTreeNode::sibling

Access: Read Only Type: GtkCTreeNode GtkCTreeNode::children Access: Read Only Type: array GtkCTreeNode::pixmap_closed Access: Read Only Type: GdkPixmap GtkCTreeNode::pixmap_opened Access: Read Only Type: GdkPixmap GtkCTreeNode::mask_closed Access: Read Only Type: GdkBitmap GtkCTreeNode::mask_opened Access: Read Only Type: GdkBitmap GtkCTreeNode::level Access: Read Only Type: int GtkCTreeNode::is_leaf Access: Read Only Type: bool GtkCTreeNode::expanded Access: Read Only Type: bool GtkCTreeNode::row Access: Read Only Type: GtkCListRow GtkCurve Widget that allows editing of a curve. Hierarquia do Objeto

GtkObject `-- GtkWidget `-- GtkDrawingArea `-- GtkCurve Direct subclasses None. Descrio Construtor GtkCurve (void); -Mtodos reset() set_gamma() set_range() get_vector() set_vector() set_curve_type() GtkCurve Construtor GtkCurve (void); GtkCurve::reset void reset(void); GtkCurve::set_gamma void set_gamma(double gamma); GtkCurve::set_range void set_range(double min_x, double max_x, double min_y, double max_y); GtkCurve::get_vector

XXX get_vector(XXX); GtkCurve::set_vector XXX set_vector(XXX); GtkCurve::set_curve_type void set_curve_type(GtkCurveType type); GtkData Abstract base class for objects containing data. Hierarquia do Objeto GtkObject `-- GtkData Direct subclasses GtkAdjustment, GtkTooltips, GladeXML Descrio GtkData is a legacy abstract base class providing inheriting objects with a single signal - which no longer operates. Objects that are descendants of this class are not widgets, and do not take up screen space. They purely carry data. In GTK 2, GtkData will cease to exist entirely, and the objects that currently are derived from it will be derived directly from GtkObject instead. Sinais "disconnect" Never emitted. disconnect This is a legacy signal which has been implemented in GtkData but nowhere else. You won't get an error message by setting up a connection for it, but there is no longer any way to make an object emit it - so don't bother. Funo Callback void callback(GtkData object); GtkDialog

Widget that eases creation of popup dialogs. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkWindow `-- GtkDialog Direct subclasses GtkInputDialog Descrio GtkDialog is used to create a popup window for presenting or requesting small amounts of information. It is composed of two containers separated by a GtkHSeparator. The top container is a GtkVBox, and would typically contain GtkLabel and GtkEntry widgets to present the user with information and allow input. The bottom container is a GtkHBox and would usually contain dialog buttons, e.g. OK, Cancel, Help and so on. Note that widgets should not be added to the GtkDialog itself but to the containers, which can be accessed as vbox and action_area respectively. Dialogs can be made modal (in effect freezing input to the rest of the application) by calling the GtkWindow method set_modal() on the GtkDialog object. Note that making a GtkDialog modal does not stop execution of the code that calls it. In the example below, the call to 'echo' will still get executed even though the main application may not respond to user input. To stop execution of the code the GtkDialog must contain a call to a nested gtk::main() function. Execution will then continue when the corresponding gtk::main_quit() function is called. Exemplo 12. Using set_modal() <?php $dialog = &new GtkDialog(); $dialog->set_modal(TRUE); echo "This message will still be printed \n"; ?> Construtor GtkDialog (void);

-- Creates the basis for a popup dialog window. Propriedades vbox: Upper container. action_area: Lower container. GtkDialog Construtor GtkDialog (void); Creates the basis for a dialog window. Exemplo 13. Creating a dialog window <?php $dialog = &new GtkDialog(); $dialog->set_policy(true, false, false); $dialog->set_position(GTK_WIN_POS_CENTER); $dialog->connect_object("destroy", array("gtk", "main_quit")); $dialog_vbox = $dialog->vbox; $dialog_action_area = $dialog->action_area; $user_info_label = &new GtkLabel("Some Important Information"); $dialog_vbox->pack_start($user_info_label); $ok_button = &new GtkButton("OK"); $dialog_action_area->pack_start($ok_button); gtk::main(); ?> GtkDialog::vbox Access: Read Only Type: GtkWidget vbox is the GtkVBox at the top of the GtkDialog widget. The programmer would typically add widgets such as GtkLabel and GtkEntry here for the purpose of exchanging information with the end user. GtkDialog::action_area Access: Read Only Type: GtkWidget

action_area is the GtkHBox at the bottom of the GtkDialog widget, below the GtkHSeparator. This is where the programmer would usually add one or two GtkButtons, connecting these to functions that terminate the dialog and/or act upon the information gathered through it. GtkDrawingArea Widget for custom user interface elements. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkDrawingArea Direct subclasses GtkCurve Descrio A GtkDrawingArea is a widget whose GdkWindow can be drawn to. You could use it to create a new user interface element, or an updateable graph, or pretty much anything, using the GDK and GTK draw and paint functions. Because it is in itself so featureless, everything has to be added to a GtkDrawingArea. It will not respond to key or button press events, unless you give it the ability to do so using set_events() or add_events() . It cannot have keyboard focus, unless you set the GTK_CAN_FOCUS flag. It does not regard what is drawn upon it as a clue to sizing, so you have to size it. If you want it to react to resizing, you will need to connect it to an appropriate callback via the "configure-event" signal in order to do so. It has no defining behaviour, beyond the ability to manufacture configure events when it is allocated a new size. It's basically a completely empty widget. Redraws should be created through an "expose-event" handler. Construtor GtkDrawingArea (void); -- Constructs a blank, drawable widget. Mtodos size() Sets the size of the drawing area. GtkDrawingArea Construtor

GtkDrawingArea (void); Exemplo 14. Drawing to a GtkDrawingArea <?php dl('php_gtk.'.(strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); function draw_it($drawingarea, $event, $style, $gdkwindow) { /* access the GdkWindow's colormap to associate a color with a GdkGC */ $colormap = $gdkwindow->colormap; $yellow = $gdkwindow->new_gc(); $yellow->foreground = $colormap->alloc('yellow'); $red = $gdkwindow->new_gc(); $red->foreground = $colormap->alloc('red'); $red->line_width = 7; /* set up fonts. The first font here is set as part of the drawingarea's style property so that it will be used in gtk::draw_string(). */ $font = gdk::font_load('-unknown-Arial-bold-r-normal--*-120-*-*-p-0-iso8859-1'); $style->font = $font; $font2 = gdk::font_load('-unknown-Arial-bold-r-normal--*-720-*-*-p-0-iso8859-1'); /* call the appropriate drawing functions */ gdk::draw_rectangle($gdkwindow, $style->white_gc, true, 0, 0, 200, 220); gdk::draw_rectangle($gdkwindow, $yellow, true, 50, 50, 100, 100); gdk::draw_string($gdkwindow, $font2, $style->white_gc, 75, 130, '?'); gdk::draw_line($gdkwindow, $red, 20, 20, 180, 180); gdk::draw_line($gdkwindow, $red, 20, 180, 180, 20); gtk::draw_string($style, $gdkwindow, GTK_STATE_NORMAL, 12, 210, 'SAY TO SQUARE EGGS!'); gdk::draw_string($gdkwindow, $font, $red, 42, 210, 'NO'); } function press_it($drawingarea, $event, $style, $gdkwindow) { /* make the drawingarea look like it has been pressed down */ $rectangle = &new GdkRectangle(0, 0, 200, 220); gtk::paint_focus($style, $gdkwindow, $rectangle, $drawingarea, null, 0, 0, 200, 220); } function redraw_it($drawingarea, $event) { /* trigger a new expose event */ $drawingarea->queue_draw(); } /* set up the main window that will hold the drawing area */ $window = &new GtkWindow(); $window->set_position(GTK_WIN_POS_CENTER); $window->connect_object('destroy', array('gtk', 'main_quit')); /* set up the drawing area. Sizing is taken from the parent, unless set. We need to add events so that the drawingarea is sensitive to the mouse,

using set_events() to do this because the widget is not realized yet. */ $drawingarea = &new GtkDrawingArea(); $drawingarea->size(200, 220); $drawingarea->set_events(GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK); $window->add($drawingarea); /* once the drawing area has been added to the window we can realize() it, which means that we can now access its properties */ $drawingarea->realize(); $style = $drawingarea->style; $gdkwindow = $drawingarea->window; /* drawing should always follow an expose event */ $drawingarea->connect('expose-event', 'draw_it', $style, $gdkwindow); $drawingarea->connect('button-press-event', 'press_it', $style, $gdkwindow); $drawingarea->connect('button-release-event', 'redraw_it'); $window->show_all(); gtk::main(); ?> GtkDrawingArea::size void size(int width, int height); A GtkDrawingArea has no default size set. If none is given, it will default to the size allocated to it by its parent window. Note that the size set using this method is treated as the drawingarea's size request, and may be overridden in some situations. GtkEditable Base class for text-editing widgets. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkEditable Direct subclasses GtkEntry, GtkText Descrio GtkEditable is an abstract base class providing GtkEntry and GtkText with several methods, signals and properties, and also a set of keybindings that can be used for editing. Tabela 2. Key bindings for editing Key combination Editing function

Control + a Move to the beginning of the line Control + b Move back one character Control + c Copy currently selected text Control + d Delete forward character Control + e Move to the end of the line Control + f Move forward one character Control + h Delete backward character Control + k Delete to line end Control + n Move to the next line (GtkText only) Control + p Move to the previous line (GtkText only) Control + u Delete current line Control + v Paste clipboard text Control + w Delete backward word Control + x Cut currently selected text Alt + b Move back one word Alt + d Delete forward word Alt + f Move forward one word There are also a host of signals that are used internally to enable these editing functions to work. These signals have not been documented here. Mtodos select_region() Selects designated area of text. insert_text() Inserts a string of text. delete_text() Deletes designated area of text. get_chars() Returns designated string. cut_clipboard() Copies and deletes selected string. copy_clipboard() Copies selected string. paste_clipboard() Pastes current clipboard contents. claim_selection() Provides selection data. delete_selection() Deletes selected text and accompanying selection data. changed() Causes "changed" signal to be emitted.

set_position() Sets the cursor position. get_position() Returns the current cursor position. set_editable() Toggles whether the text is editable. Sinais "changed" Emitted when there is a change to the text string. "insert-text" Emitted when insert_text() is called. "delete-text" Emitted when text is deleted. "activate" Emitted when designated key is pressed. "set-editable" Emitted when the set_editable() method is called. "cut-clipboard" Emitted when cut_clipboard() is called. "copy-clipboard" Emitted when copy_clipboard() is called. "paste-clipboard" Emitted when paste_clipboard() is called. Propriedades selection_start_pos: Selection start position. selection_end_pos: Selection end position. has_selection: Indicates whether there is currently a selection. GtkEditable::select_region void select_region(int start, int end); select_region() selects an area of text programmatically. The start and end parameters can be 0, -1 if the full text string is required. Note that the editable widget needs to be realized prior to this

method being called on it. See claim_selection() . GtkEditable::insert_text void insert_text(string text_string, int position); insert_text() is the simplest way of putting text into an editable widget. GtkText has an alternative method, insert() , which gives greater control over the appearance of the text, amongst other things. This method does not support internationalization under win32. Use insert() . The insert_text() method also causes the signal of the same name to be emitted. GtkEditable::delete_text void delete_text(int start_pos, int end_pos); Deletes the designated area of text. As with all editing functions, 0 denotes the beginning of the string, and -1 the end position. delete_text() also causes the signal of the same name to be emitted. GtkEditable::get_chars string get_chars(int start_pos, int end_pos); This method is used to return the specified contents of a string. To return the complete string, pass 0, -1 as the parameters. GtkEditable::cut_clipboard void cut_clipboard(void); cut_clipboard() copies the current selection to the clipboard. It then deletes the original text using the position parameters of the selection. It also causes the "cut-clipboard" signal to be emitted. GtkEditable::copy_clipboard void copy_clipboard(void); copy_clipboard() copies the current selection to the clipboard. It also causes the "copy-clipboard" signal to be emitted. GtkEditable::paste_clipboard

void paste_clipboard(void); paste_clipboard() pastes the current clipboard contents at the cursor position. It also causes the "paste-clipboard" signal to be emitted. GtkEditable::claim_selection void claim_selection(bool claim, int time); This method is used internally as a way to provide select_region() with all the data it needs in order to work, including the underlying GdkWindow that the GtkSelectionData requires. It's not very useful elsewhere. GtkEditable::delete_selection void delete_selection(void); This method deletes the information held in the clipboard as well as the text to which it relates. It is used internally to differentiate between a full text delete and the deletion used in cut_clipboard() . Generally, use delete_text() instead. GtkEditable::changed void changed(void); This method causes the GtkEditable widget to emit the "changed" signal. It is called internally every time there is a change made to the text string. GtkEditable::set_position void set_position(int position); Sets the cursor position within the string of existing text. Note that the calling editable widget must have keyboard focus in order for the cursor position to be valid. GtkEditable::get_position int get_position(void); This method returns the current cursor position. GtkEditable::set_editable void set_editable(bool is_editable);

set_editable() , when set to true, sets the widget to be editable by the user. The default setting is false. changed Effectively, the only difference between this and the "key-press-event" signal is that the key press event is not passed to the callback function. Funo Callback void callback(GtkEditable widget); insert-text This signal is emitted when the insert_text() method is called, which happens internally every time the text is added to by the end user, at every key press. The string_length that is passed is the length of the string that is being inserted, and not the length of the string that makes up the content of the text widget. Note that there is a fourth parameter here that the signal cannot carry in PHP-GTK because it is a GTK_TYPE_POINTER, which is an unsupported type. Depending on the E-NOTICES settings in your php.ini file, you may get an error message when you connect this signal. This does not affect the signal's functionality. Funo Callback void callback(GtkEditable widget, string text_string, int string_length); delete-text This signal is emitted when the delete_text() method is called, which happens internally when the user presses the delete button and text is currently selected. The data that is passed with this signal consists of the calling class and the start and end positions of the selection. Funo Callback void callback(GtkEditable widget, int start_pos, int end_pos); activate The "activate" signal is usually fired when the user presses Return. However, note that in GtkText both the Return key and the arrow keys need to be combined with the Control key in order to have their usual

effect. Funo Callback void callback(GtkEditable widget); set-editable This signal is emitted when the set_editable() is called. It carries a boolean value which determines in which direction the switch has been made. Funo Callback void callback(GtkEditable widget, bool is_editable); cut-clipboard This signal is emitted when the cut_clipboard() method is called. This happens internally when the user presses the Control and x keys silmultaneously. Funo Callback void callback(GtkEditable widget); copy-clipboard This signal is emitted when the copy_clipboard() method is called. This happens internally when the user presses the Control and c keys silmultaneously. Funo Callback void callback(GtkEditable widget); paste-clipboard This signal is emitted when the paste_clipboard() method is called. This happens internally when the user presses the Control and v keys silmultaneously. Funo Callback void callback(GtkEditable widget); GtkEditable::selection_start_pos Access: Read Only Type: int The position in the text index that the current selection starts from, if there is one.

GtkEditable::selection_end_pos Access: Read Only Type: int The position in the text index that the current selection ends at, if there is one. GtkEditable::has_selection Access: Read Only Type: bool Indicates whether there is currently a selection. GtkEntry A single line text entry field. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkEditable `-- GtkEntry Direct subclasses GtkSpinButton Descrio GtkEntry is a single line text field generally used where input is required from the user. The minimum length of the entry field is set internally at 150 pixels; the maximum length is determined by the size of the container. If the text entered is longer than the entry field, the widget will scroll so that the cursor position is visible. Both GtkEntry and GtkText have the potential to be edited by the user, and share a fairly large number of key bindings to that end. These are listed under GtkEditable for the sake of completeness; however, note that they are replaced by a more intuitive set in GTK+ 2.0. It will be immediately obvious that quite a few GtkEntry methods are marked here as being deprecated in later GTK+ releases. Please be aware that all editable classes are undergoing radical changes, and that deprecated methods may or may not be supportable in the future. It would therefore be wise to avoid methods marked as deprecated, as far as is possible. See also: GtkEditable, GtkCombo, GtkList, GtkCheckButton, GtkToggleButton, GtkRadioButton.

Construtor GtkEntry (void); -- Creates a single-line text entry widget. Mtodos set_text() Sets text content. append_text() Adds text to the end of entered text. *Deprecated in GTK2* prepend_text() Adds text to the start of entered text. *Deprecated in GTK2* set_position() Sets cursor position. *Deprecated in GTK2* get_text() Retrieves entered text. select_region() Selects text region. *Deprecated in GTK2* set_visibility() Toggles text visibility. set_editable() Toggles text editability. *Deprecated in GTK2* set_max_length() Sets the maximum text length. GtkEntry Construtor GtkEntry (void); Creates a widget that will hold a single line of text, either set programmatically through set_text() or entered by the user. Exemplo 15. Retrieving text from a GtkEntry widget <?php dl('php_gtk.'.(strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); /* set up a function to collect the input from the entry and print it */ function get_input($entry) { $input=$entry->get_text(); echo "$input\n"; $entry->grab_focus(); $entry->set_text("");

} /* set up the window */ $window = &new GtkWindow(); $window->set_position(GTK_WIN_POS_MOUSE); $window->connect_object('destroy', array('gtk', 'main_quit')); /* add a box container to the window to allow more than one child widget */ $box = &new GtkVBox(); $window->add($box); /* add a GtkEntry to the box and connect it to the callback function */ $entry = &new GtkEntry(); $entry->connect('activate', 'get_input'); $box->add($entry); /* add a GtkButton to the box and use connect_object() so that it will pass the GtkEntry to the callback when it is clicked */ $button = &new GtkButton('Return or click me to echo input'); $button->connect_object('clicked', 'get_input', $entry); $box->add($button); /* display everything and set the main loop running */ $box->show_all(); $window->show_all(); gtk::main(); ?> GtkEntry::set_text void set_text(string text); set_text() sets a string of given text in the entry field. $entry-gt;set_text("Programmed text entry"); GtkEntry::append_text void append_text(string text); append_text() adds the given string to the end of any entered text. $entry->append_text("</END>"); GtkEntry::prepend_text void prepend_text(string text); prepend_text() adds the given string to the start of any entered text. $entry->prepend_text("<START>"); GtkEntry::set_position

void set_position(int position); set_position() sets the cursor at the given character position within existing text in the entry field. Use 0 to set the cursor at the beginning of the text, and -1 to set it at the end. GtkEntry::get_text string get_text(void); get_text() retrieves the text entered into the GtkEntry widget, and also any appended or prepended text that may have been set but not displayed. Contrary to rumour, this function is *not* marked as deprecated, either in the versions of GTK+ currently used by PHP-GTK or in recent development releases of GTK+. GtkEntry::select_region void select_region(int start, int end); select_region() is used to select a region of existing text, generally for using with the cut, copy and paste methods found in GtkEditable. If you need to select the entire text entry, use the setting (0, -1). GtkEntry::set_visibility void set_visibility(bool visible); set_visibility() , when set to false, provides a means of hiding sensitive input information on screen. It replaces each character with a star. This function is mainly used for password entry. GtkEntry::set_editable void set_editable(bool editable); set_editable() sets the entry field to be editable by the user, or otherwise. The default setting is true. Note that setting set_editable() to true on top of the default setting can lead to some unexpected effects. GtkEntry::set_max_length void set_max_length(int max);

set_max_length() sets the maximum number of characters that will be accepted in a text entry. Any further characters entered will not be displayed in the entry field, nor will they be capable of being retrieved with the get_text() function. GtkEventBox Widget used to capture events for widgets with no GdkWindow. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkEventBox Direct subclasses None. Descrio The GtkEventBox is used to capture events for widgets that do not have their own window. Most widgets inherit the window property from GtkWidget, which makes it possible to use those widgets interactively. However, some widgets are flagged as GTK_NO_WINDOW at source, because there is rarely a need to capture events crossing those widgets. The following widgets and their descendants fall into this category and need to be packed into an event box before they can be made to respond to user activity: GtkAlignment GtkArrow GtkBox GtkCheckButton GtkFrame GtkImage GtkItem GtkLabel GtkPacker GtkPixmap GtkScale GtkScrolledWindow GtkSeparator GtkTable GtkToggleButton - alters according to its draw indicator status! Construtor GtkEventBox (void);

-- Creates a means of capturing events where there is none. GtkEventBox Construtor GtkEventBox (void); The most common need for a GtkEventBox arises when a tooltip is required for a non-windowed widget. Exemplo 16. Giving a GtkLabel a tooltip. <?php dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); $window = &new GtkWindow(); $window->set_position(GTK_WIN_POS_CENTER); $window->connect_object('destroy', array('gtk', 'main_quit')); $eventbox = &new GtkEventBox(); $label = &new GtkLabel("This is a normal label. It cannot capture events."); $eventbox->add($label); $label->show(); $window->add($eventbox); $tooltip = &new GtkTooltips(); $tooltip->set_tip($eventbox, "So how did this get here?", null); $tooltip->enable(); $window->show_all(); gtk::main(); ?> GtkFileSelection Widget for selecting a file or a directory. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkWindow `-- GtkFileSelection Direct subclasses None. Descrio

GtkFileSelection is used to retrieve files or directories requested by the end user. The widget contains a directory list and a file list which will correspond to the default directory, that is, either the current working directory or one determined using set_filename() . The filesystem can be navigated using either the directory tree or the dropdown history menu. Alternatively it is possible to type the directory or file path into the selection_entry field, and also to use the TAB key to autocomplete either the directory name or file name entered in this way. Construtor GtkFileSelection ([string title ]); -- Creates a new GtkFileSelection widget. Mtodos set_filename() Sets the default path. get_filename() Returns the current selected path. complete() Matches a given pattern to a valid file name. show_fileop_buttons() Shows the file operation buttons. hide_fileop_buttons() Hides the file operation buttons. Propriedades dir_list: Directory list. file_list: File list. selection_entry: Entry field. selection_text: Directory selection status. main_vbox: Main container. ok_button:

Standard button. cancel_button: Standard button. action_area: Container for custom additions. GtkFileSelection Construtor GtkFileSelection ([string title ]); The syntax to create a GtkFileSelection widget is: $fs = &new GtkFileSelection("My File Selection"); Note that if the title parameter is not supplied or is NULL the title will be set to the name of the file in which the PHP code resides. GtkFileSelection::set_filename void set_filename(string filename); Sets the default path for the directory and/or file name. $fs->set_filename("/home/user/php/"); GtkFileSelection::get_filename string get_filename(void); Returns a string representing the current value in the file selector. If no directory or file has been selected then the current path is returned. $filename = $fs->get_filename(); GtkFileSelection::complete void complete(string pattern); complete() will try to match the pattern given by the programmer to a valid file name in the current directory, or to a valid directory name on the current drive. This is useful when, for example, wishing to hard-code a search for a specific extension into an application. Where a full match is made, the matched file name will appear in both the file list and the text entry field of the file selection dialog. If only partial matches can be found, the file list will contain the resulting file names and the text entry field will contain the closest matched string (not the full file name). Note that only a single wildcard field is effective here. $fs->complete("*.php");

GtkFileSelection::show_fileop_buttons void show_fileop_buttons(void); Shows the file operation buttons Create Dir, Delete File and Rename File. This is their default state, so that show_fileop_buttons() would only be used following a call to hide_fileop_buttons() . The rest of the widgets in the dialog will be automatically resized to accommodate the status of the file operation buttons. These buttons do not need any programming in order to carry out their respective functions, as these are already hard-coded into GTK+. $fs->show_fileop_buttons(); GtkFileSelection::hide_fileop_buttons void hide_fileop_buttons(void); Hides the file operation buttons Create Dir, Delete File and Rename File which by default appear at the top of a GtkFileSelection. hide_fileop_buttons() is useful where the programmer would prefer the end user not to have easy access to these file operations. $fs->hide_fileop_buttons(); GtkFileSelection::dir_list Access: Read Only Type: GtkWidget dir_list is a GtkCList widget embedded in the GtkFileSelection object that displays the subdirectories available in the current directory. GtkFileSelection::file_list Access: Read Only Type: GtkWidget file_list is a GtkCList widget embedded in the GtkFileSelection object that displays the list of files available in the current directory. GtkFileSelection::selection_entry Access: Read Only Type: GtkWidget selection_entry is a GtkEntry widget placed at the bottom of the GtkFileSelection object for use in navigation and searching. It displays the current enquiry or the current selected item. GtkFileSelection::selection_text Access: Read Only Type: GtkWidget

selection_text is a GtkLabel that by default contains the string "Selection: " followed by the full path of the current selected directory. GtkFileSelection::main_vbox Access: Read Only Type: GtkWidget main_vbox is the container holding all the other elements of the GtkFileSelection widget. GtkFileSelection::ok_button Access: Read Only Type: GtkWidget ok_button is a GtkButton placed at the bottom of the GtkFileSelection object. Note that this button is not initially connected and has no default callback function. GtkFileSelection::cancel_button Access: Read Only Type: GtkWidget cancal_button is a GtkButton placed at the bottom of the GtkFileSelection object. As with the ok_button, it is the programmer's responsibility to listen for signals from this button and take the appropriate action. GtkFileSelection::action_area Access: Read Only Type: GtkWidget action_area is a GtkHBox which is positioned directly below the file_list and dir_list. It would generally be used for displaying custom items such as additional buttons, labels or text entry boxes. GtkFixed Container that retains the sizes and positions of its children. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkFixed

Direct subclasses None. Descrio GtkFixed is a container widget that retains the original sizes and positions of its children regardless of any top-level resizing. Note that there is no padding or spacing implicit in this method of container packing. The arrangement of the children is based purely on the co-ordinate values given in the put() and move() method parameters. For this reason it is inadvisable to use add() when utilising GtkFixed, as widgets that have been added in this way can and will be overwritten by any fixed-position widgets. Construtor GtkFixed (void); -- Creates a GtkFixed container. Mtodos put() Sets initial position of child. move() Moves child to new position. Propriedades children: Array of child positioning information. GtkFixed Construtor GtkFixed (void); This function creates and returns a GtkFixed widget. GtkFixed::put void put( GtkWidget widget , int x, int y); put() sets the initial position of the child widget(s) in a GtkFixed container. This information is held in the children property as an array of GtkFixedChild objects. The parameters are the x and y co-ordinates of the top left-hand corner of the child widget, measured in pixels from the top left-hand corner of the container. GtkFixed::move

void move( GtkWidget widget , int x, int y); move() sets a new position for a child widget in a GtkFixed container. The parameters are the x and y co-ordinates of the top left-hand corner of the child widget, measured in pixels from the top left-hand corner of the container. GtkFixed::children Access: Read Only Type: array The positioning information for the individual child widgets is stored in children as an array of GtkFixedChild objects. GtkFixedChild Helper class for GtkFixed. Hierarquia do Objeto GtkFixedChild Direct subclasses None. Descrio GtkFixed is a widget that fixes its children at their given sizes and positions. GtkFixedChild is a helper class that allows access to the positioning information for each individual child. The children property in GtkFixed is an array of GtkFixedChild objects corresponding to the child widgets that have been put() into a GtkFixed object. Note that GtkFixedChild cannot be constructed directly. Propriedades widget: Child widget. x: Child position x co-ordinate. y: Child position y co-ordinate.

GtkFixedChild::widget Access: Read Only Type: GtkWidget The widget property provides access to the child widget object. It is possible to access methods, properties and signals belonging to widget as with any GtkWidget of the same type. <?php $button = $fixed->children[5]->widget; $label = $button->child; $label->set_text("New Button Label"); ?> GtkFixedChild::x Access: Read Only Type: int x is the measurement in pixels of the distance between the top left-hand corner of the child widget and the left edge of the GtkFixed container. GtkFixedChild::y Access: Read Only Type: bool y is the measurement in pixels of the distance between the top left-hand corner of the child widget and the top edge of the GtkFixed container. GtkFontSelection Widget for selecting fonts. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkNotebook `-- GtkFontSelection Direct subclasses None. Descrio Construtor

GtkFontSelection (void); -Mtodos get_font_name() get_font() set_font_name() get_preview_text() set_preview_text() GtkFontSelection Construtor GtkFontSelection (void); GtkFontSelection::get_font_name string get_font_name(void); GtkFontSelection::get_font GdkFont get_font(void); GtkFontSelection::set_font_name bool set_font_name(string fontname); GtkFontSelection::get_preview_text string get_preview_text(void); GtkFontSelection::set_preview_text void set_preview_text(string text); GtkFontSelectionDialog Standard dialog box for selecting fonts. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer

`-- GtkBin `-- GtkWindow `-- GtkFontSelectionDialog Direct subclasses None. Descrio Construtor GtkFontSelectionDialog (string title); -Mtodos get_font_name() get_font() set_font_name() get_preview_text() set_preview_text() GtkFontSelectionDialog Construtor GtkFontSelectionDialog (string title); GtkFontSelectionDialog::get_font_name string get_font_name(void); GtkFontSelectionDialog::get_font GdkFont get_font(void); GtkFontSelectionDialog::set_font_name bool set_font_name(string fontname); GtkFontSelectionDialog::get_preview_text string get_preview_text(void); GtkFontSelectionDialog::set_preview_text

void set_preview_text(string text); GtkFrame Container with a decorative frame and an optional label. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkFrame Direct subclasses GtkAspectFrame, GtkScintilla Descrio GtkFrame is a container for a single child widget that provides a configurable shadowed border around the child's allocated area. Construtor GtkFrame ([string label = NULL ]); -- Creates a decorative container. Mtodos set_label() Sets label text. set_label_align() Sets label position. set_shadow_type() Sets angle and depth of shadow. GtkFrame Construtor GtkFrame ([string label = NULL ]); The label in the GtkFrame is only given physical space if a text string is passed to it. The NULL default setting does not refer to the value of the text string, but to its absence. Note that the internal label exists in this widget regardless of whether it has text set during construction. GtkFrame::set_label void set_label(string label);

set_label() sets the label text programmatically. $frame->set_label("Alternative text string"); GtkFrame::set_label_align void set_label_align(double xalign, double yalign); set_label_align() sets the position of the label along the top edge of the frame. The position is given as a double, so that an xalign setting of 0.0 would hold the label against the top left edge of the frame and a setting of 1.0 against the top right edge. The default xalign setting is 0.0. Note that although the yalign setting is currently ignored by GTK, it is not possible to omit the parameter completely. The default setting for yalign is 0.5 both currently and in development releases of GTK+, so it would seem advisable to use that value. $frame->set_label_align(0.7, 0.5); GtkFrame::set_shadow_type void set_shadow_type( GtkShadowType type ); set_shadow_type() sets the angle and depth of the line of shadow that decorates the GtkFrame border, according to the specified GtkShadowType option. The default setting is GTK_SHADOW_ETCHED_IN. GtkGammaCurve A subclass of GtkCurve for editing gamma curves. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBox `-- GtkVBox `-- GtkGammaCurve Direct subclasses None. Descrio Construtor GtkGammaCurve (void);

-GtkGammaCurve Construtor GtkGammaCurve (void); GtkHandleBox Widget for detachable window portions. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkHandleBox Direct subclasses None. Descrio GtkHandleBox allows for widgets to be "torn out" of a window and to become their own floating window. The GtkHandleBox displays its child along with a handle that the user can drag to tear the widget out of its containing window and into its own float window. When the widget is torn out of the original window, its place is held by a thin ghost widget. By draging the float window back to the ghost widget and aligning the snap edge, the float window can be reattached. GtkHandleBox is a decendant of GtkBin, which means that it may container only one child. If you would like to have more than one widget in the same float window, you must first add those widgets to a container capable of holding more than one child, such as a GtkVBox. Construtor GtkHandleBox (void); -- Create a widget capable of being "torn out" of a window. Mtodos set_shadow_type() Set the shadow type that the float window will cast. set_handle_position() Set the edge on which the handle will be shown.

set_snap_edge() Set the edge which must be aligned to reattach the float window. GtkHandleBox Construtor GtkHandleBox (void); GtkHandleBox::set_shadow_type void set_shadow_type(GtkShadowType type); GtkHandleBox::set_handle_position void set_handle_position(GtkPositionType position); GtkHandleBox::set_snap_edge void set_snap_edge(GtkPositionType edge); Sets the edge which must be aligned to reattach the float window. When edge on both the float window and the ghost widget are aligned the float window will be reattached to its original window. If the snap edge is not explicitly set using set_snap_edge() , the snap edge will be determined automatically by the placement of the handle. To make detaching and reattaching the handlebox as minimally confusing as possible to the user, it is important to set the snap edge so that the snap edge does not move when the handlebox is deattached. For instance, if the handlebox is packed at the bottom of a GtkVBox, then when the handlebox is detached, the bottom edge of the handlebox's allocation will remain fixed as the height of the handlebox shrinks, so the snap edge should be set to GTK_POS_BOTTOM. See also: set_handle_position() GtkHBox Horizontal box container. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBox `-- GtkHBox Direct subclasses GtkCombo, GtkStatusbar Descrio

GtkHBox is a box container that packs child widgets in a single row, using the packing methods inherited from GtkBox, such as pack_start() , as well as the less flexible add() method available to most container widgets. GtkHBox and GtkVBox in combination are the most commonly used packing widgets. See the GtkVBox constructor for a working example using both. Note that all children in a GtkHBox are allocated the same height, regardless of settings and child requisition size. Widgets taking up less than the allocated height are by default centered within the available area in that dimension. See also: GtkContainer, GtkBox, GtkVBox, GtkButtonBox, GtkTable. Construtor GtkHBox ([bool homogeneous = false , [int spacing = 0 ]]); -- Creates a container for a single row of child widgets. GtkHBox Construtor GtkHBox ([bool homogeneous = false , [int spacing = 0 ]]); Creates a new horizontal box container designed for packing a single row of child widgets. The first parameter, homogeneous, is a boolean value which, if set to true, will set each child widget in the GtkHBox to the same width as that of the largest child widget. The second parameter, spacing, sets the minimum spacing between the child widgets along the width of the container, in pixels. Leaving both parameters empty, e.g. $hbox = &new GtkHBox(); will set the default behaviour of individual sizing and zero spacing. GtkHButtonBox Container for arranging a group of buttons horizontally. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBox `-- GtkButtonBox `-- GtkHButtonBox Direct subclasses None.

Descrio GtkHButtonBox is a container widget designed for arranging a row of buttons in accordance with a specified GtkButtonBoxStyle setting. See also: GtkButtonBox, GtkVButtonBox. Construtor GtkHButtonBox (void); -- Creates the basis for a horizontal button container. GtkHButtonBox Construtor GtkHButtonBox (void); The syntax for creating a horizontal buttonbox is: $hbuttonbox = &new GtkHButtonBox(); There are no parameters. As with all container widgets, no physical space is taken by a GtkHButtonBox until its child widgets are in place. GtkHPaned Container with two panes arranged horizontally. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkPaned `-- GtkHPaned Direct subclasses None. Descrio GtkHPaned is a widget derived from GtkPaned, consisting of two panes arranged horizontally and separated by a dividing handle. The handle can be adjusted by the end user to alter the relative sizes of the pane contents. See also: GtkPaned, GtkVPaned. Construtor GtkHPaned (void);

-- Creates the basis for a horizontal dual-paned container. GtkHPaned Construtor GtkHPaned (void); The GtkHPaned widget should be thought of in terms of an arrangement of two child widgets, rather than as an object in its own right. The construct $hpaned = &new GtkHPaned(); needs to be within a containing GtkWindow and to contain two child widgets of its own in order to work. Exemplo 17. Constructing a GtkHPaned widget <?php $window = &new GtkWindow(); $window->set_title("GtkHPaned"); $window->connect_object("destroy", array("gtk", "main_quit")); $hpaned = &new GtkHPaned(); $window->add($hpaned); $hpaned->show(); $button = &new GtkButton("Widget child1"); $hpaned->pack1($button, false, false); $button->show(); $label = &new GtkLabel(); $label->set_text("Widget child2"); $hpaned->pack2($label, true, true); $label->show(); $window->show_all(); gtk::main(); ?> Note that setting the resize parameter when packing GtkHPaned child widgets will not prevent them from resizing vertically when the top-level window is maximised. GtkHRuler Horizontal ruler. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkRuler

`-- GtkHRuler Direct subclasses None. Descrio Construtor GtkHRuler (void); -GtkHRuler Construtor GtkHRuler (void); GtkHScale Horizontal slider widget for selecting a value from a range. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkRange `-- GtkScale `-- GtkHScale Direct subclasses None. Descrio A GtkHScale is a horizontal scrollbar-like widget that is able to display its adjustment value as text. There are some configuration issues with this widget when it is used in such a way; please refer to GtkScale for further information. Construtor GtkHScale ( GtkAdjustment adjustment ); -- Creates a horizontal slider. GtkHScale Construtor GtkHScale ( GtkAdjustment adjustment ); A GtkHScale that can be given its own GtkAdjustment settings or simply

not display the text value has no configuration issues whatever. However, please note that even a GtkHScale with no displayed value is not able to scroll a GtkText widget. GtkHScrollbar Horizontal scrollbar. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkRange `-- GtkScrollbar `-- GtkHScrollbar Direct subclasses None. Descrio A GtkHScrollbar is a horizontal scrollbar. Tabela 3. Key bindings for GtkHScrollbar Key combination Scroll function Left arrow Move left one step increment Right arrow Move right one step increment Home Move left one page increment End Move right one page increment Control + Home Move to left of scroll Control + End Move to right of scroll Construtor GtkHScrollbar ( GtkAdjustment adjustment ); -- Creates a horizontal scrollbar. GtkHScrollbar Construtor GtkHScrollbar ( GtkAdjustment adjustment ); A scrollbar needs a GtkAdjustment in order to operate. The values that you give to the adjustment object will depend on the situation where the scrollbar is intended to be used. All scrollable widgets have their own adjustment object(s), and in most instances where you are most likely to need a horizontal scrollbar it is possible to create a handle for the widget's horizontal GtkAdjustment and assign that as the new scrollbar's adjustment object. There is no working horizontal adjustment object in GtkText.

See also: GtkAdjustment, GtkVScrollbar. GtkHSeparator Horizontal separator. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkSeparator `-- GtkHSeparator Direct subclasses None. Descrio A GtkHSeparator is a widget that consists of a horizontal line. It is used to separate widgets that are laid out vertically. Separators cannot be added to menu widgets. See GtkMenuItem for details. See also: GtkVSeparator, gtk::paint_hline() . Construtor GtkHSeparator (void); -- Draws a horizontal line. GtkHSeparator Construtor GtkHSeparator (void); Constructing a GtkHSeparator and adding it to a widget amounts to the same thing as drawing a horizontal line across that widget. Use the container's packing methods to organise spacing around the separator. GtkImage Widget for displaying a graphical image. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkMisc `-- GtkImage Direct subclasses

None. Descrio The GtkImage class is not implemented in PHP-GTK. Use GtkPixmap instead. GtkInputDialog Standard dialog for configuring input devices. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkWindow `-- GtkDialog `-- GtkInputDialog Direct subclasses None. Descrio Construtor GtkInputDialog (void); -GtkInputDialog Construtor GtkInputDialog (void); GtkInvisible Internally used widget which is not displayed. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkInvisible Direct subclasses None.

Descrio Construtor GtkInvisible (void); -GtkInvisible Construtor GtkInvisible (void); GtkItem Abstract base class for GtkMenuItem, GtkListItem, and GtkTreeItem. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkItem Direct subclasses GtkListItem, GtkMenuItem, GtkTreeItem Descrio GtkItem provides the toggle() method and "select", "deselect" and "toggle" signal prototypes for GtkMenuItem, GtkListItem, and GtkTreeItem. Note that GtkItem is an abstract base class and cannot be constructed directly. Mtodos select() Emits "select" signal. deselect() Emits "deselect" signal. toggle() Emits "toggle" signal. Sinais "select" Emitted when user selects item using mouse-click. "deselect"

Emitted when user deselects item using mouse-click. "toggle" Emitted when user selects or deselects item using Enter key. GtkItem::select void select(void); select() is part of a function/signal pair serving as a basis for methods of the same name lower in the hierarchy. It enables the relevant implementation of the select signal to be emitted programmatically. GtkItem::deselect void deselect(void); deselect() is part of a function/signal pair serving as a basis for methods of the same name lower in the hierarchy. It enables the relevant implementation of the deselect signal to be emitted programmatically. GtkItem::toggle void toggle(void); toggle() enables the relevant implementation of the toggle signal to be emitted programmatically. select The "select" signal is emitted when the select() is called within the program, or when the cursor enters the item's screen area. There is no behaviour defined at base level for this signal, please refer to the description in the deselect method in the non-abstract class you are using. Funo Callback void callback(GtkItem item); deselect The "deselect" signal is emitted when the deselect() is called within the program, or when the cursor leaves the screen area of the GtkItem. There is no behaviour defined at base level for this signal, please refer to the description in the deselect method in the non-abstract class you are using. Funo Callback

void callback(GtkItem item); toggle The "toggle" signal is emitted when the toggle() is called within the program, or when the user presses the enter or spacebar key while the connected GtkItem has focus. Beyond that, this signal also has no behaviour defined at base level. In GtkListItem and GtkTreeItem, the "toggle" signal switches states between GTK_STATE_SELECTED and GTK_STATE_NORMAL; these GtkStateType enumerations are by default colour-coded, providing visual cues for the end user as well as a value within the program. GtkMenuItem inherits the "toggle" signal without adding to it, i.e. it is there in theory but has no functionality in practice. It is worth noting that both GtkListItem and GtkTreeItem are deprecated in future versions of GTK+, so that it would seem reasonable to expect the "toggle" signal to disappear too over time. Funo Callback void callback(GtkItem item); GtkItemFactory A factory class for simplified menu creation. Hierarquia do Objeto GtkObject `-- GtkItemFactory Direct subclasses None. Descrio The GtkItemFactory is a class which makes it very easy to create a lot of menu items at once. It supports nested menus, shortcuts and different menu item types as well. GtkItemFactory has been deprecated since GTK+ 2.0 and should not be used in newly written code. Construtor GtkItemFactory (GtkType container_type, String path, GtkAccelGroup accel_group); -- Creates a new instance of this class.

Mtodos create_items() Creates the whole menu. get_item() Obtains the menu item which corresponds to path. get_widget() Obtains the widget item which corresponds to path. get_widget_by_action() Obtains the widget which was constructed from the GtkItemFactoryEntry with the given action. get_item_by_action() Obtains the menu item which was constructed from the first GtkItemFactoryEntry with the given action. delete_item() Deletes the menu item which was created for path by the given item factory. popup() Pops up the menu at (x, y). GtkItemFactory Construtor GtkItemFactory (GtkType container_type, String path, GtkAccelGroup accel_group); Creates a new instance of the GtkItemFactory class. One factory can be used for one menu, and not more. This means that if you want to have a standard GtkMenuBar at the top of a window and an additional right-click popup menu, you have to use 2 item factories. The container_type determines, which type the root menu will have: GtkMenu, GtkMenuBar or GtkOptionMenu. To get the GtkType you want, just use the the get_type() function of this class: $type = GtkMenuBar::get_type(); The path is a unique name for this menu, enclosed in < and >, e.g. <mainmenu>. This path has to be unique in the whole application. The accel_group is the accelerator group belonging to this window and is responsible for the menu shortcuts. It can be NULL, but then the menu shortcuts won't work. Exemplo 18. Using a GtkItemFactory <?php if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); }

$window = &new GtkWindow(); $window->set_default_size( 300, 20); $window->connect_object('destroy', array('gtk', 'main_quit')); $accelgroup = &new GtkAccelGroup(); $window->add_accel_group( $accelgroup); $fac = &new GtkItemFactory( GtkMenuBar::get_type(), "<mainmenu>", $accelgrou p); function quit( $number, $item) { gtk::main_quit(); } $arItems = array( array( "/_File/_Open", null, null, 0, null ), array( "/_File/_Save", null, null, 0, null ), array( "/_File/_Quit", "<CTRL>Q", 'quit', 0, null ) ); $fac->create_items( $arItems); $window->add( $fac->get_widget( "<mainmenu>")); $window->show_all(); gtk::main(); ?> A more sophisticated example can be found at the create_items() function. GtkItemFactory::create_items boolean create_items(Array items); You usually create your menu by calling this method with an array full of menu item definitions. Such a item definition is an array itself and has the following structure: String path, String accelerator, Mixed callback, int callback_action, String type The function can be called several times, causing the new items to be appended to the existing ones. If you add a first-level menu item on a second create_items call, an existing <LastBranch> will lose its right alignment. The path is the name describing the path form the top down to this item. The levels are separated with a slash /, and underscores _ can be used to create in-menu accelerators. "/_File/_Recent files/_1 test.xml" "/_File/O_pen" It is not necessary to explicitly create the parent items if you create a submenu item; this is done automatically. The accelerator sets the shortcut for the menu item; it can be NULL or a combination of modifiers and chars.

Tabela 4. Accelerator modifiers <ALT> <CTL> or <CTRL> or <CONTROL> <MOD1> to <MOD5> <SHFT> or <SHIFT> As usually, the callback accepts the String of the function to call, or an array with the reference to an object as first, and the name of the object's function as the second parameter. This parameter can be NULL. Unlike many other callback registering functions, this one doesn't support own parameters as callback_option. Instead, you can give a number (int) only to describe the function of the menu item. So you can use 1 for opening and 2 for saving to distinguish both when they use the same callback. The callback function needs to implement 2 parameters:int callback_option, GtkMenuItem item. The parameter has to be of type int, so a NULL cause an error. The type is a string from this list: Tabela 5. GtkItemFactory item types Type Description NULL or '' or <Item> Simple item <Title> Title item which can't be clicked. <CheckItem> Check item <ToggleItem> Toggle item <RadioItem> (Root) radio item Path Sister radio item for another radio item <Tearoff> Tearoff <Separator> Separator <Branch> Item to hold submenus (optional) <LastBranch> Right justified branch. This is only useful for one submenu of a menubar. Exemplo 19. Extensive GtkItemFactory::create_items example <?php if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); } $window = &new GtkWindow(); $window->set_default_size( 300, 20); $window->connect_object('destroy', array('gtk', 'main_quit')); $accelgroup = &new GtkAccelGroup(); $window->add_accel_group( $accelgroup); $fac = &new GtkItemFactory( GtkMenuBar::get_type(), '<mainmenu>', $accelgrou p); function menucall( $number, $item) { switch( $number) {

case 1: echo 'New file'; break; case 15: echo 'This is a small GtkItemFactory example'; break; case 20: gtk::main_quit(); break; default: echo 'Unknown action ' . $number; } echo "\r\n"; } $arItems = array( array( '/_File/_New', '<CTRL>N', 'menucall', 1, null ), array( '/_File/_Open', '<CTRL>O', 'menucall', 2, '' ), array( '/_File/sep1', null, null, 0, '<Separator>' ), array( '/_File/_Save', '<CTRL>S', 'menucall', 0, null ), array( '/_File/Save _as', null, 'menucall', 0, null ), array( '/_File/sep2', null, null, 0, '<Separator>' ), array( '/_File/_Quit', '<CTRL>Q', 'menucall', 20, null ), array( '/_View', null, null, 0, '<Branch>' ), array( '/_View/tearoff', null, null, 0, '<Tearoff>' ), array( '/_View/_Toolbar', null, null, 0, '<CheckItem>' ), array( '/_View/_Preview', null, null, 0, '<CheckItem>' ), array( '/_Colors/tearoff', null, null, 0, '<Tearoff>' ), array( '/_Colors/Foreground', null, null, 0, '<Title>' ), array( '/_Colors/White', null, null, 0, '<RadioItem>' ), array( '/_Colors/Yellow', null, null, 0, '/Colors/White' ), array( '/_Colors/Orange', null, null, 0, '/Colors/White' ), array( '/_Colors/sep1', null, null, 0, '<Separator>' ), array( '/_Colors/Background', null, null, 0, '<Title>' ), array( '/_Colors/Black', null, null, 0, '<RadioItem>' ), array( '/_Colors/Blue', null, null, 0, '/Colors/Black' ), array( '/_Colors/Red', null, null, 0, '/Colors/Black' ), array( '/_Help', null, null, 0, '<LastBranch>' ), array( '/_Help/_About', 'F1', 'menucall', 15, '<Item>' ) ); $fac->create_items( $arItems); //By default, the first item of a radio group is selected. We change this $mnuColorRed = $fac->get_widget( '/Colors/Red'); $mnuColorRed->set_active( true); $arMoreItems = array( array( '/_View/sep1', null, null, 0, '<Separator>' ), array( '/_View/more/items/are/appended/here', null, null, 0, null) ); $fac->create_items( $arMoreItems); $window->add( $fac->get_widget( "<mainmenu>")); $window->show_all(); gtk::main(); ?>

GtkItemFactory::get_item GtkWidget get_item(String path); If the widget corresponding to path is a menu item which opens a submenu, then the item is returned. If you are interested in the submenu, use get_widget() instead. GtkItemFactory::get_widget GtkWidget get_widget(String path); If the widget corresponding to path is a menu item which opens a submenu, then the submenu is returned. If you are interested in the menu item, use get_item() instead. GtkItemFactory::get_widget_by_action GtkWidget get_widget_by_action(int action); Obtains the widget which was constructed from the GtkItemFactoryEntry with the given action. If there are multiple items with the same action, the result is undefined. It is NOT an array as you may have assumed - it is probably one of the items found. GtkItemFactory::get_item_by_action GtkWidget get_item_by_action(int action); Obtains the item which was constructed from the GtkItemFactoryEntry with the given action. If there are multiple items with the same action, the result is undefined. It is NOT an array as you may have assumed - it is probably one of the items found. The difference between item and widget is explained in get_item() . GtkItemFactory::delete_item void delete_item(string path); Deletes the menu item which was created for path by the given item factory. GtkItemFactory::popup void popup(int x, int y, int mouse_button, int time); Pops up the complete menu at (x, y). The mouse_button parameter should be the mouse button pressed to initiate the menu popup. If the menu popup was initiated by something other than a mouse button press, such as a mouse button release or a keypress, mouse_button should be 0.

GtkLabel Widget that displays a small amount of text. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkMisc `-- GtkLabel Direct subclasses GtkAccelLabel, GtkTipsQuery Descrio A very common use of GtkLabel is to display text that describes or makes some comment about the use of an adjacent widget. If you need to display a great deal of text, use GtkText instead. Note that labels do not generate events. If you want to catch events (e.g. from a mouse click) you will need to put the label in a GtkEventBox. See also: GtkEditable, GtkEventBox, GtkText. Construtor GtkLabel ([string label_text ]); -- Creates a new label with the given text inside it. If no text is specified, an empty label is created. Mtodos set_text() Sets the label text. set_justify() Sets label justification. set_pattern() Underlines text in the label. set_line_wrap() Toggles line wrapping. get() Gets label text. *deprecated in GTK2* parse_uline() Parses underscores into underlines. *deprecated in GTK2*

GtkLabel Construtor GtkLabel ([string label_text ]); Exemplo 20. Aligning the text in a GtkLabel <?php if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); } $window = &new GtkWindow(); $window->set_default_size(300, 70); $window->connect_object('destroy', array('gtk', 'main_quit')); $label = &new GtkLabel("This is my label"); //move it to the lower right $label->set_alignment(1.0, 1.0); //give it a nice font and color $style = $label->get_style(); $style->font = gdk::font_load( '-*-Arial-bold-r-normal-*-24-*-*-*-*-*-*-*'); $orange = &new GdkColor( '#FF8000');; $style->fg[GTK_STATE_NORMAL] = $orange; $label->set_style( $style); //you can't set the background color of a label, use the parent widget instead $wstyle = $window->get_style(); $wstyle->bg[GTK_STATE_NORMAL] = $wstyle->black; $window->set_style( $wstyle); $window->add($label); $window->show_all(); gtk::main(); ?> The set_alignment() method is inherited from GtkMisc. GtkLabel::set_text void set_text(string label_text ); Sets the text for the label widget. Previous text in the label is not stored. Note that any existing underlines are not overwritten in the same way that text is; use set_pattern() with no parameters to erase these. $label->set_text("Whatever text you wish to pass"); GtkLabel::set_justify void set_justify( GtkJustification justification );

set_justify() is the method for justifying text in GtkLabel. The options are GtkJustification enumerated flags, the default setting being GTK_JUSTIFY_CENTER. Justification is relative to existing lines of text, and should be used in combination with set_line_wrap() . It is irrelevant where there is only one line. If you need to set the text alignment in a single-line label, use set_alignment() . There is a working example of this method on the constructor page. <?php $label->set_line_wrap(true); $label->set_justify(GTK_JUSTIFY_FILL); ?> GtkLabel::set_pattern void set_pattern([string pattern = NULL ]); set_pattern() is the method for underlining text in GtkLabel. It needs to be defined as a pattern, e.g. if your text consists of A B C, then "_ _" will underline A and C but not B, as that is where the space falls. Each underscore or space in the pattern maps directly to the character position in the label text. $label->set_pattern("_ _"); Call this method with no parameters to erase existing underlines. GtkLabel::set_line_wrap void set_line_wrap(bool wrap); Toggles line wrapping in the label. If wrap is true, the lines exceeding the size of the widget will be automatically wrapped. Where wrap is false, those lines will be cut off at the widget's edge. $label->set_line_wrap(true); GtkLabel::get string get(void ); Returns the current text content of the label. Note that this method is deprecated in GTK 2.0, and will be replaced by get_text(). $label->get(); GtkLabel::parse_uline

int parse_uline(string string); parse_uline() checks the string passed as the parameter for underscores, and then underlines the characters following the underscores. It will take the first underlined character in a label and return it as a lower-case accelerator key, e.g. _Save will return the accelerator key value for "s". This method is used internally by Gtk+ for menu items. Note that this method is deprecated in GTK+ 2.0. $label->parse_uline("_File"); GtkLayout Scrollable widget allowing multiple children in fixed positions. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkLayout Direct subclasses None. Descrio A GtkLayout is a scrollable widget that provides a scrolling-aware backdrop for a child or children having fixed positions. It should be added directly to a GtkScrolledWindow. Note that the scrolling does not work on win32 unless you program it to do so. There have been no such problems reported on other systems. The workaround under win32 is to connect the GtkScrolledWindow scrollbar adjustments' "value-changed" signals to a function that will force the GtkLayout to be redrawn. This can be queue_draw() in most situations, but the more complex child widgets will not respond to this alone and will need to have hide() and then show() called on the GtkLayout during the callback. Note that GtkHtml is based on the GtkLayout class, and that similar redraw issues are seen with that widget. Construtor GtkLayout ( GtkAdjustment hadjustment , GtkAdjustment vadjustment ); -- Creates a scrollable backdrop whose children retain their positions.

Mtodos put() Fixes a child widget at the given position. move() Moves a child widget to a new position. set_size() Sets the size of the layout. get_hadjustment() Returns the horizontal adjustment object. get_vadjustment() Returns the vertical adjustment object. freeze() Freezes the display during an update. thaw() Allows the display to be updated. GtkLayout Construtor GtkLayout ( GtkAdjustment hadjustment , GtkAdjustment vadjustment ); The following example is based on the GTK+ test file testgtk.c. Unix users will not need to use the callback function in order to achieve scrolling, but it shouldn't do any harm to run it as it stands. Win32 users will find that the labels are redrawn and the buttons are not, giving a somewhat psychedelic effect. To redraw both types of object under win32, replace the callback function with: <?php function exposure($adj, $layout) { $layout->hide(); $layout->show(); } ?> Exemplo 21. Forcing a GtkLayout to redraw <?php dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); /* callback that forces a redraw of simple child widgets */ function exposure($adj, $layout) { $layout->queue_draw(); } /* set up a window and size it to be smaller than the intended layout */ $window = &new GtkWindow();

$window->set_position(GTK_WIN_POS_CENTER); $window->set_title('Layout'); $window->set_usize(200, 200); $window->connect_object('destroy', array('gtk', 'main_quit')); /* create and add the scrolled window to the main window */ $scrolledwindow = &new GtkScrolledWindow(); $window->add($scrolledwindow); /* create and add the layout widget to the scrolled window */ $layout = &new GtkLayout(null, null); $scrolledwindow->add($layout); /* set the layout to be bigger than the windows that contain it */ $x = gdk::screen_width(); $y = gdk::screen_height(); $layout->set_size($x, $y); /* get the adjustment objects and connect them to the callback. This part should not be necessary under *nix systems */ $hadj = $scrolledwindow->get_hadjustment(); $vadj = $scrolledwindow->get_vadjustment(); $hadj->connect('value-changed', 'exposure', $layout); $vadj->connect('value-changed', 'exposure', $layout); /* populate the layout with a mixture of buttons and labels */ for ($i=0 ; $i < round($y/100); $i++) { for ($j=0 ; $j < round($x/100); $j++) { $buf =sprintf('Button %d, %d', $i, $j); if (($i + $j) % 2) $button = &new GtkButton($buf); else $button = &new GtkLabel($buf); $layout->put($button, $j*100, $i*100); } } /* display everything and run the main loop */ $layout->show_all(); $window->show_all(); gtk::main(); ?> add is not implemented for GtkLayout. You must use put to add children to the layout. GtkLayout::put void put( GtkWidget widget , int x, int y); This method adds a child widget to the layout. The top left corner of the child widget will be positioned at the co-ordinates passed in the x, y parameters.

GtkLayout::move void move( GtkWidget widget , int x, int y); This method takes a child widget that has already been added to the GtkLayout and moves it to a new position reflecting the co-ordinates passed in the parameters. GtkLayout::set_size void set_size(int width, int height); Sets the size of the GtkLayout. If you do not call this method the layout will size itself according to the size allocation given it by the parent window, rather than the size requisition of the layout's child widgets. GtkLayout::get_hadjustment GtkAdjustment get_hadjustment (void); This method is used internally to set the horizontal scrollbar adjustment in the GtkScrolledWindow holding the GtkLayout. These sets of adjustment objects are interchangeable, i.e. they share the same values. GtkLayout::get_vadjustment GtkAdjustment get_vadjustment (void); This method is used internally to set the vertical scrollbar adjustment in the GtkScrolledWindow holding the GtkLayout. These sets of adjustment objects are interchangeable, i.e. they share the same values. GtkLayout::freeze void freeze(void); Use freeze() when you are updating a large amount of data, e.g. a large pixmap or series of pixmaps. Calling this method prior to the update will speed up the process and reduce flicker. See also: thaw() . GtkLayout::thaw void thaw(void); thaw() is the corollary of freeze() . It allows the display to be redrawn after the new data is fully assimilated. GtkList

Widget displaying a list of selectable items. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkList Direct subclasses None. Descrio A GtkList is a container widget that is designed to hold a simple list, the full range of which is displayed. The items held in the list are selectable, with the default selection mode set as GTK_SELECTION_SINGLE. Each item in the list must be a GtkListItem widget. Glade users will find that they need to code these manually in order to populate a list or combo box. The signal part of the function/signal pair for most of the methods given here is private in GtkList, but is also implemented in GtkListItem. As this secondary implementation is also private, these signals are not covered in this manual. Although those signals that have GTK keybindings will cause the appropriate signal to be publicly fired when their key combinations are used, there is no other way to emit this range of signals. The keybindings are listed under GtkListItem; the signal prototypes share the relevant GtkList method's parameters, should you need to connect to them. If you need a list with multiple columns and/or titles with sorting support, GtkCList is the right class for you. See also: GtkCList, GtkCombo, GtkListItem. GtkList has been deprecated since GTK+ 2.0 and should not be used in newly written code. Construtor GtkList (void); -- Creates a container for a simple list. Mtodos append_items() Appends an array of list items to a list. clear_items() Clears designated list items from list.

select_item() Causes the "select-child" signal to be emitted. unselect_item() Causes the "unselect-child" signal to be emitted. select_child() Causes the "select-child" signal to be emitted. unselect_child() Causes the "unselect-child" signal to be emitted. child_position() Returns item specified by list position. set_selection_mode() Sets the selection mode. extend_selection() Extends selected area to position given. start_selection() Selects range from anchor to currently selected item. end_selection() Curtails selection set with start_selection() . select_all() Selects all list items. unselect_all() Deselects all list items. scroll_horizontal() Sets associated horizontal scrollbar to a predetermined position. scroll_vertical() Sets associated vertical scrollbar to a predetermined position. toggle_add_mode() Toggles whether further selections may be added in extended mode. toggle_focus_row() Toggles selection status of row with focus. toggle_row() Toggles selection status of specified row. undo_selection() In extended mode, returns selection to its previous state. end_drag_selection() Ends drag selection.

Sinais "selection-changed" Emitted when the selection property is changed. "select-child" Emitted when a list item is selected. "unselect-child" Emitted when a list item is deselected. Propriedades selection: Array containing current selection information. GtkList Construtor GtkList (void); Creating a GtkList widget is straightforward, populating it slightly less so. Each item added to the list container must itself be contained in a GtkListItem. In its simplest and most common form, all that means is that the GtkListItem is created with a label, the text content of which will be displayed in the list. Exemplo 22. Constructing a GtkList <?php if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); } function echo_it($list, $listitem) { /* collect the text from the selected list item's label */ $listlabel = $listitem->child; /* filter list items according to child object type */ if($listlabel->get_name() == 'GtkLabel') { $name = $listlabel->get(); $label = &new GtkLabel("You chose $name just now"); /* create a popup window and display a message relevant to selected item */ $popup = &new GtkWindow(GTK_WINDOW_POPUP); $popup->set_uposition((gdk::screen_width()/2)+50, (gdk::screen_height()/3)); $popup->add($label); $popup->show_all(); /* connect the list item's own deselect signal (not the list's) */ $listitem->connect_object('deselect', create_function('$popup', '$popup->destroy();'), $popup); } else gtk::main_quit(); } $window = &new GtkWindow(GTK_WINDOW_DIALOG); $window->set_position(GTK_WIN_POS_CENTER);

$window->connect_object('destroy', array('gtk', 'main_quit')); $list = &new GtkList(); /* the contents of this array will populate the list */ $fill = array('Angela', 'Belinda', 'Carolyn', 'Danike', 'Etha', 'Fiona', 'Gertraud', 'Heidi', 'Jessica', 'Kirstin', 'Lorinda', 'Marianne'); foreach(range(0, count($fill)-1) as $i) $listitem[] = &new GtkListItem($fill[$i]); $list->append_items($listitem); $enditem = &new GtkListItem(); /* a list item is also a container */ $button = &new GtkButton('Close'); $enditem->add($button); /* there is no way to append() a single item - but GtkList is a container widget, so it's okay to use add() */ $list->add($enditem); $list->connect('select-child', 'echo_it'); $list->show_all(); $window->add($list); $window->show_all(); gtk::main(); ?> GtkList::append_items void append_items(Array listItems); This is a widget-specific method for adding an array of GtkListItems to a GtkList. GtkList::clear_items void clear_items(int start, int end); Removes the list items between the positions given in the parameters, from a GtkList. The remaining items close up the gap, always moving closer to the top as there is no way to fix a child's list position. Note that the list container itself is not resized to reflect these changes. GtkList::select_item void select_item(int row); The only difference between select_item() and select_child() is that the former takes the item's list position as a parameter rather than the GtkListItem object itself. In either case, the signal that is actually emitted is the list item's "select" signal - these are just different ways of describing the same thing, providing alternative

means of selection and connection. GtkList::unselect_item void unselect_item(int row); The only difference between unselect_item() and unselect_child() is that the former takes the item's list position as a parameter rather than the GtkListItem object itself. In either case, the signal that is actually emitted is the list item's "deselect" signal - these are just different ways of describing the same thing, providing alternative means of de-selection and connection. GtkList::select_child void select_child( GtkWidget child ); The only difference between select_item() and select_child() is that the former takes the item's list position as a parameter rather than the GtkListItem object itself. In either case, the signal that is actually emitted is the list item's "select" signal - these are just different ways of describing the same thing, providing alternative means of selection and connection. GtkList::unselect_child void unselect_child( GtkWidget child ); The only difference between unselect_item() and unselect_child() is that the former takes the item's list position as a parameter rather than the GtkListItem object itself. In either case, the signal that is actually emitted is the list item's "deselect" signal - these are just different ways of describing the same thing, providing alternative means of de-selection and connection. GtkList::child_position int child_position( GtkWidget child ); child_position() returns the list position currently holding the widget that was passed as the argument. The widget needs to be passed by reference, i.e. using the form $widget. GtkList::set_selection_mode void set_selection_mode( GtkSelectionMode mode ); Sets one of the four possible GtkSelectionMode enumerated values. The default setting is GTK_SELECTION_SINGLE. GtkList::extend_selection void extend_selection( GtkScrollType scroll_type , double position,

bool auto_start_selection); This is quite a complex method that can only be used when the selection mode is set to GTK_SELECTION_EXTENDED. It duplicates and resets the focus row (i.e. the row that is marked as selected) and highlights all the items between that and the anchor item. It has different behaviours depending on whether or not the list has keyboard grab, so that putting it into a callback function does not have the same results as calling it from the main loop. Selection of all the items in the highlighted range requires that scroll_vertical() is also set appropriately. In general, calling the extend_selection() method will only select the last row with focus. It needs to have toggle_add_mode() set in order to do this when scroll_vertical() is set after the list widget has grab. As with scroll_vertical() , this method's position parameter is used only when the GtkScrollType value is set to GTK_SCROLL_JUMP, and represents a percentage of the area covered by the scroll. The final parameter negates the method's functionality completely if set to false. GtkList::start_selection void start_selection(void); start_selection() selects the range between the anchor item - 0 on first opening or the most recent selection thereafter - and the next selection that is made. For instance, if you were to select item 4 on opening, the selection range would run as 4, 0, 1, 2, 3. If you then selected item 7 the new range would be 7, 4, 5, 6. Further items can be included in the selection by dragging while the mouse button is still pressed down from selecting the original item. Note that this method can only be used if the list's selection mode is set to GTK_SELECTION_EXTENDED. See also: end_selection() , end_drag_selection() . GtkList::end_selection void end_selection(void); end_selection() ends a selection as it would be if made using start_selection() . It curtails the selection so that only the anchor and the item selected return a "select" signal. Note that this method can only be used if the list's selection mode is set to GTK_SELECTION_EXTENDED. GtkList::select_all

void select_all(void); select_all() selects all the list items in a GtkList. Note that there needs to be the possibility of multiple selection for this method to work; see set_selection_mode() . GtkList::unselect_all void unselect_all(void); The corollary to select_all() , this method can also be used to clear the initial focus when the selection mode has been set to GTK_SELECTION_BROWSE. GtkList::scroll_horizontal void scroll_horizontal( GtkScrollType scroll_type , double position); This method needs set_focus_hadjustment() to be called on the appropriate scrollbar from the GtkList in order for it to work. It scrolls the list horizontally to a predetermined position according to the GtkScrollType. The position parameter is only used where the enumerated value is GTK_SCROLL_JUMP, when 0.0 sets the scroll to the (default) leftmost point and 1.0 to the rightmost. Values between 0.0 and 1.0 describe the percentage of the distance scrolled, i.e. 0.5 would set the beginning of the scroll slider halfway across the area. Where any other GtkScrollType is set, the position is required but is then ignored. GtkList::scroll_vertical void scroll_vertical( GtkScrollType scroll_type , double position); This method needs set_focus_vadjustment() to be called on the appropriate scrollbar from the GtkList in order for it to work. It scrolls the list to a predetermined position according to the GtkScrollType setting and, if a selection has been made and the list's selection mode allows it, will automatically select the child nearest to the new scroll position. The position parameter is only used where the enumerated value is GTK_SCROLL_JUMP, when 0.0 sets the scroll to the topmost item and 1.0 to the final item. Values between 0.0 and 1.0 describe the percentage of the distance scrolled, i.e. 0.5 would set the scroll so that the last visible item is the one holding the halfway position in the list. Where any other GtkScrollType is set, the position is required but is then ignored. GtkList::toggle_add_mode

void toggle_add_mode(void); When toggle_add_mode() has been called, the grab in a GTK_SELECTION_EXTENDED mode list will remain with the anchor item at the start of the selection, regardless of where the focus falls, until another item is actually selected. Effectively it switches the list to something very like GTK_SELECTION_BROWSE mode. The item that currently has grab has a dashed line around it to signify its status, as well as the usual GTK_STATE_SELECTED style. GtkList::toggle_focus_row void toggle_focus_row(void); If the row having current focus is marked as selected, calling toggle_focus_row() will unselect it, and vice versa. In both cases the appropriate signal is fired. This method would be pointless in a list set to GTK_SELECTION_BROWSE, and so is not implemented there. GtkList::toggle_row void toggle_row( GtkWidget item ); If the item specified in the parameter is marked as selected, calling toggle_row() will unselect it, and vice versa. In both cases the appropriate signal is fired. If the selection mode is GTK_SELECTION_BROWSE, the item will always be selected. GtkList::undo_selection void undo_selection(void); This method returns selection to its previous state if the list mode is set to GTK_SELECTION_EXTENDED. It is not implemented in any other mode. GtkList::end_drag_selection void end_drag_selection(void); This method is used extensively within GTK to complete a selection. It removes the grab from the list, and also the internal timer associated with the drag action. It is unlikely to be very useful at this level. selection-changed The "selection-changed" signal is emitted whenever there is a change in the list's selection property, regardless of whether that change empties the array.

As there is no way to track back which particular item has been selected or unselected, you should use the "select-child" if you need that piece of information. Funo Callback void callback(GtkList list); select-child The "select-child" signal is emitted when a child is selected. It carries the selected child as an argument. This signal is basically a wrapper for the "select" signal emitted by the GtkListItem that is currently selected. If you mix the two, the same item will emit the same signal twice in response to selection. Funo Callback void callback(GtkList list, GtkWidget child); unselect-child The "unselect-child" signal is emitted when a child is deselected. It carries the deselected child as an argument. This signal is basically a wrapper for the "deselect" signal emitted by the GtkListItem that has just been deselected. If you mix the two, the same item will emit the same signal twice in response to deselection. Funo Callback void callback(GtkList list, GtkWidget child); GtkList::selection Access: Read Only Type: array The selection property is an array that contains any currently selected items. If there is no current selection, the array will be empty. If the selection mode does not allow multiple selection, $list->selection[0]; will return the selected item. If the selection mode allows multiple selection, there will be as many elements in the array as there are currently-selected objects. See also: children() . GtkListItem

A single element in a GtkList. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkItem `-- GtkListItem Direct subclasses None. Descrio A GtkListItem is one of the elements that makes up a GtkList. It can consist of many things - see the constructor page - being basically a container with a specialised set of methods and signals. GtkListItems are not equipped to carry data, unless you make it so. Using the GtkObject methods get_data() , remove_data() and set_data() is the usual way to achieve this. See GtkCombo for a working example. The GtkListItem class supplies a multitude of signals to the list widget recursively, where they are treated as private signals and used internally. Several of these signals have keybindings, implemented here rather than in GtkList of necessity, which are described below. Tabela 6. Key bindings used in GtkList Key combination Effect Equivalent GtkList method Up arrow Scrolls up one step scroll_vertical(GTK_SCROLL_STEP_BACKWARD, 0.0) Down arrow Scrolls down one step scroll_vertical(GTK_SCROLL_STEP_FORWARD, 0.0) Page Up Scrolls up one page scroll_vertical(GTK_SCROLL_PAGE_BACKWARD, 0.0) Page Down Scrolls down one page scroll_vertical(GTK_SCROLL_PAGE_FORWARD, 0.0) Control + Home Scrolls to the top of the list scroll_vertical(GTK_SCROLL_JUMP, 0.0) Control + End Scrolls to the end of the list scroll_vertical(GTK_SCROLL_JUMP, 1.0) Shift + Up arrow Selects up one step extend_selection(GTK_SCROLL_STEP_BACKWARD, 0.0, true) Shift + Down arrow Selects down one step extend_selection(GTK_SCROLL_STEP_FORWARD, 0.0, true) Shift + Page Up Selects up one page extend_selection(GTK_SCROLL_PAGE_BACKWARD, 0.0, true) Shift + Page Down Selects down one page

extend_selection(GTK_SCROLL_PAGE_FORWARD, 0.0, true) Shift | Control + Home Selects to the top of the list extend_selection(GTK_SCROLL_JUMP, 0.0, true) Shift | Control + End Selects to the end of the list extend_selection(GTK_SCROLL_JUMP, 1.0) Left arrow Scrolls one step to the left scroll_horizontal(GTK_SCROLL_STEP_BACKWARD, 0.0) Right arrow Scrolls one step to the right scroll_horizontal(GTK_SCROLL_STEP_FORWARD, 0.0) Home Scrolls to the left of the list scroll_horizontal(GTK_SCROLL_JUMP, 0.0) End Scrolls to the right of the list scroll_horizontal(GTK_SCROLL_JUMP, 1.0) Escape Returns to previous selection undo_selection() Space Toggles state of row with current focus toggle_focus_row() Control + Space Toggles whether further items can be selected toggle_add_mode() Control + / Selects all items select_all() Control + \\ Deselects all items unselect_all() Shift_L + Release | Shift Completes selection end_selection() Shift_R + Release | Shift Completes selection end_selection() Shift_R + Release | Shift | Control Completes selection end_selection() GtkListItem has been deprecated since GTK+ 2.0 and should not be used in newly written code. Construtor GtkListItem ([string label ]); -- Creates a list element. Mtodos select() Causes the "select" signal to be emitted. deselect() Causes the "deselect" signal to be emitted. GtkListItem Construtor GtkListItem ([string label ]); A GtkListItem is a container widget, derived indirectly from GtkBin and so only able to hold one direct child. Most of the time, the child you will want the list item to contain will be a GtkLabel - and so, in common with all objects that have an alternative '-with-label' constructor available in GTK, we have the option in PHP-GTK to pass the label's text as a parameter during construction, e.g. <?php $listitem = &new GtkListItem("This list item now has a label");

?> If you wanted something other than a label in the list item, you simply omit the parameter and add the required widget: <?php $arrow = &new GtkArrow(GTK_ARROW_RIGHT, GTK_SHADOW_ETCHED_IN); $listitem = &new GtkListItem(); $listitem->add($arrow); ?> or, if you wanted perhaps a label plus some other item: <?php $box = &new GtkHBox(); $label = &new GtkLabel("Here we have multiple objects in a GtkListItem"); $arrow = &new GtkArrow(GTK_ARROW_RIGHT, GTK_SHADOW_ETCHED_IN); $box->pack_start($label); $box->pack_end($arrow); $box->show_all(); $listitem = &new GtkListItem(); $listitem->add($box); ?> Whatever your list item consists of, the GtkList will only respond to it as a GtkListItem. If you have different kinds of list item contents in the same list, you will need to exercise a great deal of caution if you are connecting callbacks to any form of select signal. See also: GtkList, which has a working example under the constructor. GtkListItem::select void select(void); The GtkListItem method select() causes the list item to emit the GtkItem signal "select". This is then bound recursively to the GtkListItem implementation of that signal. The same sequence of events is produced by calling the GtkList method select_child() . The easy part: it sets the GtkStateType of the calling list item to GTK_STATE_SELECTED. Note that this state can also be achieved programmatically by calling toggle() from a list item that is currently unselected.

GtkListItem::deselect void deselect(void); The GtkListItem method deselect() causes the list item to emit the GtkItem signal "deselect". This is then bound recursively to the GtkListItem implementation of that signal. The same sequence of events is produced by calling the GtkList method unselect_child() . The easy part: it sets the GtkStateType of the calling list item to GTK_STATE_NORMAL. Note that this state can also be achieved programmatically by calling toggle() from a list item that is currently selected. GtkMenu Popup container for menu items. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkMenuShell `-- GtkMenu Direct subclasses None. Descrio GtkMenu is a menushell widget, designed to exclusively hold GtkMenuItems. It may be a standalone popup widget, or may be associated either with a higher-level GtkMenuItem within a GtkMenuBar, or with a GtkOptionMenu. Note that a GtkMenu in any form is effectively a modal popup widget. There are keybindings in place here specifically to counteract this apparent isolation, by allowing the Up, Down, Left and Right arrow keys to navigate multiple menus with regard to the relationships between those menus (i.e. parent and child, next and previous). These are fairly rudimentary in the current version of GTK+ used in PHP-GTK, but have been improved recently. See also: GtkCombo, GtkCTree, GtkItemFactory, GtkList, GtkRadioButton, GtkToolbar. Construtor GtkMenu (void);

-- Creates the structure to hold a menu's content. Mtodos popup() Pops up a menu. reposition() Repositions menu. popdown() Pops down menu. get_active() Gets currently selected GtkMenuItem. set_active() Sets active menu item. set_accel_group() Sets the GtkAccelGroup holding global accelerators. get_accel_group() Gets the GtkAccelGroup holding global accelerators. get_uline_accel_group() Gets the internally-used GtkAccelGroup, if there is one. ensure_uline_accel_group() Creates a GtkAccelGroup for internal menu use if one does not exist. attach_to_widget() Sets attachment to specified widget. detach() Detaches menu from associated widget. get_attach_widget() Returns the widget currently attached. set_tearoff_state() Toggles whether menu is torn off. set_title() Sets the title for a torn off menu. reorder_child() Moves specified item to given position. GtkMenu Construtor GtkMenu (void);

<?php $menu = &new GtkMenu(); ?> creates an empty popup container widget that will exclusively hold GtkMenuItems. It may be instantiated alone as an event-driven popup menu (see the example below) or it can be associated with a higher-level GtkMenuItem as a submenu, or a GtkOptionMenu as a menu. When it is associated with an object in this way, the menu will pop up in response to the object's activation. Exemplo 23. Creating a right-click popup menu <?php if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); } function show_popup($event, $menu) { if($event->button == 3) { $menu->popup(null, null, null, $event->button, $event->time); } } $window = &new GtkWindow(); $window->set_default_size(350, 450); $window->connect_object('destroy', array('gtk', 'main_quit')); $menu = &new GtkMenu(); $accel = $menu->ensure_uline_accel_group(); $open = &new GtkMenuItem("Open"); $open->lock_accelerators(); $menu->append($open); $save = &new GtkMenuItem("Save as ..."); $save->lock_accelerators(); $menu->append($save); $separator = &new GtkMenuItem(); $separator->set_sensitive(false); $menu->append($separator); $exit = &new GtkMenuItem(""); $accel_label = $exit->child; $accel_key = $accel_label->parse_uline("E_xit"); $exit->add_accelerator('activate', $accel, $accel_key, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); $exit->lock_accelerators(); $exit->connect_object('activate', array('gtk', 'main_quit')); $menu->append($exit); $menu->show_all(); $label = &new GtkLabel( 'Right-click here to see the menu'); $window->add( $label);

$window->add_events(GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK); $window->connect_object('button-press-event', 'show_popup', $menu); $window->show_all(); gtk::main(); ?> GtkMenu::popup void popup([ GtkWidget parent_menu_shell , [ GtkWidget parent_menu_item , [ GtkMenuPositionFunc pos_function , int button, int activate_time]]]); The popup() method looks fairly intimidating at the outset, but is actually quite straightforward to use. The first thing to be aware of is that the parent_menu_shell and parent_menu_item parameters would generally only be used internally, to associate the popped-up menu with a given GtkMenuShell descendant, or GtkMenuItem, or both. In a freestanding popup menu, both parameters should be passed as null. The third parameter concerns the positioning of the popup menu, and has as its default the position of the mouse pointer. In order to set a different position, you will need to set up a function that will return an array of the co-ordinates, and call it from the pos_function parameter. <?php function position() { $position = array(300, 200); return $position; } $filemenu->popup(null, null, 'position', $event->button, $event->time); ?> The fourth parameter refers to the mouse button emitting the "button-release-event" that will be compared with the button emitting the "button-press-event" in order to set the timer in the final parameter. This only works if you happen to be triggering the popup function with a button press, and the button pressed and button released are the same - in all other situations, the time element is ignored. However, setting the button parameter to 1 or 3 will speed up the deactivation when the left or right mouse button is released respectively, regardless of the callback event. The final parameter, activate_time, sets the time conditions for the menu's deactivation. If you have used a button press event and ensured that the initial press and later release have the same valid integer

value, then setting the timer to 0 will make the menu disappear as soon as the user releases the mouse-button that triggered it. The safest setting for this parameter is $event->time - this being a setting that all GdkEvent structures share; it causes the popup menu to react as you'd expect it to, and won't spring any surprises if you duplicate or otherwise adapt the original callback event. GtkMenu::reposition void reposition(void); reposition() is used internally to reposition a GtkMenuItem's submenu according to the results of the position function called in the popup() method. GtkMenu::popdown void popdown(void); popdown() is used internally to de-reference a popup menu. It is one of the methods that is called when a menu emits the "deactivate" signal. GtkMenu::get_active GtkWidget get_active (void); get_active() can be used to retrieve the currently selected GtkMenuItem object through the menu. Note that this method returns the menu item object itself, and is really only useful for comparison against a set of criteria. In most instances it would be more efficient to connect the individual menu item's "activate" signal. The get_active() method is used internally in GtkOptionMenu's set_history() to compare the menu item currently selected by the user against that previously displayed. GtkMenu::set_active void set_active(int index); set_active() sets the 'active' GtkMenuItem in a GtkMenu. Note that this is not the same thing as calling the select() from the menu item, but is a way of adding to the given item's reference count from the menu. The set_active() method is mainly used internally in GTK, as part of GtkOptionMenu's set_history() method. GtkMenu::set_accel_group void set_accel_group( GtkAccelGroup accel_group ); set_accel_group() sets the global accelerator group for a GtkMenu. A

GtkAccelGroup set in this way should also be designated as toplevel. This is achieved by calling add_accel_group() from the corresponding toplevel GtkWindow. Note that there is a bug in the win32 version of GTK+ currently used in PHP-GTK. The accelerator key appears as it should, but does not connect to its designated signal where the accel group has been newly created and set in this way. Also, much of the accelerator locking mechanism has been replaced in GTK2. Future-friendly code can be created by using GtkItemFactory to create your menus; however, the same limitations in functionality currently apply. GtkMenu::get_accel_group GtkAccelGroup get_accel_group (void); get_accel_group() returns the global accelerator group that is used in the calling GtkMenu. Note that this method does not work as it should in the win32 version of GTK+ currently used by PHP-GTK. Also, much of the accelerator lock mechanism has been replaced in GTK2. Future-friendly code can be created by using GtkItemFactory to create your menus; however, the same limitations in functionality currently apply. GtkMenu::get_uline_accel_group GtkAccelGroup get_uline_accel_group (void); get_uline_accel_group() returns the GtkAccelGroup used by GTK during the time that the GtkMenu is popped up. It is used internally to allow the user to modify the key accelerators where they have not been locked. Note that this method does not work as it should in the win32 version of GTK+ currently used by PHP-GTK. Also, this method has been eliminated from later versions of GTK+, and much of the accelerator lock mechanism replaced. Future-friendly code can be created by using GtkItemFactory to create your menus; however, the same limitations in functionality currently apply. GtkMenu::ensure_uline_accel_group GtkAccelGroup ensure_uline_accel_group (void); ensure_uline_accel_group() returns the GtkAccelGroup used by GTK during the time that the calling GtkMenu is popped up, if one exists, and creates one for internal use if there is none. This is currently the only way to get accelerators working properly under win32. It is also used internally for popup menus in GtkItemFactory. However, note that this method has been eliminated from later versions of GTK+. The replacements in GtkItemFactory are purely internal; the new methods in GtkMenu are not.

GtkMenu::attach_to_widget void attach_to_widget( GtkWidget attach_widget ); attach_to_widget() is mostly used internally to set up the relationship between the 'parent' - usually a GtkMenuItem - and the GtkMenu that is calling the method. This is not the same thing as setting a submenu for a menu item (use set_submenu() for that), but creates an underlying relationship that subsumes the reference count on the menu to that of the attach_widget. The GtkWidget method set_parent() has very similar functionality, but is not appropriate here because the menu is itself a toplevel widget. GtkMenu::detach void detach(void); detach() detaches the calling GtkMenu from its current parent widget. This method is used internally when the menu is being destroyed. Calling the detach() method after the menu has been set as a submenu, unsets that relationship in exactly the same way as remove_submenu() would. The difference is that the attached widget does not necessarily need to be a GtkMenuItem for detach() to work. GtkMenu::get_attach_widget GtkWidget get_attach_widget (void); get_attach_widget() returns the object to which the calling GtkMenu is currently attached. Use get_name() to further identify the returned object, or else compare it with likely candidates. GtkMenu::set_tearoff_state void set_tearoff_state(bool torn_off); set_tearoff_state() when set to true creates a non-resizeable, decorated, top-level window, sized to fit the menu contents and iconized in the task bar. The torn-off menu does not need a further parent window, and can act as a standalone widget in its own right. Where the same menu has also been set as a submenu on an existing GtkMenuItem or as a popup, the menu data is displayed in the currently-visible menu shell. Note that the GtkMenu in this form is not and cannot be made modal. It could be described as a persistent popup. It is not possible to connect directly to the tearoff window housing the menu, because it has not been exposed as a property in PHP-GTK with good reason, as the reference counting has been juggled in GTK+

to make the widget possible in the first place. In order to connect the window's delete event to something meaningful, you will need to do something like this: <?php dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); function exit_activated($menu) { $menu->destroy(); } $menu = &new GtkMenu(); $window = $filemenu->parent; $window->ref(); $window->set_flags(GTK_HAS_GRAB); $menu->connect_object('destroy', array('gtk', 'main_quit')); /* Append and connect your menu items here, but note that any exit item must call $menu->destroy() rather than the usual gtk::main_quit(), in order to avoid the main loop being quitted twice over */ $exit = &new GtkMenuItem("Exit"); $exit->connect_object('activate', 'exit_activated', $menu); $menu->set_title("Tested!"); $menu->set_tearoff_state(true); $menu->show_all(); gtk::main(); ?> Notice that the "destroy" signal must be connected in this instance, and not the window's "delete-event" signal. This is because the parent window accessed is not the same window as has the window decorations, but is capable of accessing the internal destroy signal triggered by that window if it is given grab beforehand, and can propagate the event to all its children. You will also spot that this means the menu needs to be rebuilt any time it is called. GtkMenu::set_title void set_title(string title); set_title() sets the window title for a menu that has been detached from its parent through either a GtkTearoffMenuItem widget or the set_tearoff_state() method. As with all window titles, the text will be truncated to fit the area available. Note that the title needs to be set prior to the menu's becoming torn off.

If the title is not set, the torn off menu will display in its title bar either the text in the parent GtkMenuItem's label or, where there is none, the full file path. GtkMenu::reorder_child void reorder_child( GtkWidget child , int position); reorder_child() moves the specified GtkMenuItem from its current position in the GtkMenu to the position given. All items prior to the new position remain unchanged, and the later items all move on one. The first position is 0, and the final position can always be found by setting -1. GtkMenuBar Horizontal container for menu items. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkMenuShell `-- GtkMenuBar Direct subclasses None. Descrio A GtkMenuBar is a container that exclusively holds GtkMenuItem widgets, and displays them from left to right. It has key bindings which allow the Up, Down, Left and Right arrow keys to be used for menubar navigation. Note that these do not work in the win32 version of GTK+ used by PHP-GTK. A menu bar with a number of subitems can be easily created with the GtkItemFactory class. Construtor GtkMenuBar (void); -- Constructs a horizontal menu bar. Mtodos set_shadow_type() Alters appearance of menu bar.

GtkMenuBar Construtor GtkMenuBar (void); A GtkMenuBar should normally be packed into a GtkVBox, and the parent window size and position set as appropriate. As with all containers, the menu bar itself takes up no screen area until its child widgets are in place. Exemplo 24. Creating a Menu Bar <?php dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); $window = &new GtkWindow(); $window->set_uposition(10, 10); $window->set_usize((gdk::screen_width()-20), (gdk::screen_height()-30)); $window->connect_object('destroy', array('gtk', 'main_quit')); $box = &new GtkVBox(); $window->add($box); $menubar = &new GtkMenuBar(); $box->pack_start($menubar, false, false, 0); $header1 = &new GtkMenuItem("File"); $menubar->append($header1); $header2 = &new GtkMenuItem("Edit"); $menubar->append($header2); $filemenu = &new GtkMenu(); $open = &new GtkMenuItem("Open"); $filemenu->append($open); $save = &new GtkMenuItem("Save"); $filemenu->append($save); $separator = &new GtkMenuItem(); $separator->set_sensitive(false); $filemenu->append($separator); $exit = &new GtkMenuItem("Exit"); $exit->connect_object("activate", array("gtk", "main_quit")); $filemenu->append($exit); $header1->set_submenu($filemenu); $window->show_all(); gtk::main(); ?> GtkMenuBar::set_shadow_type void set_shadow_type( GtkShadowType type );

set_shadow_type() alters the appearance of a GtkMenuBar according to the GtkShadowType option set. The default setting is GTK_SHADOW_OUT. GtkMenuItem Widget used for item in menus. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkItem `-- GtkMenuItem Direct subclasses GtkCheckMenuItem, GtkTearoffMenuItem Descrio A GtkMenuItem is a container widget that can be packed into a GtkMenu or GtkMenuBar, containing a GtkAccelLabel and capable of being associated with a submenu. Construtor GtkMenuItem ([string label ]); -- Creates a menu item. Mtodos set_submenu() Sets a GtkMenu as submenu. remove_submenu() Removes a pre-existing submenu. set_placement() Toggles placement of submenu relative to parent. configure() Toggles indicators. select() Emits the "select" signal. deselect() Emits the "deselect" signal.

activate() Emits the "activate" signal. right_justify() Sets item to the right of a GtkMenuBar. Sinais "activate" Emitted when menu item is chosen. "activate-item" Fired when activate_item() is called. GtkMenuItem Construtor GtkMenuItem ([string label ]); The syntax <?php $menuitem = &new GtkMenuItem("Edit"); ?> will create a single item in a menu with the label Edit. However this label is really a GtkAccelLabel, and has the ability to display any keyboard shortcuts - known as accelerators - associated with it. For more information on setting up accelerator display in this way, see add_accelerator() . There is also a working example in the GtkMenu constructor section of this manual. Underlining an accelerator key within the label text is a separate issue, and can be achieved by calling the GtkLabel method parse_uline() from the accelerator label. A string passed using this method will overwrite any existing text in the label. Much of the above is to some extent automated in the GtkItemFactory API, and different methods may apply when setting up a GtkItemFactory-generated menu. Note that it is not possible to add a GtkHSeparator object to either a GtkMenuItem or a GtkMenu. The current workaround for this is to create an empty menu item and then toggle its sensitivity so that it cannot be inadvertently selected by the end user: <?php $separatoritem = &new GtkMenuItem(); $separatoritem->set_sensitive(false); $menu->append($separatoritem); ?>

GtkMenuItem::set_submenu void set_submenu( GtkWidget submenu ); set_submenu() sets the instance of GtkMenu passed as the parameter to be a submenu for the calling GtkMenuItem. The submenu will be displayed whenever the calling menu item is selected. GtkMenuItem::remove_submenu void remove_submenu(void); remove_submenu() is the GtkMenuItem-specific version of the remove() found in GtkContainer. It is useful where a submenu needs to be removed or altered under given conditions within a script. GtkMenuItem::set_placement void set_placement( GtkSubmenuPlacement placement ); set_placement() toggles the placement of the submenu relative to its parent. This method is used internally to ensure that the submenu is always displayed within the visible screen area when it is activated. GtkMenuItem::configure void configure(int show_toggle_indicator, int show_submenu_indicator); configure() is intended to set the visibility of both the toggle and submenu indicator. However these are set internally in GTK+ to be true when appropriate and cannot be overridden, and although not marked as such this method has been eliminated from later revisions of GTK+. GtkMenuItem::select void select(void); select() makes the calling GtkMenuItem emit the "select" signal inherited from GtkItem. In the GtkMenuItem widget, the emission of the "select" signal causes the widget to display its prelight GtkStateType and pops up its submenu, if it has one. Note that the "select" signal is also emitted whenever a GtkMenuItem is entered by the cursor, and by the first item in a GtkMenu when it is popped up. GtkMenuItem::deselect void deselect(void);

deselect() makes the calling GtkMenuItem emit the "deselect" signal inherited from GtkItem. In the GtkMenuItem widget, the emission of the "deselect" signal causes the widget to display its normal GtkStateType and pops down its submenu, if it has one. Note that the "deselect" signal is also emitted whenever the cursor leaves the screen area of a menu item. GtkMenuItem::activate void activate(void); activate() causes the calling GtkMenuItem to emit the "activate" signal as if the user had clicked on it. GtkMenuItem::right_justify void right_justify(void); right_justify() sets a GtkMenuItem to the right of the GtkMenuBar it is appended to. It has no effect in any other situation, and can only be used on the menu item taking the final position in the menu bar's array of items. activate The "activate" signal is emitted when the user presses a mouse button while the cursor is over the widget, or hits the Enter key or spacebar while the widget is selected, or if the activate() method has been called from within the program by the widget, or if the activate_item() method has been called from within the program by the widget's parent. It is also defined as the accelerator signal, so that any accelerator key associated with the widget will also emit the "activate".when pressed, whether the widget is currently selected or not. On activation, all GtkMenu widgets that are a part of the cascading selection sequence disappear from the screen, regardless of whether or not the GtkMenuItem has its "activate" signal connected to a function within the program. Funo Callback void callback(GtkMenuItem menuitem); activate-item The "activate-item" signal is fired when activate_item() is called from a GtkMenuShell object. It is used internally in order to provide an indirect means of firing the "activate" signal.

If you have called the activate_item() method, you will need to connect() the appropriate GtkMenuItem to the "activate" signal. Funo Callback void callback(GtkMenuItem menuitem); GtkMenuShell Abstract base class for menu objects. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkMenuShell Direct subclasses GtkMenu, GtkMenuBar Descrio GtkMenuShell is a special kind of abstract container that provides its descendants GtkMenu and GtkMenuBar with methods and signals that are appropriate to typical menu behaviour. There are three keybindings set up here which are carried down to the inheriting classes. These are as follows: Escape cancels an existing popup menu Return activates the current selection Space also activates the current selected item The activate-current signal has not been documented here because any attempt to harness it beyond these bindings results in abort. The same applies to the move-current signal, implemented here and given keybindings in both GtkMenu and GtkMenuBar. Note that GtkMenuShell is an abstract base class, and can not be constructed directly. Mtodos append() Adds item to end of menu. prepend() Adds item to start of menu. insert() Inserts item at specified position in menu.

deactivate() Emits deactivate signal. select_item() Makes designated item emit the "select" signal. deselect() Makes designated item emit the "deselect" signal. activate_item() Makes designated item emit the "activate" signal. Sinais "deactivate" Emitted when the menu is no longer active. "selection-done" Emitted when selection is complete or cancelled. "cancel" Cancels menu using key bindings. GtkMenuShell::append void append( GtkWidget child ); append() adds the item passed as the parameter to the current end position in the array of child objects within the containing menu. See also: prepend() , insert() , GtkContainer. GtkMenuShell::prepend void prepend( GtkWidget child ); prepend() adds the item passed as the parameter to the current beginning position in the array of child objects within the containing menu, i.e. a second item packed using prepend() will precede the first item packed in this way. GtkMenuShell::insert void insert( GtkWidget child , int position); insert() allows the programmer to specify the position of the item within the menu's array of menuitems, regardless of the order of method calls. If a position given is impossible (e.g. larger than the size of the array) the positioning of all items will be ignored, with the exception of 0. In this case the ordering of the method calls will take precedence.

GtkMenuShell::deactivate void deactivate(void); deactivate() causes the calling menu to emit the "deactivate" signal, which has the effect of deselecting any currently selected menu item and toggling the active status of the menu to false before removing any grabs the menu may currently have. This in turn takes down the menu. The deactivate() method is largely used internally. GtkMenuShell::select_item void select_item( GtkWidget menu_item ); select_item() is largely used internally. A 'selected' item is displayed in the prelight state and has its submenu popped up, if it has one. This is also achieved by using the mouse pointer or arrow keys in an active GtkMenu, and should not be confused with the "activate" signal, which is triggered by mouse clicks or the Enter key. Using this method causes the designated item to emit the "select" signal, which in turn triggers the 'selected' state. GtkMenuShell::deselect void deselect(void); As with the select_item() method, deselect() is mostly used internally. A 'deselected' item is displayed in the normal state and has its submenu popped down, if it has one. Using this method causes the designated item to emit the "deselect" signal, which in turn triggers the 'deselected' state. GtkMenuShell::activate_item void activate_item( GtkWidget menu_item , bool force_deactivate); activate_item() is used to emit the "activate" signal from the GtkMenuItem passed as the first argument. This has the same effect as a user clicking on an item or pressing the Enter key while that item is selected. If the second parameter is set to true, the deactivate() method is called on the menu that the GtkMenuItem is a part of, taking the menu down. If set to false, the menu item is hidden on activation. deactivate The "deactivate" signal is emitted when either a GtkMenuItem within the current menu has been selected or the menu has been cancelled.

This signal initiates the menu's deactivate routine, which removes the key and pointer grabs from the menu and deselects any selected item before popping the menu down. It is largely used internally, and probably carries more overhead when called than the "selection-done" signal emitted under similar conditions. Funo Callback void callback(GtkWidget menu); selection-done The "selection-done" signal is emitted when the selection routine is complete, that is, when either a GtkMenuItem within the menu has been selected or when the user has cancelled the menu by using the Escape key. This signal is not connected to any internal functions, merely reporting the selection status. Use it in preference to the "deactivate" signal. Funo Callback void callback(GtkWidget menu); cancel The "cancel" signal is fired when the Escape key is pressed. The internal functions called when this signal is emitted cancel the current selection, deactivate the menu, and fire the "selection-done" signal. It is, however, possible to add to the functions that this signal already invokes. Funo Callback void callback(GtkWidget menu); GtkMisc Base class for widgets having their own alignment and padding. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkMisc Direct subclasses GtkArrow, GtkImage, GtkLabel, GtkPixmap

Descrio GtkMisc is a base class bequeathing alignment and padding properties and related methods to its descendants. Most widgets do not have such properties on their own account, and only get them through being packed into a multiple container such as the GtkBox family members or GtkTable, or else through using the GtkAlignment widget which is designed to lend a facsimile of these properties to its child widget. It is therefore rare in GTK+ to find a widget capable of calling its own alignment and padding properties directly, and only GtkMisc descendants are able to do so. This is an abstract base class, and cannot be directly constructed. Mtodos set_alignment() Sets alignment. set_padding() Sets padding. Propriedades xalign: Relative distance from container's left edge. yalign: Relative distance from container's top edge. xpad: Padding along horizontal axis. ypad: Padding along vertical axis. GtkMisc::set_alignment void set_alignment(double xalign, double yalign); set_alignment() sets the relative positioning of the calling widget within its container. xalign refers to the relative distance from the left edge, and yalign to the relative distance from the top edge of the container, with 0.0 being no distance from those respective edges and 1.0 being no distance from their opposites. GtkMisc::set_padding void set_padding(int xpad, int ypad);

set_padding() sets the padding around the calling widget to the given number of pixels, in both directions. GtkMisc::xalign Access: Read Only Type: double The xalign property provides the means to query the relative position of the widget to its container along the horizontal axis. GtkMisc::yalign Access: Read Only Type: double The yalign property provides the means to query the relative position of the widget to its container along the vertical axis. GtkMisc::xpad Access: Read Only Type: int The xpad property provides the means to query the padding around the widget to the left and right of the area it takes up. The returned integer represents pixels. GtkMisc::ypad Access: Read Only Type: int The ypad property provides the means to query the padding around the widget to the top and bottom of the area it takes up. The returned integer represents pixels. GtkNotebook Widget that displays a set of pages with tabs. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkNotebook Direct subclasses GtkFontSelection Descrio

GtkNotebook is a widget which displays its children widgets in a stacked manner. Each child has a tab which is visible no matter when in the stack the child is. A child can be brought to the top of the stack by clicking on that child's tab. A text editor which allows a user to edit multiple documents at once might make good use of GtkNotebook. Construtor GtkNotebook (void); -- Creates a new GtkNotebook object. Mtodos append_page() Add a page to the back of the note book. append_page_menu() Appends a page to the notebook, specifying the widget to use as the label in the popup menu. prepend_page() Add a page to the begining of the note book. prepend_page_menu() Prepends a page to the notebook, specifying the widget to use as the label in the popup menu. insert_page() Add a page to the notebook in the given position. insert_page_menu() Inserts a page into the notebook at the given position, specifying the widget to use as the label in the popup menu. remove_page() Remove the page at the given position from the notebook. get_current_page() Return the index of the current page. get_nth_page() Returns the page in the given position. page_num() Returns the position of the given child widget. set_page() Sets the page in the given position as the top page in the notebook. next_page() Moves the next page in the notebook to the top.

prev_page() Moves the previous page in the notebook to the top. set_show_border() Set whether a bevel will be drawn around the notebook pages. set_show_tabs() Set whether or not to show the page tabs. set_tab_pos() Set the edge on which the notebook tabs will be displayed. set_homogeneous_tabs() Set whether or not all tabs should be the same width. set_tab_border() Sets the border around all edges of the notebook's tabs. set_tab_hborder() Sets the border for the left and right sides of the notebook's tabs. set_tab_vborder() Sets the border for the top and bottom sides of the notebook's tabs. set_scrollable() Set whether the tab label area will allow scrolling. popup_enable() Enable the popup menu. popup_disable() Disable the popup menu. get_tab_label() Get the tab's label widget. set_tab_label() Set the tab widget of the given child. set_tab_label_text() Create a new label and set it as the tab label for the given child. get_menu_label() Get the popup menu label for a notebook page. set_menu_label() Set the popup menu label for a notebook page. set_menu_label_text() Set the popup menu label text for a notebook page. set_tab_label_packing() Set how the popup menu label for a page will be packed.

reorder_child() Move a page to a given position. Sinais "clicked" Emitted when a tab is clicked by the user. "switch-page" Emitted when the top page of the notebook is changed. GtkNotebook Construtor GtkNotebook (void); Creates a new GtkNotebook instance. After creating the notebook, you should fill its pages with other widgets using append_page() and/or other similar methods. Because GtkNotebook is a decendant of GtkContainer, it may contain one or more children. The notebook's children will be displayed as a "page" with a tab. It is most useful when the notebook's children are themselves containers so that other items may be added. Exemplo 25. Creating a GtkNotebook <?php $notebook =& new GtkNotebook; $pages = array('tab one', 'tab two', 'tab three'); foreach ($pages as $page) { $frame =& new GtkFrame($page); $frame->add(new GtkLabel('Sample text for ' . $page); $notebook->append_page($frame, new GtkLabel($page)); } $notebook->show_all(); ?> Tabs are automatically connected to the "clicked" signal. When a tab is clicked the "switch-page" signal is emitted which causes that tab's page to be brought to the foreground. GtkNotebook::append_page void append_page ( GtkWidget child , [ GtkWidget tab_label ]); Adds a new page and tab to the back of the notebook. child is added as the "page" with tab_label as the tab. child can be any widget but it is most useful when child is descended from GtkContainer. The tab_label is usually a GtkLabel but may be any widget. tab_label is optional. If it is not supplied the tab will be set to "page n" where n is the page number.

Exemplo 26. Appending pages to a notebook <?php $pages = array(1, 2, 3); $notebook =& new GtkNotebook; foreach ($pages as $pageNumber) { $frame =& new GtkFrame('Page ' . $pageNumber); $label =& new GtkLabel('Tab ' . $pageNumber); $notebook->append_page($frame, $label); } ?> See also: prepend_page() , insert_page() GtkNotebook::append_page_menu void append_page_menu(GtkWidget child, GtkWidget tab_label, GtkWidget menu_label); Adds child as the last page in the notebook with tab_label as the page's tab. Also adds menu_label as the page's popup menu label. menu_label will only be visible if the popup menu is enabled by calling popup_enable() . See also: prepend_page_menu() , insert_page_menu() GtkNotebook::prepend_page void prepend_page ( GtkWidget child , [ GtkWidget tab_label ]); Adds a new page to the begining of the notebook. child is added as the "page" with tab_label as the tab. child can be any widget but it is most useful when child is descended from GtkContainer. The tab_label is usually a GtkLabel but may be any widget. tab_label is optional. If it is not supplied the tab will be set to "page n" where n is the page number. See also: append_page() , insert_page() GtkNotebook::prepend_page_menu void prepend_page_menu(GtkWidget child, GtkWidget tab_label, GtkWidget menu_label); Adds child as the first page in the notebook with tab_label as the page's tab. Also adds menu_label as the page's popup menu label. menu_label will only be visible if the popup menu is enabled by calling popup_enable() . See also: append_page_menu() , insert_page_menu()

GtkNotebook::insert_page void insert_page ( GtkWidget child , [ GtkWidget tab_label , [int position ]]); Adds a new page to the notebook as the positionth page. child is added as the "page" with tab_label as the tab. child can be any widget but it is most useful when child is descended from GtkContainer. The tab_label is usually a GtkLabel but may be any widget. If position is -1 the page will be added as the last page in the notebook. Page positions begin with 0. tab_label is optional. If it is not supplied the tab will be set to "page n" where n is the page number. position is optional. If it is not supplied it will default to -1 which will put the page at the end of the notebook. See also: append_page() , prepend_page() , remove_page() GtkNotebook::insert_page_menu void insert_page_menu ( GtkWidget child , GtkWidget tab_label , GtkWidget menu_label , int position ); Adds child as the notebook page in position tab_label as the page's tab. Also adds menu_label as the page's popup menu label. menu_label will only be visible if the popup menu is enabled by calling popup_enable() . See also: append_page_menu() , prepend_page_menu() GtkNotebook::remove_page void remove_page (int page_num ); Removes the page with index page_num or the last page if page_num is -1. Pages are indexed begining with 0. Exemplo 27. Removing the current page <?php // Remove the current page. $notebook->remove_page($notebook->get_current_page()); ?> See also: insert_page() GtkNotebook::get_current_page int get_current_page (void); Returns the index of the currently selected page. Exemplo 28. Set the current page to 0 if not already

<?php $notebook =& new GtkNotebook; for ($i = 0; $i < 10; ++$i) { $notebook->append_page(new GtkFrame('Page ' . $i), new GtkLabel($i)); } if ($notebook->get_current_page() != 0) { $notebook->set_page(0); } ?> GtkNotebook::get_nth_page GtkWidget get_nth_page (int page_num ); Returns the child widget with index page_num. If page_num is -1, the last page is returned. If page_num is greater then the number of pages minus one (the highest index), NULL is returned. See also: page_num() GtkNotebook::page_num int page_num ( GtkWidget child ); Returns the index of child. If child is not a child of the notebook, -1 is returned. See also: get_nth_page() GtkNotebook::set_page void set_page (int page_num ); Sets the page with index page_num as the top page in the notebook. GtkNotebook::next_page void next_page (void); Sets the page after the current page as the top page in the notebook. If the current page is the last page in the notebook, nothing happens. See also: next_page() GtkNotebook::prev_page void prev_page (void); Sets the page before the current page as the top page in the notebook. If the current page is the first page in the notebook, nothing happens. See also: next_page()

GtkNotebook::set_show_border void set_show_border(bool show_border); Sets whether or not a beveled edge will be drawn around the notebook pages. If show_border is false the border will not be shown. Setting the border to be shown when the border is already showing or setting it to be hidden when the border is already hidden has no effect. This only has an effect when tabs are not shown. See also: set_show_tabs() GtkNotebook::set_show_tabs void set_show_tabs(bool show_tabs); Sets whether or not the page tabs will be shown. If show_tab is false the tabs will not be visible. Setting the tabs to be visible when they are already visisble or setting them to be hidden when they are already hidden has not effect. See also: set_tab_pos() GtkNotebook::set_tab_pos void set_tab_pos(GtkPositionType pos); Sets the edge on which the page tabs will appear if they are to be shown. See also: set_show_tabs() GtkNotebook::set_homogeneous_tabs void set_homogeneous_tabs(bool homogeneous); Sets whether or not all tabs should be the same width. If homogeneous is true all tabs will have equal width. If homogeneous is false the width of each tab will depend on the size of the label. GtkNotebook::set_tab_border void set_tab_border(int border_width); Sets the border around all edges of the tabs to border_width. This is equivilent to calling set_tab_hborder() and set_tab_vborder() with the same value. This method is deprecated in GTK+ and should not be used in new code. Instead you should use set_tab_hborder() and set_tab_vborder() . See also: set_tab_hborder() , set_tab_vborder() GtkNotebook::set_tab_hborder

void set_tab_hborder(int tab_hborder); Sets the left and right borders to be tab_hborder pixels wide for all the notebook's tabs. Combined with set_tab_vborder() this is the suggested method for setting tab borders. See also: set_tab_border() , set_tab_vborder() GtkNotebook::set_tab_vborder void set_tab_vborder(int tab_vborder); Sets the top and bottom borders to be tab_vborder pixels wide for all the notebook's tabs. Combined with set_tab_hborder() this is the suggested method for setting tab borders. See also: set_tab_border() , set_tab_hborder() GtkNotebook::set_scrollable void set_scrollable(bool scrollable); Sets whether or not there will be arrows for scrolling if there are more tabs than can be displayed in the tab label area. If scrollable is set to true scrolling arrows will appear when needed. If scrollable is set to false the tab label area will not be scrollable. GtkNotebook::popup_enable void popup_enable(void); Enables the popup menu allowing the user to change pages by right clicking on the bookmarks and selecting a page from the menu. See also: popup_disable() GtkNotebook::popup_disable void popup_disable(void); Disables the popup menu. See also: popup_enable() GtkNotebook::get_tab_label GtkWidget get_tab_label(GtkWidget child); Returns child's tab label widget. NULL is returned if child is not in

the notebook or if there was no label set for child. Tab labels are normally set when the page is added to the notebook. See also: set_tab_label() GtkNotebook::set_tab_label void set_tab_label(GtkWidget child, GtkWidget tab_label); Sets child's tab label widget to tab_label. If null is given for tab_label, the default label of "page n", where n is the page number, will be used. See also: get_tab_label() GtkNotebook::set_tab_label_text void set_tab_label_text(GtkWidget child, string tab_text); Creates a new GtkLabel with tab_text as the label and sets it as the tab label widget for child. See also: set_tab_label() GtkNotebook::get_menu_label GtkWidget get_menu_label(GtkWidget child); Returns the menu label widget for child. If child is not a child of the notebook or does not have a menu label other than the default tab label, NULL is returned. GtkNotebook::set_menu_label void set_menu_label(GtkWidget child, GtkWidget menu_label); Sets menu_label as the popup menu label widget for child. See also: get_menu_label() , set_menu_label_text() GtkNotebook::set_menu_label_text void set_menu_label_text(GtkWidget child, string menu_text); Creates a new GtkLabel with menu_text as its label text and sets it as child's popup menu label. GtkNotebook::set_tab_label_packing void set_tab_label_packing(GtkWidget child, bool expand, bool fill, GtkPackType pack_type); Sets the packing parameters for the tab label of the page containing

child. See pack_start() for the exact meaning of the parameters. GtkNotebook::reorder_child void reorder_child ( GtkWidget child , int position ); Moves child to position position. If position is greater than the number of pages or is negative, the page will be moved to the end of the notebook. Page positions start from zero. The third page in the notebook is in position two. clicked The "clicked" signal is emitted when a user clicks on a page tab. By default this signal is connected to the set_page() method. This has the effect of moving the page associated with the tab to the front of the notebook. Funo Callback void callback(GtkNotebook notebook); switch-page The "switch-page" signal is emitted when the top page of the notebook is changed. This can occur when a user clicks on a page's tab or when the top page is changed by the program. See also: set_page() , next_page() , prev_page() Funo Callback void callback(GtkNotebook notebook); GtkObject The base class of the PHP-GTK class hierarchy. Hierarquia do Objeto GtkObject Direct subclasses GtkData, GtkItemFactory, GtkWidget Descrio GtkObject is the base class of the GTK object hierarchy. It implements the functionality that every object below it in the tree has. This object cannot be directly constructed from PHP-GTK, but is documented here for reference purposes as its methods and signal

are generic throughout the hierarchy. Mtodos flags() Returns an object's current GtkObjectFlags settings. set_flags() Sets the GtkWidgetFlags on a derived object. unset_flags() Unsets the GtkWidgetFlags on a derived object default_construct() The default object constructor. constructed() Marks an object as constructed. sink() Removes an object's initial floating reference. ref() Increases the reference count on an object. unref() Decreases the reference count on an object. destroy() Causes the object to be destroyed. get_arg() Returns current argument set. set_arg() Sets an argument or arguments on an object. set_data() Associate data with an object as a key/values pair. get_data() Return data from the objects data associations. remove_data() Remove data from the objects data associations. emit() Emit a signal. emit_stop() Stop a signal from being emitted. emit_stop_by_name() Stop a signal with a given name from being emitted.

connect() Connects a signal and a callback. connect_after() Connects a signal and a callback to be called after any others. connect_object() Pass a different object to the callback. connect_object_after() Pass a different object to the callback, register the callback last. disconnect() Disconnects a signal from a function. signal_handler_block() Block a signal handler from being called when a signal is emitted. signal_handler_unblock() Allow a previously blocked signal hander to be called again. signal_handler_pending() signal_handler_pending_by_id() signal_handlers_destroy() Destroy all signal handlers connected to this object. Sinais "destroy" Emitted when an object is destroyed. GtkObject::flags int flags(void); This method returns the object's flags as defined by the enumerated values in GtkObjectFlags. The return value can be used to find information about an object's current status, i.e. whether the object has been fully constructed, whether the object has a floating reference or is associated with a parent object, whether the object has signals connected to it, and whether the object has been destroyed. See also: set_flags() , unset_flags() . GtkObject::set_flags void set_flags( GtkWidgetFlags flags );

This method allows you to set any of the flags defined by the GtkWidgetFlags enumerated values. These flags share the flags space in GtkObject; the first four bits are taken by GtkObjectFlags, and derived objects use the remaining bitfields. The GtkWidgetFlags settings determine the capabilities of a widget; e.g the flag GTK_NO_WINDOW is set on certain widgets during their creation in the GTK source, reversing the generic widget property of $widget->window; - such widgets are not able to respond unilaterally to GDK events. (Use a GtkEventBox to capture events on windowless widgets.) You would use set_flags() in a situation where the widget needs capabilities it does not have at base; setting for instance GTK_CAN_DEFAULT on a GtkButton you want to have keyboard grab by default will cause that button to be drawn in such a way that space is allowed for it to be displayed with default status. Although all the flag bitfields are reversible in this way, it is not always sane to alter them, given that the chief characteristics of a widget are controlled by them. For example, unsetting the GTK_NO_WINDOW flag on a GtkLabel widget will prevent the label from displaying its current text. See also: flags() , unset_flags() , and a whole host of GtkWidget methods such as set_sensitive() and grab_default() which either act as wrappers for the set_flags() function or need to work in tandem with GtkWidgetFlags values set in this way. GtkObject::unset_flags void unset_flags( GtkWidgetFlags flags ); This method allows the programmer to reverse the switch of the bitfield flags on a widget, as defined by the GtkWidgetFlags enumerated values. These flags reflect a widget's current state or capabilities. Note that GtkObjectFlags and GtkWidgetFlags share the same flag space, but are fairly different in nature. The object flags are public so that they can be queried rather than so that they can be altered, relating as they do to the basic construction of any object. The widget flags determine the nature of that object. See also: flags() , set_flags() . GtkObject::default_construct void default_construct(void); This construction method is called internally in GTK+ after the arguments for a new object have been set, if the GtkObjectFlags value GTK_CONSTRUCTED does not return true. You are unlikely to use it in PHP-GTK programming. GtkObject::constructed void constructed(void);

constructed() is a wrapper method providing a way to switch the GtkObjectFlaga value GTK_CONSTRUCTED. It may be called internally in GTK+ during the construction of a new object, as a fallback when default_construct() fails. It is unlikely (but not impossible) that you will use this method in PHP-GTK programming. GtkObject::sink void sink(void); This method might be used when a newly-created object has not been assigned a parent. sink() is called internally when the object is assigned a parent. The object is assigned a reference count of 1 at that point, and is kept alive only through its association with the parent. sink() would be called by a PHP-GTK programmer in a situation where the object needed to be fully referenced, for example after calling ref() and prior to calling unref() on an object, where the object has no reference-giving parent. It's basically a wrapper method that provides access to the GtkObjectFlags value GTK_FLOATING. GtkObject::ref void ref(void); Increases the reference count on an object by 1. This method is called internally when a newly created object is claimed by its parent widget and before its floating reference count is sunk, leaving the life of the child completely in the hands of the parent's own reference value. If you are planning to remove() a child from its parent container, you will therefore need to call ref() on that child first, in order to maintain its life away from the parent. GtkObject::unref void unref(void); This method decreases the reference count on an object by 1. If the reference count reaches 1 then destroy() will be called on the object from source. GtkObject::destroy void destroy(void); destroy() causes an object and all its signal connections to be destroyed. During this process the "destroy" signal is emitted.

Note that the object's memory is currently not freed at the point of destruction, as the reference count is maintained by both the destroy() method within GTK, and the Zend registry within PHP. In both cases, this way of coping with object destruction has either changed or is about to change in the near future. See also: unref() . GtkObject::get_arg mixed get_arg(string arg_name); In most cases where you are likely to need to know the content of an argument, there will be a get method in place which is basically a wrapper for get_arg() . This is good, because there is, unfortunately, no way to know for certain the name of the argument to pass to this function without looking at GTK+ source. A brief tutorial on making sense of what you see there follows. An individual widget's arguments are initialized as a set of enumerated values at the beginning of the c file relating to that object. For example, in gtklabel.c in GTK 1.2.10 you will see this directly after the includes: enum { ARG_0, ARG_LABEL, ARG_PATTERN, ARG_JUSTIFY, ARG_WRAP }; Around a hundred lines later, these argument types are defined as they are added to the widget, in the class_init function: gtk_object_add_arg_type ("GtkLabel::label", GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_LABEL); gtk_object_add_arg_type ("GtkLabel::pattern", GTK_TYPE_STRING, GTK_ARG_READWRITE, ARG_PATTERN); gtk_object_add_arg_type ("GtkLabel::justify", GTK_TYPE_JUSTIFICATION, GTK_ARG_READWRITE, ARG_JUSTIFY); gtk_object_add_arg_type ("GtkLabel::wrap", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_WRAP); This gives you the name (in quotes) that you are looking for, the type of data that the argument will consist of, the fact that it is writeable (always), and the name of the original enumerated value to bind this information to.

For get_arg() , all you really need is the part that is in quotes, which can be surmised by looking at the initial enums. The datatype may, however, be useful information if you need to set an argument and have no other means of doing so than set_arg() . The way you would access this is as follows: <?php $label = &new GtkLabel('This is an argumentative label'); $arg = $label->get_arg('GtkLabel::label'); echo $arg."\n"; ?> GtkObject::set_arg void set_arg(array arg_name); In most cases, you will find that there is a set method in place that is a wrapper function for set_arg() . In the rare situation where this is not in place, you will need to refer to the GTK source in order to find the argument name expected by this method. There is a short tutorial explaining what to look for, under get_arg() . The syntax used in this method is as follows: <?php $label->set_arg(array('GtkLabel::label'=>'RTFS', 'GtkLabel::pattern'=>'____')); ?> GtkObject::set_data void set_data(string key, mixed value); Associates value with the calling object. value can be retireved by passing key when calling get_data() . Exemplo 29. Tagging objects <?php // Create a GtkNotebook with several pages out of order. $notebook =& new GtkNotebook; for ($i = 0; $i < 6; $i++) { $frame =& new GtkFrame('Page ' . $i); $frame->set_data('intended_position', $i); // Add the pages out of order. if ($i % 2) { $notebook->prepend_page($frame, new GtkLabel('Tab ' . $i)); } }

// Reorder the pages. $pages =& $notebook->children(); // Can't use foreach because it makes a copy. for ($page =& reset($pages); $page !== false; $page =& next($pages)) { $notebook->reorder_child($page, $page->get_data('intended_position'); } ?> See also: get_data() , remove_data() GtkObject::get_data mixed get_data(string key); Returns the value assigned to key when set_data() was called. See also: set_data() , remove_data() GtkObject::remove_data void remove_data(string key); Removes the data association with key key. See also: set_data() , get_data() GtkObject::emit int emit (string signal_type ); Emits the signal signal_type. signal_type is the name of the signal to emit. This method is called automatically when an event is triggered. The signal that is emitted is determined by the event that occured. See also: emit_stop() , emit_stop_by_name() GtkObject::emit_stop void emit_stop (int signal_id ); Stops the signal identified by signal_id from being emitted. The signal_id is the return value from emit() . See also: emit() , emit_stop_by_name() GtkObject::emit_stop_by_name void emit_stop_by_name (string signal_name ); Stops the signal signal_name from being emitted. This will prevent the signal from being emitted and will in turn prevent the methods

connected to the signal from being executed. See also: emit() , emit_stop() GtkObject::connect int connect(string signal, string function, [mixed custom_data ]); Connects a function to a signal so it is called when the signal is emitted by a widget. The function takes two or three arguments. The first parameter, signal is the textual name of the signal, the second parameter, function is the name of the function that should be used as a callback. The third parameter, custom is optional and can be used to pass extra data to the callback. Please see the Userguide section of the manual for more information on this. See Also: connect_after() , connect_object() , connect_object_after() GtkObject::connect_after int connect_after(string signal, string function, void custom ]); Connects a function to a signal so it is called when the signal is emitted by a widget. The callback is guaranteed to be called after the normal and default handlers. The function takes two or three arguments. The first parameter, signal is the textual name of the signal, the second parameter, function is the name of the function that should be used as a callback. The third parameter, custom is optional and can be used to pass extra data to the callback. Please see the Userguide section of the manual for more information on this. See Also: connect() , connect_object() , connect_object_after() GtkObject::connect_object int connect_object(string signal, string function, object param); connect_object() allows the passing of a different object to a callback than the one for emitting the signal in the first place. The signal parameter is the textual name of the signal we want to connect to, the function parameter is the textual name of the function we want to connect to the signal and the param parameter is the object we want to pass as the first parameter to the callback. The function returns the signal_id. See Also: connect() , connect_after() , connect_object_after() GtkObject::connect_object_after

int connect_object_after(string signal, string function, Object param); connect_object_after() allows the passing of a different object to a callback than the one for emitting the signal in the first place. By using the connect_object_after() you can ensure that all normal handlers, and the default handler are called first. The signal parameter is the textual name of the signal we want to connect to, the function parameter is the textual name of the function we want to connect to the signal and the param parameter is the object we want to pass as the first parameter to the callback. The function returns the signal_id. See Also: connect() , connect_after() , connect_object() GtkObject::disconnect void disconnect(int handler_id); Removes the connection identified by handler_id. handler_id is the value returned from connect() or one of its sister functions. When the connection is removed, the function that was passed to connect() will not be called when the signal that was passed is emitted. Exemplo 30. Disconnecting a method <?php // Say 'hi' on the terminal function sayHi() { echo 'Hi'; } // Make a button shut up. function beQuiet(&$button, $handler) { $button->disconnect($handler); } // Set up the window $window =& new GtkWindow; $hBox =& new GtkHBox; // Make a button that says hi. $button1 =& new GtkButton('Say Hi'); $handler = $button1->connect('clicked', 'sayHi'); // Make the first button shut up when the second is clicked. $button2 =& new GtkButton('Be Quiet!'); $button2->connect_object('clicked', 'beQuiet', $button1, $handler); $hBox->pack_start($button1);

$hBox->pack_start($button2); $window->add($hBox); $window->show_all(); gtk::main(); ?> See also: connect() GtkObject::signal_handler_block void signal_handler_block (int handler_id ); Blocks a signal handler from being called when the connected signal is emitted. handler_id is the value returned when connect() or one of its sister methods is called. While handler_id is blocked, the function passed to connect() will not be called when the connected signal is emitted. Calling signal_handler_unblock() will reverse this effect and allow the signal to call the function again. See also: signal_handler_unblock() GtkObject::signal_handler_unblock void signal_handler_unblock(int handler_id); Releases a blocked signal handler allowing the function to be called when the signal is emitted. handler_id is return value from connect() or one of its sister methods. Calling signal_handler_unblock() on a signal handler that was not previously blocked using signal_handler_block() has no effect. See also: signal_handler_block() GtkObject::signal_handler_pending int signal_handler_pending (int signal_id , bool may_be_blocked ); GtkObject::signal_handler_pending_by_id int signal_handler_pending_by_id (int handler_id , bool may_be_blocked ); GtkObject::signal_handlers_destroy void signal_handlers_destroy(void); Destroys all signal handlers connected to this object. This method will destroy all handlers whether they were connected by default or by calling connect() or one of its sister methods. This method is called automatically when an object is destroyed, it should not normally be called in code. destroy

The "destroy" signal is emitted by an object when it is in the process of being destroyed. This signal is connected to signal_handlers_desctroy which causes the signal connections associated with the object to be destroyed immediately after this emission. Funo Callback void callback(GtkObject object); GtkOptionMenu Widget used to choose from a list of valid choices. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkButton `-- GtkOptionMenu Direct subclasses None. Descrio A GtkOptionMenu consists of a button containing a label, with an indicator tab to the right. The GtkMenu currently associated with the option menu pops up in a similar area to that which would be taken up by a dropdown menu. This is, however, a popup menu; if you need a dropdown list widget, take a look at GtkCombo. GtkOptionMenu has been deprecated since GTK+ 2.0 and should not be used in newly written code. Construtor GtkOptionMenu (void); -- Creates a popup menu linked to a button. Mtodos get_menu() Retrieves current menu. set_menu() Sets associated menu.

remove_menu() Removes existing menu. set_history() Sets button text to that of designated GtkMenuItem. GtkOptionMenu Construtor GtkOptionMenu (void); Constructing a GtkOptionMenu is less complicated that creating most other forms of menu. Exemplo 31. Creating a simple GtkOptionMenu. <?php dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); function echo_activated($item, $label, $rank, $x) { echo "\$items[$x] ('$label') is the $rank ".$item->get_name().".\n"; flush(); } $window = &new GtkWindow(); $window->set_position(GTK_WIN_POS_CENTER); $window->connect_object('destroy', array('gtk', 'main_quit')); $menu = &new GtkMenu(); $labels = array('File', 'Edit', 'Save', 'Exit'); $pos = array('first', 'second', 'third', 'fourth'); for($i = 0; $i < 4; $i++) { $items[$i] = &new GtkMenuItem($labels[$i]); $items[$i]->connect('activate', 'echo_activated', $labels[$i], $pos[$i], $i); $menu->append($items[$i]); } $menu->show_all(); $optionmenu = &new GtkOptionMenu(); $optionmenu->set_menu($menu); $window->add($optionmenu); $window->show_all(); gtk::main(); ?> GtkOptionMenu::get_menu GtkWidget get_menu (void); get_menu() returns the instance of the GtkMenu that is currently

associated with the calling GtkOptionMenu. GtkOptionMenu::set_menu void set_menu( GtkWidget menu ); set_menu() sets the GtkMenu specified in the parameter to be associated with the calling GtkOptionMenu. GtkOptionMenu::remove_menu void remove_menu(void); remove_menu() removes the GtkMenu currently associated with the GtkOptionMenu. In order to avoid an error message the next time that the user clicks on the GtkOptionMenu after menu removal, it is necessary to either replace it with a new GtkMenu or to call set_sensitive(false) from the GtkOptionMenu. Either call will avert an error message regards the menu not existing. GtkOptionMenu::set_history void set_history(int index); set_history() is used internally in GTK to display the text of the GtkMenuItem most recently activated by the user. This method can also be used by the PHP-GTK programmer to override this default behaviour or, alternatively, to designate an initial setting using the index position. GtkPacker Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkPacker Direct subclasses None. Descrio Construtor GtkPacker (void); --

Mtodos add_defaults() add() set_child_packing() reorder_child() set_spacing() set_default_border_width() set_default_pad() set_default_ipad() GtkPacker Construtor GtkPacker (void); GtkPacker::add_defaults void add_defaults(GtkWidget child, GtkSideType side, GtkAnchorType anchor, GtkPackerOptions options); GtkPacker::add void add(GtkWidget child, GtkSideType side, GtkAnchorType anchor, GtkPackerOptions options, [int border_width = 0, [int pad_x = 0, [int pad_y = 0, [int i_pad_x = 0, [int i_pad_y = 0]]]]]); GtkPacker::set_child_packing void set_child_packing(GtkWidget child, GtkSideType side, GtkAnchorType anchor, GtkPackerOptions options, [int border_width = 0, [int pad_x = 0, [int pad_y = 0, [int i_pad_x = 0, [int i_pad_y = 0]]]]]); GtkPacker::reorder_child void reorder_child(GtkWidget child, int position); GtkPacker::set_spacing void set_spacing(int spacing);

GtkPacker::set_default_border_width void set_default_border_width(int border); GtkPacker::set_default_pad void set_default_pad(int pad_x, int pad_y); GtkPacker::set_default_ipad void set_default_ipad(int i_pad_x, int i_pad_y); GtkPaned Base class for widgets with two adjustable panes. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkPaned Direct subclasses GtkHPaned, GtkVPaned Descrio GtkPaned provides methods and properties for container widgets with two panes whose relative size can be adjusted by the end user. The panes are arranged horizontally in GtkHPaned or vertically in GtkVPaned, and are divided by a handle. By default, the initial position of the handle is set in accordance with the size requests of the child widgets. Note that the panes are defined through their child widgets, i.e. they have an initial size of zero. GtkPaned is an abstract base class and cannot be constructed directly. Mtodos add1() Adds child to first pane. add2() Adds child to second pane. pack1() Adds child to first pane, with options.

pack2() Adds child to second pane, with options. set_position() Sets position of dividing handle. set_handle_size() Sets handle size. *deprecated in GTK2* set_gutter_size() Sets gutter size. *deprecated in GTK2* Propriedades child1: Child widget in first pane. child2: Child widget in second pane. handle_size: Size of separating handle. *deprecated in GTK2* gutter_size: Size of separating gutter. *deprecated in GTK2* child1_resize: Status of first child's resize setting. child1_shrink: Status of first child's shrink setting. child2_resize: Status of second child's resize setting. child2_shrink: Status of second child's shrink setting. GtkPaned::add1 void add1( GtkWidget child ); add1() adds the child widget specified to the top or left pane of a GtkPaned-based widget. The only difference between add1() and pack1() is that the packing parameters are not visible to the programmer where add1() is used, and so cannot easily be altered. The settings are identical to the pack1() defaults. GtkPaned::add2 void add2( GtkWidget child );

add2() adds the child widget specified to the bottom or right pane of a GtkPaned-based widget. The only difference between add2() and pack2() is that the packing parameters are not visible to the programmer where add2() is used, and so cannot easily be altered. The settings are identical to the pack2() defaults. GtkPaned::pack1 void pack1( GtkWidget child , [bool resize = false , [bool shrink = true ]]); pack1() packs the child widget specified into the top or left pane of a GtkPaned-based widget. The resize parameter when set to its default false ensures that the pane will not expand beyond its initial size when the top-level window is maximised, in the direction of the pane arrangement. Note that the resize parameter describes the spatial relationship between the two panes, so that setting both panes alike will always result in both panes resizing when the top-level window is maximised. The user resizing facility offered by the handle is not affected by the resize setting. The shrink parameter when set to its default true allows the pane to shrink beyond the size requested by its child widget. Setting the shrink parameter to false prevents it from doing this. Note that setting the parameter to false across both panes renders the dividing handle ineffective where the size of the top-level window is reliant upon the size requests of the child widgets. GtkPaned::pack2 void pack2( GtkWidget child , [bool resize = true , [bool shrink = true ]]); pack2() packs the child widget specified into the bottom or right pane of a GtkPaned-based widget. The resize parameter when set to its default true allows the pane and its child widget to expand to fill the area between the dividing handle and the edge of the container when the toplevel window is maximised, in the direction of the pane arrangement. The position of the dividing handle can be set using set_position() , or by default is set at the size requested by the child belonging to the opposite pane, where its resize parameter has been set to false. Note that the resize parameter describes the spatial relationship between the two panes, so that setting both panes alike will always result in both panes resizing when the top-level window is maximised. The user resizing facility offered by the handle is not affected by the resize setting.

The shrink parameter when set to its default true allows the pane to shrink beyond the size requested by its child widget. Setting the shrink parameter to false prevents it from doing this. Note that setting the parameter to false across both panes renders the dividing handle ineffective where the size of the top-level window is reliant upon the size requests of the child widgets. GtkPaned::set_position void set_position(int position); set_position() sets the position of the dividing handle at the specified number of pixels from the edge of the widget, in the direction of the pane arrangement, without regard to the size requests of the child widgets in the panes. It is overridden by the user's repositioning of the dividing handle. To unset the position of the dividing handle, use $paned->set_position(-1);</literal> GtkPaned::set_handle_size void set_handle_size(int size); set_handle_size() can currently be used to set the width or height of the handle in pixels. The default setting is 5 pixels in the win32 binary, or 10 pixels in the 1.2.* series of GTK+. In GTK2 the size of the handle will be set at 5 pixels, across both platforms. Please note that both this function and the handle_size property are deprecated in GTK2, and so should not be used. GtkPaned::set_gutter_size void set_gutter_size(int size); set_gutter_size() can currently be used to set the width or height in pixels of the gutter where the dividing handle is based, only where the 1.2.* series of GTK+ is being used to compile PHP-GTK. It does nothing in the win32 version. Please note that this function is more than deprecated in GTK2; the gutter_size property does not exist in later releases. Do not use this function. GtkPaned::child1 Access: Read Only Type: GtkWidget child1 is the internal name for the child widget in the first pane of a GtkPaned-derived widget. GtkPaned::child2

Access: Read Only Type: GtkWidget child2 is the internal name for the child widget in the second pane of a GtkPaned-derived widget. GtkPaned::handle_size Access: Read Only Type: int handle_size is an integer describing the width or height (as appropriate) of the separating handle in a GtkPaned-derived widget. Please note that in future releases of GTK+ there is no such property. It will be replaced internally by private fields. GtkPaned::gutter_size Access: Read Only Type: int gutter_size is an integer describing the width or height (as appropriate) of the gutter which provides the base for the separating handle of a GtkPaned-derived widget. Please note that in later releases of GTK+ - including that currently used by the PHP-GTK win32 binary - there is no such property. The gutter itself has been deprecated. GtkPaned::child1_resize Access: Read Only Type: bool child1_resize describes the current status of the resize parameter relating to the child that is packed in the first pane. This is useful where the end user needs to be given control over the resize setting. GtkPaned::child1_shrink Access: Read Only Type: bool child1_shrink describes the current status of the shrink parameter relating to the child that is packed in the first pane. This is useful where the end user needs to be given control over the shrink setting. GtkPaned::child2_resize Access: Read Only Type: bool

child2_resize describes the current status of the resize parameter relating to the child that is packed in the second pane. This is useful where the end user needs to be given control over the resize setting. GtkPaned::child2_shrink Access: Read Only Type: bool child2_shrink describes the current status of the shrink parameter relating to the child that is packed in the second pane. This is useful where the end user needs to be given control over the shrink setting. GtkPixmap Widget displaying a graphical image or icon. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkMisc `-- GtkPixmap Direct subclasses None. Descrio GtkPixmap has been deprecated since GTK+ 2.0 and should not be used in newly written code. Construtor GtkPixmap (GdkPixmap pixmap, GdkBitmap mask); -Mtodos set() set_build_insensitive() GtkPixmap Construtor GtkPixmap (GdkPixmap pixmap, GdkBitmap mask); GtkPixmap::set

void set(GdkPixmap val, GdkBitmap mask); GtkPixmap::set_build_insensitive void set_build_insensitive(int build); GtkPlug Toplevel widget for embedding into other processes. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkWindow `-- GtkPlug Direct subclasses None. Descrio This widget can be used to write plugins for other applications. It takes the id of an existing GtkSocket and will embed itself into it and so into the other application. The GtkPlug can be filled with widgets like any other window, except that it is visible inside another application. Please have a look at the GtkSocket documentation, as the plug can only be used together with a socket. Note that if the application with the socket is quit, the program with the plugged-in plug will exit as well. Construtor GtkPlug (int socket_id); -- Creates a new plug instance. GtkPlug Construtor GtkPlug (int socket_id); Creates a new plug which will be connected to the socket specified by the socket_id. You should make sure that the socket exists when connecting the plug to it. If it does not, the results are undefined. Probably a new GtkWindow will be created and the plug embedded in this window, but you shouldn't rely on that behavior.

The following example creates a plug which connects to the socket created in the constructor example of GtkSocket. Exemplo 32. Plugging into a socket <?php if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); } if( $GLOBALS['argc'] != 2) { die( 'Please pass the socket id as parameter!' . "\r\n"); } $socketid = $GLOBALS['argv'][1]; $plug = &new GtkPlug( $socketid); $plug->set_default_size( 300, 300); $plug->connect_object('destroy', array('gtk', 'main_quit')); $plug->set_title( 'plug'); $label = &new GtkLabel( 'hello from outer space'); $plug->add( $label); $plug->show_all(); function changeLabel( $objButton, $objLabel, $strLabel) { $objLabel->set_text( $strLabel); } $window = &new GtkWindow(); $window->set_title( 'plug controller'); $window->set_default_size( 200, 300); $window->connect_object('destroy', array('gtk', 'main_quit')); $vbox = &new GtkVBox(); $arLabels = array( 'Hello!', 'Yes, I can control you', 'Don\'t believe it , heh?'); foreach( $arLabels as $strLabel) { $btn = &new GtkButton( $strLabel); $btn->connect( 'clicked', 'changeLabel', $label, $strLabel); $vbox->pack_start_defaults( $btn); } $window->add( $vbox); $window->show_all(); gtk::main(); ?> GtkPreview Widget to display RGB or grayscale data. Hierarquia do Objeto

GtkObject `-- GtkWidget `-- GtkPreview Direct subclasses None. Descrio The GtkPreview widget provides a simple interface used to display images as RGB or grayscale data. The use of GtkPreview is deprecated and should not be used in new code. Use a GdkPixbuf displayed by a GtkImage or a GtkDrawingArea instead. Construtor GtkPreview ( GtkPreviewType type ); -- Create a new GtkPreview. Mtodos size() Set the size of the preview. put() Draw a portion of the preview image into the drawable window. draw_row() Set the data for a portion of one row of the preview. set_expand() Set the behavior of the preview when the allocated size is larger than the requested size. GtkPreview Construtor GtkPreview ( GtkPreviewType type ); Creates a new GtkPreview of type type. type must be a valid GtkPreviewType. The use of GtkPreview is deprecated and should not be used in new code. Use a GdkPixbuf displayed by a GtkImage or a GtkDrawingArea instead. GtkPreview::size void size(int width, int height); Sets the dimensions of the preview to width pixels wide by height

pixels high. size() only sets the requested size. The actual size of the preview image depends on the size and settings of the container that encloses the widget. If the preview is allowed to expand to fill the container, it may appear larger than the dimensions requested with the size() method. See also: set_expand() GtkPreview::put void put(GdkWindow window, GdkGC gc, int srcx, int srcy, int destx, int desty, int width, int height); Draws a portion of the preview image into the drawable window. srcx and srcy represent the upper left corner of the source image to be drawn. destx and desty represent the location of the upper left corner of the destination image to be drawn. width and height specify the rectangular portion of the image that is to be drawn. GtkPreview::draw_row void draw_row(string data, int start, int row, int pixels); Replaces pixels pixels of data on row row of the preview starting at start with data. If the preview is of type GTK_PREVIEW_GREYSCALE, data must be pixels bytes of data. If the preview is of type GTK_PREVIEW_COLOR, data must be 3*pixels bytes of data. GtkPreview::set_expand void set_expand(bool expand); Sets the behavior of the preview when the allocated size is larget than the requested size. If expand is false then the preview will not be larger than the dimensions set with size() . If the container enclosing the preview is larger than the requested dimensions, the preview will be centered in the container. If expand is true, the preview will expand to fill the container. The application is responsible providing data of the correct dimensions. See also: size() GtkProgress Base class for GtkProgressBar. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkProgress

Direct subclasses GtkProgressBar Descrio GtkProgress is a base class providing methods for widgets implementing progress bar functionality. The only built-in widget using GtkProgress is GtkProgressBar. Note that GtkProgress is an abstract class and cannot be constructed directly. GtkProgress has been deprecated since GTK+ 2.0 and should not be used in newly written code. Mtodos set_show_text() Toggles progress text display. set_text_alignment() Sets progress text alignment. set_format_string() Sets and formats progress text. set_adjustment() Sets the progress adjustment object. configure() Sets the progress value parameters. set_percentage() Sets the current progress percentage. set_value() Sets the current progress value. get_value() Gets the current progress value. set_activity_mode() Toggles progress mode. get_current_text() Gets the current progress text. get_text_from_value() Gets progress text based on value. get_current_percentage() Gets current progress percentage.

get_percentage_from_value() Gets progress percentage based on value. GtkProgress::set_show_text void set_show_text(bool show_text); The show_text parameter controls whether the progress text is shown. The default setting is false. See also: set_format_string() . GtkProgress::set_text_alignment void set_text_alignment(double x_align, double y_align); The alignment of the text within the progress area can be modified using this method. The x_align and y_align parameters control the horizontal and vertical alignment of the text, respectively. Their range can be from 0.0 to 1.0 (meaning from one side of the progress area to another). The default setting is (0.5, 0.5). GtkProgress::set_format_string void set_format_string(string format); The content of the progress text can be modified with the format string. It can contain the following format characters: * %v - the current progress value. * %l - the lower bound of the progress value. * %u - the upper bound of the progress value. * %p - the current progress percentage. The % character itself can be specified as %%. The default text string is "%p%%". See also: GtkAdjustment, where the progress value and bounds are set. GtkProgress::set_adjustment void set_adjustment( GtkAdjustment adjustment ); A progress has an associated GtkAdjustment object which specifies the bounds of the value having its progress displayed. This method associates the specified adjustment object with the progress. GtkProgress::configure void configure(double value, double min, double max); This method provides a way to directly control the current value and

the bounds of a GtkProgress. See also: GtkAdjustment. GtkProgress::set_percentage void set_percentage(double percentage); This method sets the current percentage for a GtkProgress. Its value must be between 0.0 and 1.0. Use this method to update a GtkProgressBar that is in percentage mode. GtkProgress::set_value void set_value(double value); The progress value can be set directly with this method. The value must be within the range of the underlying GtkAdjustment in order for the GtkProgressBar to display it. Use this method to update a GtkProgressBar that is in activity mode. GtkProgress::get_value double get_value(void); Returns the current progress value. GtkProgress::set_activity_mode void set_activity_mode(bool activity_mode); GtkProgress can be either in percentage mode (when the total amount of work is known and progress can be calculated) or activity mode (when there is no way to estimate the total amount of work and only activity must be indicated somehow). If activity_mode is true, the activity mode is turned on, otherwise the percentage mode. See also: set_value, set_percentage() . GtkProgress::get_current_text string get_current_text(void); The text indicating the amount of progress can be retrieved with this method. Before the text is returned, it is formatted using the current progress format. See also: set_format_string() ). GtkProgress::get_text_from_value

string get_text_from_value(double value); If you wish to retrieve formatted progress text based on some value other than current, then this method should be used. The current progress value will not be changed. GtkProgress::get_current_percentage double get_current_percentage(void); Returns the current progress percentage as a number between 0.0 and 1.0. GtkProgress::get_percentage_from_value double get_percentage_from_value(double value); If you wish to retrieve the progress percentage based on some value other than the current one, then this method should be used. It returns the desired percentage as a number between 0.0 and 1.0. GtkProgressBar Widget that provides a visual indication of an operation's progress. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkProgress `-- GtkProgressBar Direct subclasses None. Descrio The purpose of GtkProgressBar is to show the user the progress of a long-running operation. It can be used in two modes: a percentage mode or an activity mode. The percentage mode should be used when the application can in advance determine the total amount of work that will be done. As the operation progresses the application should update the bar widget with the amount of work completed so far. The widget will reflect this by displaying a growing percentage bar. The activity mode is useful when the application cannot determine the total amount of work and instead simply wishes to provide an indication that an operation is in progress. In this mode, the widget will display a block moving back and forth in the progress

area. See also: GtkProgress, set_activity_mode() . Construtor GtkProgressBar ( GtkAdjustment adjustment ); -- Creates a progress bar widget. Mtodos set_bar_style() Sets the progress bar style in percentage mode. set_discrete_blocks() Sets the number of discrete blocks. set_activity_step() Sets the step value in activity mode. set_activity_blocks() Sets the number of blocks in activity mode. set_orientation() Sets the orientation of the bar. update() Sets progress update value. *deprecated* GtkProgressBar Construtor GtkProgressBar ( GtkAdjustment adjustment ); When constructing a progress bar, you need to specify an associated GtkAdjustment which will be used to configure the progress bar's initial value and range. Exemplo 33. Setting up a Progress Bar <?php dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); function update_bar() { global $progressbar, $value; $progressbar->set_percentage($value); start_update(); } function start_update() { global $value; if($value <= 1.0) { $value += 0.01; gtk::timeout_add(200, 'update_bar');

} else gtk::timeout_add(50, array('gtk', 'main_quit')); } $window = &new GtkWindow(); $window->set_uposition(200, 250); $window->set_policy(false, false, true); $window->connect_object('destroy', array('gtk', 'main_quit')); /* These adjustment settings are on the wild side for demo purposes */ $adjustment = &new GtkAdjustment(0.5, 100.0, 200.0, 0.0, 0.0, 0.0); $value = $adjustment->value; $progressbar = &new GtkProgressBar($adjustment); $progressbar->set_show_text(true); $progressbar->set_text_alignment(0.02, 1.0); $progressbar->set_format_string("%v%% complete"); $progressbar->set_usize(gdk::screen_width()/2, 30); $window->add($progressbar); $window->show_all(); start_update(); gtk::main(); ?> To create a progress bar in activity mode, delete the references to the text string and replace them with $progressbar->set_activity_mode(true); and any further methods appropriate to an activity indicator. You will also need to replace $progressbar->set_percentage($value); in the update_bar() function with $progressbar->set_value($value); Note that a progress bar in activity mode will not be redrawn when the values of the lower and upper bounds in the attached GtkAdjustment have been exceeded. GtkProgressBar::set_bar_style void set_bar_style( GtkProgressBarStyle style ); The default style of a progress bar upon creation is GTK_PROGRESS_CONTINUOUS. This method may be used to change it to the style specified in the style parameter (GTK_PROGRESS_CONTINUOUS or GTK_PROGRESS_DISCRETE) when the progress bar is in percentage mode. Note that the progress bar will not display text if it is drawn in the discrete style.

See also: set_discrete_blocks() . GtkProgressBar::set_discrete_blocks void set_discrete_blocks(int blocks); When the progress bar has discrete style, it is divided into a number of blocks. This method can be used to change the number of these blocks. The default value is 10. GtkProgressBar::set_activity_step void set_activity_step(int step); When the progress bar is in the activity mode, this method can be used to set the step value by which the progress bar will be updated on each iteration. Higher values make the progress indicator appear to move faster. The default value is 3. GtkProgressBar::set_activity_blocks void set_activity_blocks(int blocks); When the progress bar is in activity mode, this method can be used to set the number of blocks that make up the progress bar. Larger numbers make the progress indicator smaller. The default value is 5. GtkProgressBar::set_orientation void set_orientation( GtkProgressBarOrientation orientation ); This method can be used to change the orientation of the progress bar. The orientation parameter controls the direction in which the progress indicator grows (in percentage mode) or moves (in activity mode), as the operation progresses. The default setting is GTK_PROGRESS_LEFT_TO_RIGHT. GtkProgressBar::update void update(double percentage); This is a deprecated method that has had its usage replaced by set_percentage() when a progress bar is set to the percentage mode, or by set_value() when using the activity mode. GtkRadioButton

Button that is part of a group, only one of which may be selected. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkButton `-- GtkToggleButton `-- GtkCheckButton `-- GtkRadioButton Direct subclasses None. Descrio A GtkRadioButton is one of a group of similar widgets, only one of which may be selected at any one time. In the version of GTK+ currently used by PHP-GTK there is an issue with the "activate" signal where it is used alongside toggle switches in arrays. In this particular widget, the "clicked" signal is the activating signal, and as a result of this feature repeats itself when another group member is activated. One way around this is to use the "pressed" signal. Another would be to set up a count for each individual function and test that the count is not divisible by 2. Or, depending on the kind of function you are calling, you could simply allow "clicked" to be fired twice. Construtor GtkRadioButton ( GtkRadioButton group , string label); -- Creates one of a group of GtkRadioButton widgets. GtkRadioButton Construtor GtkRadioButton ( GtkRadioButton group , string label); The first GtkRadioButton in a group should have the first parameter set to null. This 'group leader' is not attached to anything; there is not at present such a thing as a GtkGroup widget of any kind. All subsequent GtkRadioButton widgets belonging to the same group should have the variable representing that group leader as the first parameter. Exemplo 34. Constructing a group of radio buttons <?php

dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); function here_goes($button) { $child = $button->child; echo $child->get()."\n"; } $window = &new GtkWindow(); $window->connect_object('destroy', array('gtk', 'main_quit')); $window->set_title('GtkRadioButton demo'); $box = &new GtkVBox(); $window->add($box); $button1 = &new GtkRadioButton(null, 'button 1'); $button1->connect('pressed', 'here_goes'); $box->pack_start($button1); for ($i = 2; $i <= 4; $i++) { $button = &new GtkRadioButton($button1, 'button ' . $i); $button->connect('pressed', 'here_goes'); $box->pack_start($button); } $button_end = &new GtkButton('Exit'); $button_end->connect_object('clicked', array('gtk', 'main_quit')); $box->pack_end($button_end); $window->show_all(); gtk::main(); ?> GtkRadioMenuItem Menu item that is part of a group, only one of which may be selected. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkItem `-- GtkMenuItem `-- GtkCheckMenuItem `-- GtkRadioMenuItem Direct subclasses None.

Descrio A GtkRadioMenuItem is one of a group of similar widgets, only one of which may be selected at any one time. When the GtkMenuItem version of the "activate" signal has been emitted by a GtkRadioMenuItem, there is a second emission as the most recently active item is toggled to inactive. This is dealt with before the original signal is handled. One way around this would be to use the "button-press-event" signal. Another would be to set up a count for each individual function and test that the count is not divisible by 2. Or, depending on the kind of function you are calling, you could simply allow "activate" to be emitted twice. Construtor GtkRadioMenuItem ( GtkRadioMenuItem group , string label); -- Creates one of a group of GtkRadioMenuItem widgets. GtkRadioMenuItem Construtor GtkRadioMenuItem ( GtkRadioMenuItem group , string label); The first GtkRadioMenuItem in a group should have the first parameter set to null. This 'group leader' is not attached to anything; there is not at present such a thing as a GtkGroup widget of any kind. All subsequent GtkRadioMenuItem widgets belonging to the same group should have the variable representing that group leader as the first parameter. It is possible to mix different types of menu item within a GtkMenu. In the following code snippet, Open is the group leader and Save and Print the other options belonging to the group. Note that Exit is not a part of that group, although it is part of the same menu. <?php $menu = &new GtkMenu(); $open = &new GtkRadioMenuItem(null, "Open"); $open->connect('button-press-event', 'open_routine'); $menu->append($open); $save = &new GtkRadioMenuItem($open, "Save"); $save->connect('button-press-event', 'save_routine'); $menu->append($save); $print = &new GtkRadioMenuItem($open, "Print"); $print->connect('button-press-event', 'print_routine');

$menu->append($print); $separator = &new GtkMenuItem(); $menu->append($separator); $exit = &new GtkRadioMenuItem(null, "Exit"); $exit->connect_object('button-press-event','exit_routine', $menu); $menu->append($exit); ?> GtkRange Base class for widgets that manipulate the value of a GtkAdjustment. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkRange Direct subclasses GtkScale, GtkScrollbar Descrio GtkRange is the base class for widgets that allow a user to manipulate the value of a GtkAdjustment. In PHP-GTK 1.0 those widgets are GtkScale and GtkScrollbar. GtkRange is an abstract class and may not be directly instantiated. Mtodos get_adjustment() Returns the widget's adjustment child. set_adjustment() Sets the adjustment child. set_update_policy() Sets the widgets update policy. GtkRange::get_adjustment GtkAdjustment get_adjustment (void); Returns the widget's adjustment child. The returned value should be assigned by reference if you want method calls and other changes to be shown in the adjustment's parent widget. Exemplo 35. Change the current value of an HScale

<?php // Create an hScale object $hScale = &new GtkHScale(new GtkAdjustment(.5, 0, 1, .1, .1, .1)); // Get the adjustment from the hScale $adj =& $hScale->get_adjustment(); // Set the value to zero $adj->set_value(0); ?> See also: set_adjustment() GtkRange::set_adjustment void set_adjustment ( GtkAdjustment adjustment ); Sets the adjustment child to adjustment. This allows you to change the range of values that scale or scroll operates on without recreating the scale or scroll. For instance, if the user narrows the range of acceptable values from 0-100 down to 20-30, all you have to do is replace the GtkAdjustment. See also: get_adjustment() GtkRange::set_update_policy void set_update_policy( GtkUpdateType policy ); Sets the widgets update policy to policy. The update policy describes when the value of the adjustment is changed. When policy is GTK_UPDATE_CONTINUOUS, the value of the adjustment is updated while the slider is being moved. If policy is GTK_UPDATE_DELAYED, the value of the adjustment will be updated when the user has stopped moving the slider. When policy is set to GTK_UPDATE_DISCONTINUOUS, the value of the adjustment will not be changed until the user has released the mouse button and ended the slider drag operation. Anytime the value of the adjustment is changed, the "value-changed" signal is emitted. Exemplo 36. Update Policies <?php // A function to see what is happening. function valueChange() { echo "A value was changed!\n"; } // A window and frame for testing. $window = &new GtkWindow; $frame = &new GtkFrame('Test Area'); // Create an hscale. $hScale = &new GtkHScale(new GtkAdjustment(.5, 0, 1, .05, .05, .05));

// Connect the adjustment signal to the above function. $adj =& $hScale->get_adjustment(); $adj->connect('value-changed', 'valueChanged'); // Switch the uncommented line to see what affect the policy has. $hScale->set_update_policy(GTK_UPDATE_CONTINUOUS); //$hScale->set_update_policy(GTK_UPDATE_DELAYED); //$hScale->set_update_policy(GTK_UPDATE_DISCONTINUOUS); $frame->add($hScale); $window->show_all(); gtk::main(); ?> GtkRuler Base class for horizontal and vertical rulers. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkRuler Direct subclasses GtkHRuler, GtkVRuler Descrio Mtodos set_metric() set_range() draw_ticks() draw_pos() GtkRuler::set_metric void set_metric(GtkMetricType metric); GtkRuler::set_range void set_range(double lower, double upper, double position, double max_size); GtkRuler::draw_ticks

void draw_ticks(void); GtkRuler::draw_pos void draw_pos(void); GtkScale Base class for GtkHScale and GtkVScale. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkRange `-- GtkScale Direct subclasses GtkHScale, GtkVScale Descrio A GtkScale is a widget that looks very like a GtkScrollbar without the arrow buttons at either end and with the ability to display the current value as text. There are some issues with the value display, in that scrolling-aware container widgets will not allow their child's GtkAdjustment to be overwritten, which means that the GtkScale cannot have focus unless it takes the values given by the container to the scrollable widget. This in turn misconfigures the display area, which is calculated with regard to the upper value of the associated adjustment object. When a container sets an adjustment, each value is 0 at the start, and the later values are calculated on the fly after the widgets have been drawn. Although it is possible to use the GtkWidget method queue_resize() to force the text area to resize according to the width of the new adjustment values, the widget does not fully redraw unless it has a configure event - that is, you need to manually resize it and then restore it. For all these reasons, it is unadvisable to use the draw-value feature where the GtkScale is associated with a scrollable widget. Mtodos set_digits() Sets number of decimal places. set_draw_value() Toggles whether value is displayed.

set_value_pos() Sets position of numeric text. get_value_width() Returns string width of numeric text. GtkScale::set_digits void set_digits(int digits); This method sets the number of places to the right of the decimal point in the displayed value. The default number of decimal places is 1. GtkScale::set_draw_value void set_draw_value(bool draw_value); set_draw_value() simply toggles whether the value is displayed as text or not. The default setting is true. GtkScale::set_value_pos void set_value_pos( GtkPositionType pos ); This method determines the position of the text, when it is displayed. The default value is GTK_POS_TOP. GtkScale::get_value_width int get_value_width(void); get_value_width() returns the width of the numeric text string in a GtkScale. The value is given in pixels. GtkScrollbar Base class for GtkHScrollbar and GtkVScrollbar. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkRange `-- GtkScrollbar Direct subclasses GtkHScrollbar, GtkVScrollbar

Descrio GtkScrollbar is a base class providing the object type that GtkHScrollbar and GtkVScrollbar are derived from. This is an abstract class, and as such cannot be constructed directly. GtkScrolledWindow Adds scrollbars to its child widget. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkScrolledWindow Direct subclasses None. Descrio A GtkScrolledWindow is a window that can supply a scrollable child widget with scrollbars. The scrollbars take their adjustment settings from the child widget and do not need adjustment configuration. Children that are not scrollable therefore need to be packed into a widget that has scrolling awareness. GtkViewport is one such widget, and can be added and configured automatically using the convenience method add_with_viewport() . The other widget that can be used for this purpose is GtkLayout, which allows multiple children to be given fixed positions and provides scrollbars. The scrolling-aware widgets are: GtkCList, GtkCTree, GtkLayout, GtkScrolledWindow, GtkText and the catch-all GtkViewport. Note that any scroll key bindings are taken from the child widget in the GtkScrolledWindow, and not from the scrollbars themselves. Construtor GtkScrolledWindow ([ GtkAdjustment hadjustment = NULL , [ GtkAdjustment vadjustment = NULL ]]); -- Creates a scrolling window. Mtodos get_hadjustment()

Returns the horizontal adjustment object. get_vadjustment() Returns the vertical adjustment object. set_policy() Sets scrollbar visibility policies. set_placement() Sets scrollbar positions. add_with_viewport() Convenience method for adding non-scrolling widgets. GtkScrolledWindow Construtor GtkScrolledWindow ([ GtkAdjustment hadjustment = NULL , [ GtkAdjustment vadjustment = NULL ]]); The GtkScrolledWindow widget is derived from GtkBin, and is designed to only have one direct child. One way around this is to add the children to a parent container, make that parent the only child of the window, and bind the container's focus to align with the scrollbars. Alternatively, you could use GtkLayout, which has no such restriction. You do not need to explicitly add a child widget to a GtkViewport if you are using the add_with_viewport() method. You may, however, find that the scrollbars are unresponsive anyway unless you add the child to a box container first. Exemplo 37. Setting up a GtkScrolledWindow <?php dl('php_gtk.'.(strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); /* set up a window */ $window = &new GtkWindow(); $window->set_position(GTK_WIN_POS_CENTER); $window->connect_object('destroy', array('gtk', 'main_quit')); /* set up the main scrolled window and add it to the main window, sizing it if necessary. */ $scrolledwindow = &new GtkScrolledWindow(); $scrolledwindow->set_usize(300, 300); $scrolledwindow->set_policy(GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); $window->add($scrolledwindow); /* create a box container and add child widgets to it */ $box = &new GtkVBox(); $calendar = &new GtkCalendar(); /* let's add a scrollable to an internal scrolled window */ $scrolledwindow2 = &new GtkScrolledWindow(); $scrolledwindow2->set_usize(280, 100); $scrolledwindow2->set_policy(GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);

$text = &new GtkText(); $text->set_editable(true); $scrolledwindow2->add($text); $box->pack_start($calendar, false, false, 5); $box->pack_start($scrolledwindow2); /* add the box container to the main scrolled window and link its focus so that the cursor position is reflected in the scrollbar's adjustment value. You do not need to do this when adding a scrollable widget directly */ $scrolledwindow->add_with_viewport($box); $box->set_focus_vadjustment($scrolledwindow->get_vadjustment()); $scrolledwindow2->show_all(); $box->show_all(); $window->show_all(); gtk::main(); ?> GtkScrolledWindow::get_hadjustment GtkAdjustment get_hadjustment (void); get_hadjustment() returns the GtkAdjustment object that is used in the horizontal scrollbar. The most likely use for this is in combination with set_focus_hadjustment() , where it is needed as a parameter. GtkScrolledWindow::get_vadjustment GtkAdjustment get_vadjustment (void); get_vadjustment() returns the GtkAdjustment object that is used in the vertical scrollbar. The most likely use for this is in combination with set_focus_vadjustment() , where it is needed as a parameter. GtkScrolledWindow::set_policy void set_policy( GtkPolicyType hscrollbar_policy , GtkPolicyType vscrollbar_policy ); Sets the visibility policy for the scrollbars in a GtkScrolledWindow to one of three possible GtkPolicyType values. The default setting is GTK_POLICY_ALWAYS, GTK_POLICY_ALWAYS, which displays both scrollbars regardless of the relative size of the child widget. GtkScrolledWindow::set_placement void set_placement( GtkCornerType window_placement ); This method sets the positions of the scrollbars in a GtkScrolledWindow to one of four possible GtkCornerType values.

These values are a little counter-intuitive because they describe the position of the child, rather than the position of the scrollbars themselves. The default setting is GTK_CORNER_TOP_LEFT, which causes the child to be placed above and to the left of the scrollbars - i.e., the scrollbars are at the bottom and to the right of the child. GtkScrolledWindow::add_with_viewport void add_with_viewport( GtkWidget child ); add_with_viewport() is a convenience function that invisibly adds the child widget to a GtkViewport before adding the viewport to the GtkScrolledWindow. The GtkViewport is a scrolling-aware container that provides its child widget with that characteristic. GtkSelectionData Hierarquia do Objeto GtkSelectionData Direct subclasses None. Descrio Mtodos set() Propriedades selection: target: type: format: length:

data: GtkSelectionData::set void set(void); GtkSelectionData::selection Access: Read Only Type: GdkAtom GtkSelectionData::target Access: Read Only Type: GdkAtom GtkSelectionData::type Access: Read Only Type: GdkAtom GtkSelectionData::format Access: Read Only Type: int GtkSelectionData::length Access: Read Only Type: int GtkSelectionData::data Access: Read Only Type: string GtkSeparator Base class for GtkHSeparator and GtkVSeparator. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkSeparator Direct subclasses GtkHSeparator, GtkVSeparator Descrio GtkSeparator is a base class providing the underlying widget type for GtkHSeparator and GtkVSeparator.

Note that this is an abstract class, and cannot be constructed directly. GtkSocket Container for widgets from other processes. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkSocket Direct subclasses None. Descrio By creating a GtkSocket, an entirely different Gtk application may embed itself into your application. GtkSocket has nothing to do with network sockets. You can't use it to communicate between different computers. GtkPlug and GtkSocket don't work on the Windows operating system. The play between GtkSocket and GtkPlug is the following: * Create a GtkSocket and attach it to a GtkContainer, e.g. a GtkWindow. * Realize the socket (after adding it to the container). Now you can access the socket id via $socket->window->xid. * Create the GtkPlug with the socket id as parameter. * Add whatever you want to the plug - it will appear in the first container. Note that when a GtkSocket is destroyed, the plugged-in GtkPlug application will be destroyed as well. As soon the GtkPlug unplugs from the socket, the GtkSocket can't really be used any more. One could re-realize it, but there will be errors and the socket won't be visible. You can catch the unplugging-event by connecting to the "unrealize" signal of the socket. Note that you also will be notified if you application is being destroyed. There is no other way to do this since the plug-added and plug-removed signals exist in gtk2 only. A use for this widget is that you could write your own editor based on vim by letting it plug into the socket provided by your app: gvim --socketid <id of your socket> Note that you need to have the

gtk version of gvim for this purpose. Construtor GtkSocket (void); -- Creates a new socket instance. Mtodos steal() Re-parents an existing window in the socket GtkSocket Construtor GtkSocket (void); Creates a new socket instance. Note that you have to realize the socket after you have added the widget to a parent container. The other part of the example can be found at the constructor of the GtkPlug widget. Exemplo 38. How to use a GtkSocket <?php if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); } function checkSocketState( $objButton, $objSocket, $lblStatus) { if( $objSocket->window == null) { $lblStatus->set_text( 'The plug has disconnected'); } else if( count( $objSocket->window->children) > 0) { $lblStatus->set_text( 'The plug has plugged in'); } else { $lblStatus->set_text( 'Nobody plugged in'); } } $objSocket = &new GtkSocket(); $window = &new GtkWindow(); $window->set_title( 'socket window'); $window->set_default_size( 300, 300); $window->connect_object('destroy', array('gtk', 'main_quit')); $vbox = &new GtkVBox(); $vbox->pack_start_defaults( $objSocket); $lblStatus = &new GtkLabel( 'status messages go here'); $vbox->pack_start_defaults( $lblStatus); $btnCheck = &new GtkButton( 'check socket state');

$btnCheck->connect( 'clicked', 'checkSocketState', $objSocket, $lblStatus); $vbox->pack_start_defaults( $btnCheck); $window->add( $vbox); $window->show_all(); function unrealized( $objSocket, $btnCheck, $lblStatus) { echo 'The plug has disconnected' . "\r\n"; checkSocketState( $btnCheck, $objSocket, $lblStatus); } $objSocket->connect( 'unrealize', 'unrealized', $btnCheck, $lblStatus); //realize *after* adding it to a box or window $objSocket->realize(); $socketid = $objSocket->window->xid; echo 'socket id to use: ' . $socketid . "\r\n"; if( $GLOBALS['argc'] == 2) { //steal the given window $objSocket->steal( $GLOBALS['argv'][1]); } checkSocketState( null, $objSocket, $lblStatus); gtk::main(); ?> GtkSocket::steal void steal(int wid); This function takes the xid of an existing window and reparents the window into itself, so that the former window acts as a child of the socket. This method is deprecated and does not fully work. Avoid to use it. The following example creates a normal GtkWindow and echoes the xid of its GdkWindow. Pass this id to the example application of the GtkSocket constructor and try to resize this window. Exemplo 39. Stealing a window <?php if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); } $label = &new GtkLabel( 'I\'m an innocent window'); $window = &new GtkWindow(); $window->set_title( 'this window will be stolen'); $window->set_default_size( 200, 100); $window->connect_object('destroy', array('gtk', 'main_quit'));

$vbox = &new GtkVBox(); $window->add( $label); $window->show_all(); echo 'window xid: ' . $window->window->xid . "\r\n"; gtk::main(); ?> GtkSpinButton Widget offering masked numerical entry and/or selection. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkEditable `-- GtkEntry `-- GtkSpinButton Direct subclasses None. Descrio A GtkSpinButton is a widget offering a displayed numerical value which can be incremented or decremented within a pre-set range by the user's clicking on one of two arrow buttons, or by using the Up and Down arrow keys. The display area is a GtkEntry; the spinbutton object currently provides the only built-in means of masking input in GTK+. If you want to restrict the user to the values displayed rather than allowing keyboard input, call set_editable() from the spinbutton. See also: GtkAdjustment, GtkCombo. Construtor GtkSpinButton ([ GtkAdjustment adjustment = NULL , [double climb_rate = 0.0 , [int digits = 0 ]]]); -- Creates an editable rotating display of selectable numbers. Mtodos configure() Configures all elements of a spinbutton. set_adjustment() Sets adjustment object.

get_adjustment() Retrieves adjustment object. set_digits() Sets number of decimal places displayed. get_value_as_float() Retrieves value as float. get_value_as_int() Retrieves value as integer. set_value() Sets value displayed in spinbutton entry field. set_update_policy() Controls update policy. set_numeric() Toggles the way non-numeric input is treated in display. spin() Forces a spin. set_wrap() Toggles whether the display wraps. set_shadow_type() Controls appearance of spinbutton. set_snap_to_ticks() Toggles whether input is aligned with increment. update() Updates value according to settings. GtkSpinButton Construtor GtkSpinButton ([ GtkAdjustment adjustment = NULL , [double climb_rate = 0.0 , [int digits = 0 ]]]); Although the first parameter adjustment is optional, you will find it impossible to create a working GtkSpinButton without harnessing it to an appropriately defined GtkAdjustment, as the first five parameters of the adjustment need to be set for the spinbutton widget to operate. You may either associate the adjustment at this point, or use the set_adjustment() or configure() method at a later point in your script. climb_rate refers to the speed of the spin, rather than its incremental value. Its default setting is 0.0, which runs the internal timer at 20ms per increment (following a 200ms start from the button press). If you intend using this parameter, the value given needs to

be fairly high in order for it to make an appreciable difference. The digits parameter controls the number of decimal places displayed. Exemplo 40. Creating a GtkSpinButton calendar. <?php dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); function collect($d, $m, $y) { echo $d->get_value_as_int(). "-" .$m->get_value_as_int(). "-" .$y->get_value_as_int()."\n"; flush(); } $window = &new GtkWindow(); $window->set_position(GTK_WIN_POS_CENTER); $window->connect_object('destroy', array('gtk', 'main_quit')); $vbox = &new GtkVBox(false, 5); $window->add($vbox); $hbox = &new GtkHBox(false, 5); $hbox->set_border_width(5); $vbox->add($hbox); $daylabel = &new GtkLabel("Day:"); $hbox->pack_start($daylabel, false); $day = date("d"); $dayadj = &new GtkAdjustment($day, 1.0, 31.0, 1.0, 7.0, 0.0); $dayspin = &new GtkSpinButton($dayadj); $dayspin->set_wrap(true); $hbox->pack_start($dayspin, false); $monthlabel = &new GtkLabel("Month:"); $hbox->pack_start($monthlabel, false); $month = date("m"); $monthadj = &new GtkAdjustment($month, 1.0, 12.0, 1.0, 3.0, 0.0); $monthspin = &new GtkSpinButton($monthadj); $monthspin->set_wrap(true); $hbox->pack_start($monthspin, false); $yearlabel = &new GtkLabel("Year:"); $hbox->pack_start($yearlabel, false); $year = date("Y"); $yearadj = &new GtkAdjustment($year, $year-90, $year+10, 1.0, 5.0, 0.0); $yearspin = &new GtkSpinButton($yearadj); $yearspin->set_usize(55, 0); $hbox->pack_start($yearspin, false); $button = &new GtkButton("Collect data");

$button->connect_object('clicked', 'collect', $dayspin, $monthspin, $yearspin); $vbox->add($button); $vbox->show_all(); $hbox->show_all(); $window->show_all(); gtk::main(); ?> See also: GtkAdjustment's "value-changed" signal. GtkSpinButton::configure void configure( GtkAdjustment adjustment , double climb_rate, int digits); This method sets the GtkAdjustment and configures the rate of the spin and number of decimal points displayed in an existing spinbutton. Configuration settings made in this way will overwrite any existing settings on the calling GtkSpinButton. GtkSpinButton::set_adjustment void set_adjustment( GtkAdjustment adjustment ); Call set_adjustment() when you only need to attach an adjustment object to a spinbutton. Otherwise, use configure() . An adjustment associated with a spinbutton in this way will overwrite any exisiting adjustment object. GtkSpinButton::get_adjustment GtkAdjustment get_adjustment (void); get_adjustment() returns the GtkAdjustment object currently associated with the calling spinbutton. GtkSpinButton::set_digits void set_digits(int digits); set_digits() sets the number of digits displayed after the decimal point in the spinbutton's entry field. User input is limited to the constraints of the displayed decimal places. GtkSpinButton::get_value_as_float double get_value_as_float(void);

Retrieves the current value displayed in the spinbutton entry as a float value. Use this in combination with the PHP function round() where you need to collect the value to a specific number of decimal places. <?php $adj = &new GtkAdjustment(0.0, 0.0, 1.0, 0.01, 0.1, 0.0); $spin = &new GtkSpinButton($adj, 0.0, 2); round($spin->get_value_as_float(), 2); ?> GtkSpinButton::get_value_as_int int get_value_as_int(void); Retrieves the current value displayed in the spinbutton entry as an integer. If the value is a fraction, this method rounds it to the nearest whole number. GtkSpinButton::set_value void set_value(double value); set_value() sets the value displayed in the spinbutton's entry field, which is equivalent to the value field in the spinbutton's associated GtkAdjustment. If the lower or upper bounds set in the adjustment are exceeded, the value of the appropriate bound will replace the value passed as the parameter in this method. GtkSpinButton::set_update_policy void set_update_policy( GtkSpinButtonUpdatePolicy policy ); There are only two possible settings for the spinbutton update policy. Setting it as GTK_UPDATE_IF_VALID prevents the current value from being changed where the newly entered value is outside the range determined by the underlying GtkAdjustment. The default setting is GTK_UPDATE_ALWAYS, which allows the update to continue by replacing an invalid value with the value of the nearest range boundary. Note that set_value() . overrides the update policy setting. GtkSpinButton::set_numeric void set_numeric(bool numeric); set_numeric() , when set to true, prevents non-numeric characters

other than the decimal point and positive/negative signs from being displayed in the spinbutton's GtkEntry at the point of being keyed in. Note that inappropriate characters will not be accepted by the underlying GtkAdjustment in any case; this is purely a masking function at display level. GtkSpinButton::spin void spin( GtkSpinType direction , double increment); This method resets the displayed value to a new value that is determined by the GtkSpinType chosen. It is used internally to set up the functions associated with mouse button presses over the spinbutton's arrows. These are, a left click spins one step increment, a middle button click spins one page increment, and a right click spins to the lower or upper bound depending on which arrow is pressed. GtkSpinButton::set_wrap void set_wrap(bool wrap); Where set_wrap() is set to true, the spinbutton having displayed the upper bound of its value range will return to the lower bound on the next step increment. In other words, if the range is 1 to 10, 1 will follow 10 in the display area when the up arrow is pressed. The default setting is false, which greys out the appropriate arrow when the lower or upper bound of the range is reached. GtkSpinButton::set_shadow_type void set_shadow_type( GtkShadowType shadow_type ); Sets the shadow style of the frame around the arrow buttons on a spinbutton using the GtkShadowType options. The default setting is GTK_SHADOW_NONE. GtkSpinButton::set_snap_to_ticks void set_snap_to_ticks(bool snap_to_ticks); set_snap_to_ticks() , if set to true, will restrict input values to the order of the step increment, taking the nearest value to the increment as the input value. For example, if you have set the step increment to 0.5 in a range of 0.0 to 2.5 and the user inputs 1.4, the input will be reset to 1.5 - the nearest incremental value. The default setting is false, which allows the user to key in anything within range to the given number of decimal points. See also: set_digits() .

GtkSpinButton::update void update(void); The update() method is used internally to update the value field in the underlying GtkAdjustment according to the update policy, digits and snap settings. GtkStatusbar Widget that provides a way to report messages of minor importance. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBox `-- GtkHBox `-- GtkStatusbar Direct subclasses None. Descrio A GtkStatusbar is a framed label, usually added to the bottom of a window, that provides a way to report messages of minor importance. It is usually updated fairly frequently. There are two indices in the structure of a statusbar; one is an associative array of message information, and the other is a stack of uniquely-indexed message arrays. The message at the top of the stack is the one currently on display. Where a routine requires a lot of processing, the statusbar may be unable to update during the time taken to do so. You will need to call <?php while (gtk::events_pending()) gtk::main_iteration(); ?> each time the bar has been updated, to allow updating throughout. Construtor GtkStatusbar (void); -- Creates a status bar. Mtodos

get_context_id() Returns the context id from the description. push() Adds message to top of stack. pop() Removes message from top of stack. remove() Removes designated message from stack. Sinais "text-pushed" Emitted when a message is prepended to the stack. "text-popped" Emitted when a message is popped from the top of the stack. GtkStatusbar Construtor GtkStatusbar (void); Creating a status bar is very straightforward; creating and updating messages marginally less so. Exemplo 41. Setting up a status bar. <?php dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); /* function to clear the entry field and give it keyboard focus */ function focusback($entry) { $entry->set_text(''); $entry->grab_focus(); } /* on this occasion, the update function *is* the process */ function change_status($entry, $event, $status, $stuff, &$i) { /* pick up the value(s) you are intending to use */ $value = $event->keyval; $string = $event->string; /* prevent the message stack building up */ $popcontext = $status->get_context_id($stuff[$i]); $status->pop($popcontext); /* sort according to value */ switch($value) { case ($value >= GDK_KEY__a && $value <= GDK_KEY__z): $i = 1; break; case ($value >= GDK_KEY_A && $value <= GDK_KEY_Z): $i = 2;

break; case ($value >= GDK_KEY_0 && $value <= GDK_KEY_9): $i = 3; break; case GDK_KEY_Return: $i = 4; break; case GDK_KEY_space: $i = 5; break; default: $i = 6; } /* create and push the new message according to the value */ $pushcontext = $status->get_context_id($stuff[$i]); if($string && $string!==' ') $status->push($pushcontext, $string.' is a '.$stuff[$i].' character'); else $status->push($pushcontext, $stuff[$i]); /* call any other function the value triggers */ if($i == 4) focusback($entry); } /* set up the main window */ $window = &new GtkWindow(); $window->set_position(GTK_WIN_POS_CENTER); $window->connect_object('destroy', array('gtk', 'main_quit')); /* if you want anything else besides the statusbar, you'll need a box */ $vbox = &new GtkVBox(); $window->add($vbox); /* add the statusbar first, else connecting other widgets to it is messy */ $status = &new GtkStatusbar(); $stuff = array('Here we go...', 'lower case alpha', 'UPPER CASE ALPHA', 'numeric', 'return', 'spacebar', 'non-alphanumeric'); $status->push($status->get_context_id($stuff[0]), $stuff[0]); $vbox->pack_end($status, false); $status->show(); /* create, connect and pack your other widget(s) */ $entry = &new GtkEntry(); $entry->set_usize(400,20); /* this will usually be connect_object(). $entry is only passed here because it is used as a parameter in a function called from the callback. &$i is passed so that the correct message will get 'popped' from the stack */ $i = 1; $entry->connect('key-press-event','change_status', $status, $stuff, &$i); $vbox->pack_start($entry, false); $entry->show(); $window->show_all();

focusback($entry); gtk::main(); ?> GtkStatusbar::get_context_id int get_context_id(string context_description); The GtkStatusbar sets up an internal array of the messages that have been used, as they are being called. The context_id is the array index position that a given message holds. As the message array is created on the fly, it is never the same twice running. The messages that are displayed most frequently during the status bar's lifetime will have low numbers, and a message that is never called will not be added to the array. It is far more efficient to use get_context_id() to generate a context id for a message than it is to allocate your own integer value. The context_description is actually the text string used in the statusbar label. GtkStatusbar::push int push(int context_id, string text); push() prepends the given message to an internal stack in the statusbar, along with its associated context_id. It is best to allow the statusbar to generate the context_id for itself, as the value can then change from one run to another to respond to the user's pattern of interaction with the application. Use get_context_id() to do this. The returned value is a unique message_id, which is needed as a parameter in the remove() method. This is simply an incremented value, beginning at 1. This method causes the "text-pushed" signal to be emitted. GtkStatusbar::pop void pop(int context_id); pop() removes the message that is currently at the top of the statusbar's stack, using the context_id to identify the message. When a message is removed from the stack, the memory that was allocated to it is freed. Given that all messages are generated uniquely, it is good practice to pop() the current message before appending the next. Allowing the stack to build up can add considerably to processing time. This method causes the "text-popped" signal to be emitted.

GtkStatusbar::remove void remove(int context_id, int message_id); This method removes a targeted message from anywhere in the stack. Both the context_id and the message_id can be generated by the statusbar comfortably here as elsewhere in the GtkStatusbar methods. If you use this simply to replace a working pop() function you should see no difference in behaviour; the remove() method even causes the "text-popped" signal to be emitted when it removes a message from the top of the stack. Note that no signal is emitted when messages are taken from elsewhere in the stack. As there is no way to add a message anywhere other than the top of the statusbar's stack - thereby immediately displaying it - this method is basically a way of preventing a stack build-up where the pop/push procedure has proved inappropriate. text-pushed This signal is fired by a GtkStatusbar when the push() method is called. It carries with it the context_id and the text content of the message. Funo Callback void callback(GtkStatusbar statusbar, int context_id, string text); text-popped This signal is fired by a GtkStatusbar when the pop() method is called, and also when when the topmost message in the stack is removed using the remove() method . The signal carries with it the context_id and the text content of the message. Funo Callback void callback(GtkStatusbar statusbar, int context_id, string text); GtkStyle A class that determines the appearance of widgets. Hierarquia do Objeto GtkStyle Direct subclasses None. Descrio

GtkStyle is a structure that is used to define the colors displayed in any widget, or across an application. Being a GtkWidget property, it is accessible through all objects that take up screen space, using the syntax: <?php $style = $widget->style; ?> It is also possible to create a new GtkStyle object in the normal way, e.g. <?php $style = &new GtkStyle(); ?> or to take the default application style: <?php $style = gtk::widget_get_default_style(); ?> in order to change the style across an application. Setting a style across an application can also be achieved by using rc files. There are two in the PHP-GTK test directory which are used in gtk.php. The style functions are generally not buggy, the only known exception being where the text and base properties are intended to describe text and its normally-white background. In some cases this has not worked, and you may find that you need to use fg to color the text. In all cases where the property type is given as array, what is being referred to is an array consisting of the five GtkStateType states. Construtor GtkStyle (void); -- Creates a new style for a widget. Mtodos copy() Copies an existing style. Propriedades black: The color being used as black.

white: The color being used as white. font: The font. black_gc: Graphics information for the black color. white_gc: Graphics information for the white color. colormap: The colormap currently being used. fg: Foreground colors. bg: Background colors. light: dark: mid: Midway between light and dark. text: Colors for a text widget. base: Text background. fg_gc: Graphics information for the foreground colors. bg_gc: Graphics information for the background colors. light_gc: dark_gc: mid_gc: text_gc: Graphics information for the text foreground colors.

base_gc: Graphics information for the text background colors. bg_pixmap: Background pixmaps. GtkStyle Construtor GtkStyle (void); There are several ways to define the style across an application, but only two ways to directly set the style on a given widget. Exemplo 42. Writing to a widget's style property. <?php if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); } $window = &new GtkWindow(); $window->set_position(GTK_WIN_POS_CENTER); $window->connect_object('destroy', array('gtk', 'main_quit')); /* set up a few buttons just to prove we're only changing one of them */ $bbox = &new GtkVButtonBox(); $window->add($bbox); for($i = 0; $i < 8; $i++) { $button[$i] = &new GtkButton("This is Button $i"); $bbox->pack_start($button[$i], false); $button[$i]->show(); } /* method 1 : set up a new style and define the parts you want to define. The remaining style elements retain the application's default settings. */ $newstyle = &new GtkStyle(); $cyan = &new GdkColor('#00FFFF'); $newstyle->fg[GTK_STATE_PRELIGHT] = $cyan; $label = $button[5]->child; $label->set_style($newstyle); /* gdk::color_parse() uses a color that is defined on your system to fill a GdkColor structure. It can be more convenient than manually creating a new GdkColor, particularly if you're only assigning the color once. */ $newstyle->bg[GTK_STATE_NORMAL] = gdk::color_parse('ivory'); $button[5]->set_style($newstyle); /* method 2 : copy the existing style from a widget and alter it. Defining a new style would overwrite the existing non-default style settings. */ $style2 = $label->style; $newstyle2 = $style2->copy(); $font = gdk::font_load('-*-Arial-bold-r-normal--*-160-*-*-p-0-iso8859-1'); $newstyle2->font = $font; $label->set_style($newstyle2);

$window->show_all(); gtk::main(); ?> GtkStyle::copy GtkStyle copy(void); copy() takes an existing style and copies it wholesale, including any prior modifications that have been made to it. GtkStyle::black Access: Read Write Type: GdkColor Returns the a GdkColor object representing the black color. $style = &new GtkStyle; $style->bg[GTK_STATE_NORMAL] = $style->black; You can even overwrite the color with your own: $style = &new GtkStyle; $red = &new GdkColor('#FF0000'); $style->white = $red; GtkStyle::white Access: Read Write Type: GdkColor Returns the a GdkColor object representing the white color. $style = &new GtkStyle(); $style->fg[GTK_STATE_NORMAL] = $style->white; GtkStyle::font Access: Read Write Type: GdkFont Returns or sets the current font of the style. $style = &new GtkStyle(); $style->font = gdk::font_load( '-bitsteam-bitstream vera sans mono-bold-r-norma l-*-24-*-*-*-*-*-*-*'); GtkStyle::black_gc Access: Read Write Type: GdkGC The GdkGC object for the black color. GtkStyle::white_gc

Access: Read Write Type: GdkGC The GdkGC object for the white color. GtkStyle::colormap Access: Read Write Type: GdkColormap Sets or returns the GdkColormap used by this style. GtkStyle::fg Access: Read Write Type: Array Returns an array of 5 foreground GdkColors used for the different states a widget can reach. $newstyle = &new GtkStyle(); $cyan = &new GdkColor('#00FFFF'); $newstyle->fg[GTK_STATE_PRELIGHT] = $cyan; GtkStyle::bg Access: Read Write Type: Array Returns an array of 5 background GdkColors used for the different states a widget can reach. $newstyle = &new GtkStyle(); $newstyle->bg[GTK_STATE_PRELIGHT] = $newstyle->white; Note that GtkLabel does not allow the background color to be changed, so you have to set the background of the parent widget, e.g. the GtkButton. GtkStyle::light Access: Read Write Type: Array GtkStyle::dark Access: Read Write Type: Array GtkStyle::mid Access: Read Write Type: Array GtkStyle::text

Access: Read Write Type: Array Returns an array of 5 text GdkColors used for the different states a widget can reach. GtkStyle::base Access: Read Write Type: Array Returns an array of 5 text background GdkColors used for the different states a widget can reach. GtkStyle::fg_gc Access: Read Write Type: Array Returns an array of 5 foreground GdkGC objects, one for each state a widget can reach. GtkStyle::bg_gc Access: Read Write Type: Array Returns an array of 5 background GdkGC objects, one for each state a widget can reach. GtkStyle::light_gc Access: Read Write Type: Array GtkStyle::dark_gc Access: Read Write Type: Array GtkStyle::mid_gc Access: Read Write Type: Array GtkStyle::text_gc Access: Read Write Type: Array Returns an array of 5 text foreground GdkGC objects, one for each state a widget can reach.

GtkStyle::base_gc Access: Read Write Type: Array Returns an array of 5 text background GdkGC objects, one for each state a widget can reach. GtkStyle::bg_pixmap Access: Read Write Type: Array Returns an array of 5 pixmaps, one for each state a widget can reach. You can set it the following way: $bookicon = array("16 16 6 1", " c None s None",". c black","X c red","o c yellow","O c #808080", "# c white"," "," .. "," ..XX. "," . .XXXXX. ", " ..XXXXXXXX. ",".ooXXXXXXXXX. ","..ooXXXXXXXXX. ",".X.ooXXXXXXXXX. ",".X X.ooXXXXXX.. ", " .XX.ooXXX..#O "," .XX.oo..##OO. "," .XX..##OO.. "," .X.#OO.. "," ..O.. ", " .. "," "); $transparent = &new GdkColor(0, 0, 0); list( $pixmap, $mask) = Gdk::pixmap_create_from_xpm_d($window->window, $transpa rent, $bookicon); $style = &new GtkStyle; $style->bg_pixmap[GTK_STATE_NORMAL] = $pixmap; GtkTable Container that provides a flexible grid for packing its children. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkTable Direct subclasses None. Descrio A GtkTable is a very adaptable container widget that is capable of having the layout of its children structured in both directions. There is a more simplistic version of a similar container in GtkFixed, but GtkTable offers the advantage that the child positions can be relative rather than absolute. The table's

stucturing is similar to that of a GtkBox. As with the box classes, there is an underlying single-child structure containing packing information, which consitutes one element of the array of child data in a GtkTable. This element is known as a GtkTableChild, and can be accessed through the children property inherited from GtkContainer. The child objects themselves can also be accessed more directly through the children() method inherited from the same ancestor. Construtor GtkTable ([int rows = 1 , [int columns = 1 , [bool homogeneous = FALSE ]]]); -- Creates a container whose children are arranged on a grid. Mtodos resize() Resizes to accommodate changes. attach() Means of arranging child widgets in a GtkTable. attach_defaults() Packing defaults. set_row_spacing() Determines the space below a given row. set_col_spacing() Determines the space to the right of a given column. set_row_spacings() Determines the spacing between all rows. set_col_spacings() Determines the spacing between all columns. set_homogeneous() Sets all child allocations to size of largest request. Propriedades children: Array of GtkTableChild elements. nrows: Number of rows. ncols: Number of columns.

column_spacing: Spacing between columns. row_spacing: Spacing between rows. homogeneous: Determines whether child sizing is homogeneous. GtkTable Construtor GtkTable ([int rows = 1 , [int columns = 1 , [bool homogeneous = FALSE ]]]); It is not necessary to give the dimensions of a non-homogeneous GtkTable in the constructor, as the table will pick up the layout from the information given as its children are attached to it, and this will override the initial integer settings. If homogeneous is set to true the reverse will be the case, and the table's settings take precedence. You will find that you need to use the attach() method throughout, as the way in which the add() method generally used in containers is implemented in GTK+ to always position an added child at 0, 1, 0, 1. Once a grid square has been filled, the widget taking up that space cannot be overwritten by another widget. The remove() method is fully operational. The child widget sizing in a non-homogeneous GtkTable is relative, and will alter if one or more children is removed or resized. Again, this is not true for the child widgets in a homogeneous table. There are a lot of parameters in the attach() method - nine in total four of which are optional. Basically, if the homogeneous parameter in the constructor is set to true, there is very little point most of the time in using any of the four optional packing parameters. These come into their own when the children are not required to take up the same amount of space. Exemplo 43. Packing a GtkTable with differently-sized child widgets <?php dl("php_gtk." . (strstr(PHP_OS, "WIN") ? "dll" : "so")); $window = &new GtkWindow(); $window->set_position(GTK_WIN_POS_CENTER); $window->connect_object("destroy", array("gtk", "main_quit")); $table = &new GtkTable(); $table->set_row_spacings(5); $table->set_col_spacings(5); $window->add($table);

$text = &new GtkText(); $table->attach($text, 1, 4, 1, 3); $label = &new GtkLabel('Expand this window to see the difference between the GtkAttachOptions settings.'); $table->attach($label, 1, 4, 4, 5, GTK_SHRINK, GTK_SHRINK); $button = &new GtkButton('Button '); $table->attach($button, 4, 6, 3, 4, GTK_SHRINK, GTK_SHRINK, 3, 3); $button = &new GtkButton('Button 2 '); $table->attach($button, 4, 6, 4, 5, GTK_FILL, GTK_FILL, 3, 3); $button = &new GtkButton('Button 3 '); $table->attach($button, 4, 6, 5, 6, GTK_FILL|GTK_EXPAND, GTK_FILL|GTK_EXPAND, 3, 3); $window->show_all(); gtk::main(); ?> GtkTable::resize void resize(int rows, int columns); This method is used internally to resize the table and rearrange the child widgets accordingly following a new child's attachment to a non-homogeneous table, or a change in the size of the largest child in a homogeneous table. It can be used to redraw a homogeneous table with a new number of rows and columns, all of which will have the same size as existing rows and columns. It has no external use in a non-homogeneous table. GtkTable::attach void attach( GtkWidget child , int left_attach, int right_attach, int top_attach, int bottom_attach, [ GtkAttachOptions xoptions = GTK_EXPAND|GTK_FILL , [ GtkAttachOptions yoptions = GTK_EXPAND|GTK_FILL , [int xpadding = 0 , [int ypadding = 0 ]]]]); attach() is the method used to pack child widgets in a GtkTable. Of the nine parameters delineated, five are absolutely needed. The first parameter refers to the child widget that is to be attached. The following pair of parameters denote the starting point that the child will be drawn from, at the left hand side, and the end point that the child will be drawn to, to the right. These parameters are given in terms of columns, with the start point being 0.

The pair after this denote the starting point that the child will be drawn from, at the top, and the end point that the child will be drawn to, at the bottom. These parameters are given in terms of rows, with the start point again being 0. It is possible for a single child widget to span several rows or columns. As with all container widgets, the container itself takes up no screen space until it contains a child widget or child widgets. If you attach only one child with parameters that should set it in the bottom right corner and set homogeneous to false, the resulting effect will not be that of a table with only one entry in the bottom right corner, but of a container with a single widget in it - regardless of the number of columns and rows specified in the table's constructor. Child settings always take precedence in a non-homogeneous table, and so all table attachments are relative to the other child widgets. This is in line with the behaviour of other multiple-child capable containers where the child widget can have its own packing parameters set. The behaviour is very different when a regular grid is in position, which happens when the GtkTable has its homogeneous parameter set to true. The table can work out the dimensions of the grid from the the largest child widget's size request, and positions its children accordingly. The final four optional parameters determine the way in which the child widget will respond to the area available to it (expand, shrink, fill) in each direction, and the padding between the child and its nearest border, in each direction. GtkTable::attach_defaults void attach_defaults( GtkWidget widget , int left_attach, int right_attach, int top_attach, int bottom_attach); The extra four parameters in attach() are all optional in PHP-GTK, rendering this method unnecessary. GtkTable::set_row_spacing void set_row_spacing(int row, int spacing); Use this method to set the spacing below a given row, in pixels. Note that it only works when the row below the given row is populated and contains a child's upper edge. The row count begins at 0. GtkTable::set_col_spacing void set_col_spacing(int column, int spacing); Use this method to set the spacing to the right of a given column, in

pixels. Note that it only works when the column to the right of the given column is populated and contains a child's leftmost edge. The column count begins at 0. GtkTable::set_row_spacings void set_row_spacings(int spacing); Use this method to set the spacing between all rows, in pixels. The default setting is 0. GtkTable::set_col_spacings void set_col_spacings(int spacing); Use this method to set the spacing between all columns, in pixels. The default setting is 0. GtkTable::set_homogeneous void set_homogeneous(bool homogeneous); set_homogeneous() when set to true makes all child widgets' allocated areas the same size as that of the child requesting the most space. In most cases, this would be better set at the point of construction. GtkTable::children Access: Read Only Type: array The children property consists of an array of GtkTableChild elements. If you need to access a widget, e.g. to change the text in a label, use the GtkContainer method children() , which separates the widget element out of this property. GtkTable::nrows Access: Read Only Type: int The nrows property consists of the number of rows currently contained in a GtkTable. GtkTable::ncols Access: Read Only Type: int The ncols property consists of the number of columns currently

contained in a GtkTable. GtkTable::column_spacing Access: Read Only Type: int column_spacing returns the column spacing that has been set for the entire table using set_col_spacings() , or 0 if none has been set. GtkTable::row_spacing Access: Read Only Type: int row_spacing returns the row spacing that has been set for the entire table using set_row_spacings() , or 0 if none has been set. GtkTable::homogeneous Access: Read Only Type: bool homogeneous when queried returns 1 (true) if the table is homogeneous, or 0 (false) if it is not. GtkTableChild Helper class for GtkTable. Hierarquia do Objeto GtkTableChild Direct subclasses None. Descrio A GtkTableChild is an array of information about a GtkTable's child, which is itself stacked in the array that makes up the table's children property. Accessing these properties is therefore a two-tiered process: <?php $children = $table->children; /*returns an array of GtkTableChild elements*/ for($i = 0; $i < count($children); $i++) { $child = $children[$i]; /*returns the individual GtkTableChild element from the $children array's

current pointer position*/ $widget = $child->widget; /*returns the widget property of the GtkTableChild*/ echo $widget->get_name()."\n"; } ?> Propriedades widget: The child widget. left_attach: Leftmost anchor. right_attach: Rightmost anchor. top_attach: Upper anchor. bottom_attach: Base anchor. xpadding: Padding to left and right. ypadding: Padding to top and bottom. xexpand: Child expansion left to right. yexpand: Child expansion top to bottom. xshrink: Child shrink left to right. yshrink: Child shrink top to bottom. xfill: Child fill left to right. yfill: Child fill top to bottom. GtkTableChild::widget

Access: Read Only Type: GtkObject The widget property returns the child widget. GtkTableChild::left_attach Access: Read Only Type: int The left_attach property returns the number of the column that the child widget is attached to on the leftmost side. The column count begins at 0. GtkTableChild::right_attach Access: Read Only Type: int The right_attach property returns the number of the column that the child widget is attached to on the rightmost side. The column count begins at 0. GtkTableChild::top_attach Access: Read Only Type: int The top_attach property returns the number of the row that the child widget is attached to on the upper side. The row count begins at 0. GtkTableChild::bottom_attach Access: Read Only Type: int The bottom_attach property returns the number of the row that the child widget is attached to at the base. The row count begins at 0. GtkTableChild::xpadding Access: Read Only Type: int The xpadding property returns the integer value in pixels of the padding between the widget and the left and right edges of its allocated area. GtkTableChild::ypadding Access: Read Only Type: int The ypadding property returns the integer value in pixels of the

padding between the widget and the top and bottom edges of its allocated area. GtkTableChild::xexpand Access: Read Only Type: bool Returns true if the GTK_EXPAND flag is set on the x axis. GtkTableChild::yexpand Access: Read Only Type: int Returns true if the GTK_EXPAND flag is set on the y axis. GtkTableChild::xshrink Access: Read Only Type: int Returns true if the GTK_SHRINK flag is set on the x axis. GtkTableChild::yshrink Access: Read Only Type: int Returns true if the GTK_SHRINK flag is set on the y axis. GtkTableChild::xfill Access: Read Only Type: int Returns true if the GTK_FILL flag is set on the x axis. GtkTableChild::yfill Access: Read Only Type: int Returns true if the GTK_FILL flag is set on the y axis. GtkTearoffMenuItem Menu item used to tear off and reattach its menu. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer

`-- GtkBin `-- GtkItem `-- GtkMenuItem `-- GtkTearoffMenuItem Direct subclasses None. Descrio A GtkTearoffMenuItem is a dedicated type of GtkMenuItem that can be prepended to a menu in order to give the user the option of tearing off the popped-up menu from its parent object (usually a menu item in a GtkMenuBar), and keeping it within an independant, non-resizeable GtkWindow of its own. The widget appears as a dotted line across the top of the menu when the menu is attached to a parent object, or as a dotted line with a left-pointing arrow where the menu is detached. Clicking on the dotted line detaches an attached menu, and clicking on the arrow of a detached menu re-attaches it to the parent. Construtor GtkTearoffMenuItem (void); -- Creates the means to tear off a menu. GtkTearoffMenuItem Construtor GtkTearoffMenuItem (void); A GtkTearoffMenuItem will only work for a full menu, not for part of one. It therefore needs to be prepended so that it takes the 0 position in the GtkMenu where it is used: <?php $menu = &new GtkMenu(); $tearoff = &new GtkTearoffMenuItem(); $menu->prepend($tearoff); ?> GtkText Editable text-display widget. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkEditable

`-- GtkText Direct subclasses None. Descrio GtkText provides a scrolling widget with a white background which can have text strings passed to it programmatically or directly from the keyboard (if it is set to be editable). There are a number of keybindings for the editing features; these are listed under GtkEditable, as they are generally shared by the GtkEntry widget. GtkText is one of two widgets marked as BROKEN throughout the 1.3 series of GTK+ releases, and is being replaced entirely by a new set of text and editing widgets in GTK 2.0. If you can avoid using it, do so. If you can't, be aware that it has issues which are never going to be fixed. One of these issues is that the horizontal GtkAdjustment does not work in the GtkText widget, and that trying to declare it as anything other than NULL causes the application to stall. There is no problem with the vertical adjustment, and a vertical scrollbar associated with the text widget will work just fine. Another feature is that it cannot cope with very frequent text updates for long, that being when you're most likely to generate a string that is too big for its XWindow to handle. You may find it better to use a GtkCList if you are using it to display the output for any form of network monitoring, for example. There is also a problem with the linewrap when the GtkText widget is utilised under Windows, causing it to display 'little black boxes' at every soft wrap. You can get around this by using PHP's wordwrap() function to create a line-end within the GTK line-end, but bear in mind that PHP uses a given number of characters to determine the length of the line, whereas GTK uses pixels to configure the relationship between the font size, the line-end, and the container's border. See also: GtkEditable, GdkFont, GtkFontSelectionDialog. A final note: the signal set_scroll_adjustments has not been covered here as it is purely used internally to allow the text widget to communicate with scrolling-aware container widgets. GtkText has been deprecated since GTK+ 2.0 and should not be used in newly written code. Construtor GtkText ([ GtkAdjustment hadj = NULL , [ GtkAdjustment vadj = NULL ]]);

-- Creates a scrollable text widget. Mtodos set_editable() Toggles whether text widget is editable. set_word_wrap() Toggles whether words at the end of a line can be broken. set_line_wrap() Toggles whether text should be wrapped at the widget boundary. set_adjustments() Specifies the GtkAdjustments to be used. set_point() Sets insertion point. get_point() Returns the current insertion point. get_length() Returns length of string. freeze() Freezes display. thaw() Thaws display. insert() Inserts a string of text. backward_delete() Deletes characters prior to insertion point. forward_delete() Deletes characters ahead of insertion point. Propriedades hadj: Horizontal adjustment. *broken* vadj: Vertical adjustment. GtkText Construtor GtkText ([ GtkAdjustment hadj = NULL , [ GtkAdjustment vadj = NULL ]]);

Creates a text widget that is by default scrollable up and down using the bound keys given below, when there is enough text present. The horizontal adjustment, and therefore the horizontal scrolling, do not work; the horizontal adjustment parameter in the constructor should always be declared as null (the default setting) for that reason. Tabela 7. Key bindings for scrolling GtkText Key combination Scroll function Control + Home Move to the top of the text Control + End Move to the end of the text Page Up Move up one page increment Page Down Move down one page increment Up arrow Move up one line Down arrow Move down one line Exemplo 44. Adding a scrollbar to a GtkText widget <?php dl('php_gtk.'.(strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); $window = &new GtkWindow(); $window->set_position(GTK_WIN_POS_CENTER); $window->connect_object('destroy', array('gtk', 'main_quit')); $box = &new GtkHBox(); $window->add($box); $text = &new GtkText(); $text->set_word_wrap(true); $string = "This is a string of text which will be displayed in the GtkText widget.\n\nIt isn't long enough to allow scrolling, so you will probably need to extend it.\n\nOn the other hand, the box isn't sized, so it may just creep over that limit and be a useful demonstration after all."; if(strstr(PHP_OS, 'WIN')) $string = wordwrap($string, 26); $text->insert_text($string, 0); $box->pack_start($text); $adj = $text->vadj; $scrollbar = &new GtkVScrollbar($adj); $box->pack_end($scrollbar, false); $window->show_all(); gtk::main(); ?> GtkText::set_editable void set_editable(bool editable); set_editable() , when set to true, allows the user to write to or manipulate existing text displayed in the widget.

The default setting is false. GtkText::set_word_wrap void set_word_wrap(bool word_wrap); This method, when set to true, ensures that words that would otherwise be broken when reaching a line end are kept in one piece and moved to the beginning of the next line. If you are using the PHP wordwrap() function, you will need to use it in tandem with the GTK set_word_wrap() method. The default setting is false. GtkText::set_line_wrap void set_line_wrap(bool line_wrap); set_line_wrap() , when set to true ensures that the text is sensitive to the boundaries of the GtkText widget and will wrap within them. The default setting is true. See also: set_word_wrap() . GtkText::set_adjustments void set_adjustments( GtkAdjustment hadj , GtkAdjustment vadj ); In most cases, set_adjustments() is a redundant method, as it is already used internally by scrolling-aware containers to create appropriate adjustment settings for the size of the text widget. This pre-setting by a container cannot be overridden. Where you need to use this method, the first parameter must always be null due to the malfunctioning hadj property in a GtkText widget. GtkText::set_point void set_point(int index); set_point() sets the point in the string index where any extraneous text should be inserted. This means that the initial string has to exist in the first place. If the text widget has focus at the time when this method is called, the insertion point will be reflected in the position of the cursor. Note that an insertion point beyond the length of the existing string (that is, the entire existing GtkText content) cannot be set in this way.

GtkText::get_point int get_point(void); This method returns the current insertion point, which is the position taken by the cursor. By default, that will be the position following the final character in the string that makes up the entire existing GtkText content. GtkText::get_length int get_length(void); This method returns the length of the string making up the current text widget contents, measured in characters. If you need to measure separate elements of the text contents, use the PHP function strlen() instead. GtkText::freeze void freeze(void); Call the freeze() method prior to any text update. This prevents the display from flickering during the time it takes for the update to be made, as the full update is only drawn once rather than for every new character. See also: thaw() . GtkText::thaw void thaw(void); The thaw() method is the corollary to the freeze() method, and should be used in conjunction with it. Call this method following an update to redraw the display. GtkText::insert void insert( GdkFont font , GdkColor fore , GdkColor back , string chars, [int length = -1 ]); This is a complex method offering more control over the appearance of the text in a GtkText widget than the alternative insert_text() inherited from GtkEditable. It also has the bonus that it allows some support for internationalization on all platforms, although multibyte conversion under win32 is not currently included in this. Any of the first three parameters can be passed as null, making it possible to define only one aspect of the text's appearance, or many. The first parameter font is a GdkFont. If you are intending to change fonts, you will need to call the static function gdk::font_load()

beforehand in order to define your chosen font. The next two parameters use GdkColor objects to describe the foreground and background colors of the text; again, you will need to define these in order to use them. The first of these is the color of the text itself, the second is the color of the 'page' behind it. Note that setting the back will only change the color for the area that is taken up by the string itself, and not for the entire widget or to the widget's border when the end of the text is reached. The final two parameters are chars, the string of text to insert; and the optional length, which can be used to limit the extent of the string where it is being input by a user. The default length -1 will allow the entire string. You can use the current default style with: $text->insert(null, null, null, "A string of text."); GtkText::backward_delete int backward_delete(int nchars); Deletes the number of characters stipulated, back from the current insertion point. Note that these are literal numbers, and that shortcuts such as 0 and -1 cannot be used here. GtkText::forward_delete int forward_delete(int nchars); Deletes the number of characters stipulated, forward from the current insertion point. Note that these are literal numbers, and that shortcuts such as 0 and -1 cannot be used here. GtkText::hadj Access: Read Only Type: GtkAdjustment The hadj property is a GtkAdjustment that simply does not work in the GtkText widget. It should always be declared as null at the creation stage, and will always have adjustment settings of 0 throughout for that reason. GtkText::vadj Access: Read Only Type: GtkAdjustment The vadj property is a GtkAdjustment widget. Use this property to

interrogate the adjustment settings that have been pre-set by the GtkText widget's parent container. It can also be used to set the adjustment value for an associated GtkScrollbar. GtkTipsQuery Displays help about widgets in the user interface. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkMisc `-- GtkLabel `-- GtkTipsQuery Direct subclasses None. Descrio The TipsQuery is a label which displays the tooltips of the widgets the mouse hovers. First it has to be activated with start_query() : The mouse cursor changes and the label comes to life, displaying the tooltips of the hovering widget. The query is automatically deactivated when the user clicks somewhere. With the help of the "widget_entered" signal, one could display a small tool tip showing the extendet data of a tooltip or call a help browser. For this purpose, the private (extendet) tooltip data could contain location of the page the help browser should display. GtkTipsQuery has been deprecated since GTK+ 2.0 and should not be used in newly written code. Construtor GtkTipsQuery (void); -- Creates a new TipsQuery object. Mtodos start_query() Activates the widget stop_query() Stops a started query set_caller() Sets the widget which initiates the query, usually a button.

set_labels() Sets the tooltip label for non-active states. Sinais "widget_entered" Emitted when an active tips query enters a widget by hovering it. "widget_selected" Emitted when a widget is clicked while a tips query is active. GtkTipsQuery Construtor GtkTipsQuery (void); Creates a new TipsQuery object. GtkTipsQuery::start_query void start_query(void); Activates the tip query widget, so that it takes control over the mouse and displays a question cursor. The query label will show the tooltip of the widget the mouse hovers. Before starting a query, you should call the set_caller() function. GtkTipsQuery::stop_query void stop_query(void); Stops a query started with the start_query() function. GtkTipsQuery::set_caller void set_caller(GtkWidget caller); Sets the widget which initiates the query, usually a button. If the caller is selected while the query is running, the query is automatically stopped and the "widget_selected" is not called for this widget. This function has to be called before a query is started. GtkTipsQuery::set_labels void set_labels(string label_inactive, string label_no_tip); The label_inactive is shown when the tip query widget is not in use, means not activated. It is shown the first time when the query has been used once. The label_no_tip is shown when the tip query is active, but the widget beneath the pointer has no tooltip.

widget_entered Emitted when an active tips query enters a widget by hovering it. Funo Callback void callback(GtkTipsQuery tips_query, GtkWidget widget, string tip_text, string tip_private, GdkEvent event); widget_selected Emitted when a widget is clicked while a tips query is active. After the click, the query is stopped. The widget set by set_caller() does not emit this signal; it stops the query immediately. Note that the callback is called twice: When the user clicks the button, and when he releases it. Funo Callback void callback(GtkTipsQuery tips_query, GtkWidget widget, string tip_text, string tip_private, GdkEvent event); GtkToggleButton Button that retains its state. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkButton `-- GtkToggleButton Direct subclasses GtkCheckButton Descrio A GtkToggleButton is a button that will retain its state following activation. This can be either the active state, GtkStateType GTK_STATE_ACTIVE, or the normal state, GTK_STATE_NORMAL. The active state has the appearance of a button that has been pressed down and not released. The "toggled" signal is emitted as part of the process when the button is activated. Activation also triggers a change from the current state to its opposite value.

GtkToggleButton also provides some base elements for GtkCheckButton and GtkRadioButton widgets. Construtor GtkToggleButton ([string label ]); -- Creates a button that can be toggled between two states. Mtodos set_mode() Toggles indicator mode. set_active() Sets state. get_active() Returns true if active. toggled() Causes the "toggled" signal to be emitted. Sinais "toggled" Emitted when the toggled() method is called. Propriedades draw_indicator: Toggle indicator display. GtkToggleButton Construtor GtkToggleButton ([string label ]); $togglebutton = &new GtkToggleButton("GtkToggleButton's label"); creates a GtkToggleButton that can be toggled between active and normal states. GtkToggleButton::set_mode void set_mode(bool draw_indicator); set_mode() is used internally to set the indicator mode for the different varieties of toggle button. There is no reason to use it unless you are creating your own widget. This method toggles whether the toggle indicator is drawn or not. In GtkToggleButton itself, the indicator happens to take up the entire surface of the button, so that if the draw_indicator parameter is set

to true the button itself vanishes. In the classes that inherit the GtkToggleButton methods the indicator takes up a very small area of the button, and setting the mode as false in those classes removes the indicator from the button, leaving only a GtkToggleButton with an offset label. GtkToggleButton::set_active void set_active(bool is_active); set_active() determines whether the GtkToggleButton's initial state is GTK_STATE_ACTIVE or otherwise. The default setting is false. GtkToggleButton::get_active bool get_active(void); get_active() returns true if the calling GtkToggleButton's current state is GTK_STATE_ACTIVE. GtkToggleButton::toggled void toggled(void); toggled() makes the calling GtkToggleButton emit the "toggled" signal. This method is called internally when the "clicked" signal is fired, that is, when the user either clicks the mouse over the button or presses the Enter or Space key while the button is selected. toggled The "toggled" signal is emitted when the toggled() method is called. This happens whenever the button is activated. As part of the response to the button classes' activating signal "clicked", the state of the toggle indicator is switched from GTK_STATE_ACTIVE to GTK_STATE_NORMAL or vice versa. Note that this state-switching has no relationship with the "toggled" signal itself. Funo Callback void callback(GtkToggleButton togglebutton); GtkToggleButton::draw_indicator Access: Read Only Type: bool The draw_indicator property is the setting that denotes whether the toggle indicator is drawn or not. It is exposed here so that the value of the indicator's mode setting can be tested programmatically. The property can be accessed using the syntax

$togglebutton->draw_indicator; The draw_indicator property should not be accessed directly. Use set_mode() where the value needs to be changed. GtkToolbar Container that creates bars of buttons and other widgets. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkToolbar Direct subclasses None. Descrio Horizontal or vertical container for bars of buttons and other widgets. Toolbars are used to give the user access to often used functions like "New document", "Open", "Save" and such. The toolbar can show buttons of text and icons as well as only one of both, which can be set during runtime. The methods insert_element() , append_element() , prepend_element() , insert_item() , append_item() and prepend_item() as well as all the properties are available since PHP-Gtk 1.0.1 only. Construtor GtkToolbar (GtkOrientation orientation, GtkToolbarStyle style); -- Creates a new toolbar instance. Mtodos add() Appends an existing widget to the toolbar. append_space() Adds a spacer element to the end. prepend_space() Adds a spacer element before the first item. insert_space() Inserts a spacer element at the given position.

append_element() Adds a new toolbar element button to the end. prepend_element() Adds a new toolbar element before the first item. insert_element() Inserts a new toolbar element at the given position. append_item() Adds a new button to the end. prepend_item() Adds a new button before the first item. insert_item() Inserts a new button at the given position. append_widget() Adds a widget to the end. prepend_widget() Adds a widget before the first item. insert_widget() Inserts a widget at the given position. set_orientation() Sets the toolbar orientation to horizontal or vertical. set_style() Sets the text/icon style. set_space_size() Sets the width/height which a space takes. set_space_style() Sets the space style: line or invisible. set_tooltips() Enables or disables the display of tooltips set_button_relief() Sets the relief style for buttons on the toolbar get_button_relief() Returns the button relief style. Sinais "style-changed" Emitted when the style has changed. "orientation-changed"

Emitted when the orientation has changed. Propriedades orientation: Returns the orientation (horizontal or vertical) of the toolbar space_size: Returns the width/height which a space takes. space_style: Returns the current space style of the toolbar. style: Returns the current toolbar style. GtkToolbar Construtor GtkToolbar (GtkOrientation orientation, GtkToolbarStyle style); Creates a new toolbar instance. Exemplo 45. A detachable toolbar <?php if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); } function toolbarClicked( $objButton, $strType) { echo 'clicked ' . $strType . "\r\n"; } $window = &new GtkWindow(); $window->set_title( 'toolbar test'); $window->set_default_size( 400, 70); $window->connect_object('destroy', array('gtk', 'main_quit')); $vbox = &new GtkVBox(); $systemimage = array( '13 13 5 2', ' c None s None', '. c topShadowColor m white c lightblue', 'X s iconColor1 m black c black', 'o s bottomShadowColor m black c #646464646464', 'O s selectColor m white c red', " ", " . . . ", " . . X X X o o ", " . X X X X X X X o ", " . X X X X X X X o ", " . X X X X O X X X X o ", " . X X X O O O X X X o ", " . X X X X O X X X X o ",

" . X X X X X X X o ", " . X X X X X X X o ", " o o X X X o o ", " o o o ", "" ); $window->realize(); list($pixmap, $mask) = Gdk::pixmap_create_from_xpm_d($window->window, null, $sy stemimage); $pixmapwid = &new GtkPixmap($pixmap, $mask); $toolbar = &new GtkToolbar( GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH); $toolbar->set_button_relief( GTK_RELIEF_NONE); $toolbar->set_space_style( GTK_TOOLBAR_SPACE_LINE); $toolbar->append_item( 'new', 'Creates a new document', "Closes the active docu ment\r\nand creates an empty new one", null, 'toolbarClicked', 'new' ); $toolbar->append_item( 'open', 'Opens an existing document', null, null, 'toolb arClicked', 'open' ); $toolbar->append_space(); $toolbar->append_item( 'save', 'Saves the document', 'Saves the document on the harddisk', $pixmapwid, 'toolbarClicked', 'save' ); $toolbar->append_item( 'saveas', 'Saves the document with another filename', nu ll, null, 'toolbarClicked', 'saveas' ); $handlebox = &new GtkHandleBox(); $handlebox->add( $toolbar); $vbox->pack_start_defaults( $handlebox); $label = &new GtkLabel( 'I should be below the toolbar'); $vbox->pack_start_defaults( $label); $window->add( $vbox); $window->show_all(); gtk::main(); ?> GtkToolbar::add void add(GtkWidget widget); Appends an existing widget to the toolbar. This function overwrites the add() method of GtkContainer in the way that a call to append_widget() is made with NULL as tooltip parameters. GtkToolbar::append_space void append_space(void); Adds a spacer element to the end. Just calls insert_space() with the position parameter set to the number of widgets.

GtkToolbar::prepend_space void prepend_space(void); Adds a spacer element before the first item. Just calls insert_space() with the position parameter set to 0. GtkToolbar::insert_space void insert_space(int position); Inserts a spacer element at the given position to make a visible gap between 2 groups of toolbar items. The minimum value is 0, and the maximum is the number of items which are attached to the toolbar. In the end, insert_space calls insert_item() with the type parameter set to space. GtkToolbar::append_element GtkWidget append_element(GtkToolbarChildType widget_type, GtkWidget widget, string button_text, string tooltip_text, string tooltip_private_text, GtkPixmap icon, string callback, [mixed userparam]); Adds a new toolbar element to the end. Just calls insert_element() with the position parameter set to the number of widgets. GtkToolbar::prepend_element GtkWidget prepend_element(GtkToolbarChildType widget_type, GtkWidget widget, string button_text, string tooltip_text, string tooltip_private_text, GtkPixmap icon, string callback, [mixed userparam]); Adds a new toolbar element before the first item. Just calls insert_element() with the position parameter set to 0. GtkToolbar::insert_element GtkWidget insert_element(GtkToolbarChildType widget_type, GtkWidget widget, string button_text, string tooltip_text, string tooltip_private_text, GtkWidget icon, int position, string callback, [mixed userparam]); Inserts a new toolbar element at the given position. This is the base function for all other insert/append/prepend functions. The widget_type determines which type of widget shall be inserted/created. widget has to be set if widget_type is set to GTK_TOOLBAR_CHILD_WIDGET. All other types require a null as widget because they are created by the function. button_text specifies the text ("label") to be visible on the button,

tooltip_text is the tooltip text which will be visible when the user hovers the button for a specific time. tooltip_private_text is the text being visible using a GtkTipsQuery. See GtkTooltips for more details on this topic. icon is a widget, preferably a GtkPixmap which shall be used as an icon. The icon is used when the GtkToolbarStyle is set to icon or both (only with widgets created by insert_element). You can use every type of widget, but take care that the toolbar button can be identified by it when the style is icon only. If the icon is set to null, the text will still be visible. The position parameter can be in the range from 0 (insert as first element) to the number of widgets (append after the last) being on the toolbar. This can be determined by doing a count( $toolbar->children()), but just an append_element() should be more easy. Last parameter is callback, the function to be called when the widget is clicked. You can pass a number of self-defined extra parameters to the callback function by appending them after the callback parameter. Exemplo 46. Using the insert_element toolbar function list($pixmap, $mask) = Gdk::pixmap_create_from_xpm($window->window, null, 'icon -new.xpm'); $newicon = &new GtkPixmap($pixmap, $mask); $toolbar->insert_element( GTK_TOOLBAR_CHILD_BUTTON, 'New', 'Create a new document', "Closes the current document and\r\ncreates a new, empty one.", $newicon, 0, 'toolbarClicked', 'new' ); GtkToolbar::append_item GtkButton append_item(string button_text, string tooltip_text, string tooltip_private_text, GtkPixmap icon, string callback, [mixed userparam]); Adds a new button to the end. Just calls insert_element() with the position parameter set to the number of widgets and the widget type set to button. GtkToolbar::prepend_item GtkButton prepend_item(string button_text, string tooltip_text, string tooltip_private_text, GtkPixmap icon, string callback, [mixed userparam]);

Adds a widget before the first item. Just calls insert_element() with the position parameter set to 0 and the widget type set to button. GtkToolbar::insert_item GtkButton insert_item(string button_text, string tooltip_text, string tooltip_private_text, GtkPixmap icon, int position, string callback, [mixed userparam]); Inserts a new button at the given position. Just calls insert_element() with the the widget type set to button. GtkToolbar::append_widget void append_widget(GtkWidget widget, string tooltip_text, string tooltip_private_text); Adds a widget to the end. Just calls insert_widget() with the position parameter set to the number of widgets. GtkToolbar::prepend_widget void prepend_widget(GtkWidget widget, string tooltip_text, string tooltip_private_text); Adds a widget before the first item. Just calls insert_widget() with the position parameter set to 0. GtkToolbar::insert_widget void insert_widget(GtkWidget widget, string tooltip_text, string tooltip_private_text, int position); Inserts a widget at the given position. The position minimum value is 0, and the maximum is the number of items on this toolbar. The tooltip_text is the one being visible when the mouse hovers over the element. The tooltip_private_text is for context-sensitive help about this widget. GtkToolbar::set_orientation void set_orientation(GtkOrientation orientation); Sets the toolbar orientation to horizontal or vertical. The "orientation-changed" signal is emitted when this function is called. You can read the current orientation with the orientation property. GtkToolbar::set_style void set_style(GtkToolbarStyle style);

Sets the text/icon style of the toolbar. This setting is applied to all buttons on the toolbar, except for the widgets added via the insert_widget() function. You could write your own method which changes the styles of all the widgets by connecting the toolbar to the "style-changed" signal. Every application should let the user decide if he wants to have icons, text or both displayed in the toolbar. Note that the toolbar can grow quite large if you use text+icons the same time. Pay attention to this when creating your application. The "style-changed" signal is emitted when this function is called. You can read the current style with the style property. GtkToolbar::set_space_size void set_space_size(int space_size); Sets the width (horitontal orientation) or height (vertical orientation) which a spacer takes for display. The width of the line is not affected by this setting. You can read the current space size with the space_size property. GtkToolbar::set_space_style void set_space_style(GtkToolbarSpaceStyle space_style); Sets the style of the spacers: Invisible, with only empty space being displayed for the spacer or line, which draws a thin vertical (horizontal orientation) or horizontal (vertical orientation) in the center of the spacer. You can read the current space style with the space_style property. GtkToolbar::set_tooltips void set_tooltips(int enable); Enables or disables the display of tooltips on all the widgets on the toolbar. GtkToolbar::set_button_relief void set_button_relief(GtkReliefStyle relief); Sets the relief style for buttons on the toolbar. This does not affect widgets added via the insert_widget() , equal if they are buttons or not.

GtkToolbar::get_button_relief GtkReliefStyle get_button_relief(void); Returns the current GtkReliefStyle which can be set with set_button_relief() method. style-changed Emitted when the style has changed. Connect the toolbar with this signal to your own function if you want to implement the style changing for widgets added via the insert_widget() function. Funo Callback void callback(GtkToolbar widget, GtkToolbarStyle style); orientation-changed Emitted when the orientation has changed. Funo Callback void callback(GtkToolbar widget, GtkOrientation orientation); GtkToolbar::orientation Access: Read Only Type: GtkOrientation Returns the orientation (horizontal or vertical) of the toolbar It can be set with set_orientation() . GtkToolbar::space_size Access: Read Only Type: int Returns the width/height which a space takes. It can be set with set_space_size() . GtkToolbar::space_style Access: Read Only Type: GtkToolbarSpaceStyle Returns the current space style of the toolbar (line or invisible). It can be set with set_space_style() . GtkToolbar::style

Access: Read Only Type: GtkToolbarStyle Returns the current toolbar style (icons only, text only, both). It can be set with set_style() . GtkTooltips Adds tooltips to other widgets. Hierarquia do Objeto GtkObject `-- GtkData `-- GtkTooltips Direct subclasses None. Descrio Tooltips are the messages that appear next to a widget when the mouse pointer is held over it for a short amount of time. They are set via the set_tip() method. They are especially helpful for adding more verbose descriptions of things such as buttons in a toolbar. This widget holds tooltips for other widgets. You should only need one Tooltip widget for all widgets you wish to add tips to. Tooltips can only be used on widgets which have their own x window. Other widgets, e.g. GtkLabels can be added to an GtkEventBox to benefit from tooltips. A widget which wants to use a tooltip needs to expose GDK_ENTER_NOTIFY_MASK and GDK_LEAVE_NOTIFY_MASK which can be set via the add_events() function. Most widgets do this automatically, but e.g. a GtkDrawingArea does not. Construtor GtkTooltips (void); -- Creates a new tooltips instance. Mtodos enable() Actives the showing of tooltips. disable()

Disable the showing of tooltips. set_delay() Determines the time after which the tooltips are shown set_tip() Sets the tooltip for a specific widget set_colors() Sets the fore- and background color of the tooltips. Deprecated. force_window() Used internally only. GtkTooltips Construtor GtkTooltips (void); Creates a new tooltips instance. You need only one tooltip widget, as it can hold tooltips for several widgets. Exemplo 47. How to use tooltips <?php if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); } $window = &new GtkWindow(); $window->set_title( 'tooltip window'); $window->set_default_size( 200, 200); $window->connect_object('destroy', array('gtk', 'main_quit')); $vbox = &new GtkVBox(); $btnSparkum = &new GtkButton( 'OEffnen'); $btnNaclus = &new GtkButton( 'Speichern'); $label = &new GtkLabel( 'Normal label'); $labelEvent = &new GtkLabel( 'Label on EventBox'); $eventbox = &new GtkEventBox(); $eventbox->add( $labelEvent); $vbox->pack_start_defaults( $btnSparkum); $vbox->pack_start_defaults( $btnNaclus); $vbox->pack_start_defaults( $label); $vbox->pack_start_defaults( $eventbox); $tooltips = &new GtkTooltips(); $tooltips->set_tip( $btnSparkum, 'OEffnen is german for "Open"', "OEffnen is german for \"Open\"\r\nSee it as a way to extend\r\nyour kn owledge"); $tooltips->set_tip( $btnNaclus, 'Speichern is german for "Save"', "Speichern is german for \"Save\"\r\nSee it as a way to extend\r\nyour knowledge"); $tooltips->set_tip( $label, 'You shouldn\'t see this.', null);

$tooltips->set_tip( $eventbox, 'A tooltip on a label... magic.', "No magic!\r\nYou just need to pack the label\r\non an EventBox."); $window->add( $vbox); $window->show_all(); gtk::main(); ?> GtkTooltips::enable void enable(void); Activates the tooltips so that they are shown after the specified with the set_delay() function if they were disable() d before. GtkTooltips::disable void disable(void); Deactivates the tooltips so that they aren't shown any more. You can re-activate them with enable() . GtkTooltips::set_delay void set_delay(int delay); Determines the time in milliseconds which the user has to wait on the widget until the tooltip is shown. With a delay of 0, the tooltips are shown immediately. GtkTooltips::set_tip void set_tip( GtkWidget widget , string tip_text, string tip_private); Sets the tooltip for a specific widget. The tip_text is will be visible when the user hovers the button for a specific delay. The tip_private should be a longer description of the function the widget has and can be made visible via a GtkTipsQuery object ("What's this" function). GtkTooltips::set_colors void set_colors( GdkColor background , GdkColor foreground ); This method is deprecated. Colors can be set via styles. This method sets the foreground and background colors for the tooltips. On linux this method doesn't work. Use the styles instead.

Exemplo 48. How to set the color of tooltips $style = 'style "tooltips" { bg[NORMAL] = "#ff6060" } widget "gtk-tooltips" sty le "tooltips"'; gtk::rc_parse_string( $style); GtkTooltips::force_window void force_window(void); This function is for internal use only. It forces the creation of the tooltip window if it doesn't exist yet. (Not meaning showing) GtkTree Widget for displaying hierarchical information. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkTree Direct subclasses None. Descrio A GtkTree is a structure for displaying hierchical information. A tree may contain one or more nodes which themselves may contain other trees, thus creating levels or groups of nodes. A tree can be used to display information such as a map of a website or the files and folders of a directory. GtkTree has been deprecated since GTK+ 2.0 and should not be used in newly written code. Construtor GtkTree (void); -- Creates a new GtkTree. Mtodos append() Adds a node to the end of the tree. prepend() Adds a node to the begining of the tree. insert()

Adds a node to the tree in the given position. remove_item() Removes a node from a tree. clear_items() Removes a range of nodes from the tree. select_item() Selects a node of the tree by position. unselect_item() Unselects a node of the tree by position. select_child() Selects a node of a tree by object. unselect_child() Unselects a node of a tree by object. child_position() Returns the position of a node. set_selection_mode() Sets the tree's selection mode. set_view_mode() Sets the tree's view mode. set_view_lines() Sets how lines between nodes and children are to be drawn. GtkTree Construtor GtkTree (void); Creates a new instance of a GtkTree. Because GtkTree extends GtkContainer, it may contain one or more children. These children should be GtkTreeItem widgets. Exemplo 49. Building a tree of a file structure. <?php dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); // Creates a tree representing a directory. function &createTreeFromDirectory($dir) { // Create a new tree $tree =& new GtkTree; // Make sure dir is a directory if (is_dir($dir)) { // Open directory and read in file names

$dir_handle = opendir($dir); while (($file = readdir($dir_handle)) !== false) { // Create a new tree item for each file $treeItem = &new GtkTreeItem($file); $treeItem->show(); // Add the tree item to the tree $tree->append($treeItem); // If the file is a directory and not . or .. call // this function recursively if (is_dir($dir . '/' . $file) && strpos($file, '.') !== 0) { $treeItem->set_subtree(createTreeFromDirectory($dir . '/' . $fi le)); } } // Close the directory closedir($dir_handle); } // Return the tree return $tree; } // The directory to display $directory = '/path/to/some/directory'; // Create a window to display the file structure $window =& new GtkWindow; // Add a frame $frame =& new GtkFrame($directory); $window->add($frame); // Add the tree $tree = createTreeFromDirectory($directory); $frame->add($tree); $window->show_all(); gtk::main(); ?> GtkTree::append void append ( GtkWidget tree_item ); Adds tree_item to the end of the tree. Exemplo 50. Appending nodes to a tree <?php $tree =& new GtkTree; $nodes = array('These nodes', 'were added', 'in this order'); // Add the nodes. When displayed they will be in readable order. foreach ($nodes as $node) { $item =& new GtkTreeItem($node); $tree->append($item); }

?> See also: prepend() , insert() GtkTree::prepend void prepend ( GtkWidget tree_item ); Adds tree_item to the begining of the tree. The first node of the tree is in position zero. See also: append() , insert() GtkTree::insert void insert ( GtkWidget tree_item , int position ); Adds tree_item to the tree at position. The first node of the tree is in position zero. If position is greater than the first empty position, tree_item is put in the first empty position. Exemplo 51. Inserting a tree item <?php dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); // Create a tree $tree =& new GtkTree; // Create a tree item $treeItem =& new GtkTreeItem('A tree item'); // Insert the tree item into the 100th position. $tree->insert($treeItem, 100); // Check the position of the tree item. echo $tree->child_position($treeItem); // Outputs 0 ?> See also: append() , prepend() GtkTree::remove_item void remove_item ( GtkWidget child ); Removes child from the tree. If child is not a node of the tree, a Gtk-CRITICAL warning will be issued. GtkTree::clear_items void clear_items (int start , int end );

Removes nodes from start to end inclusive. If end is greater than the number of nodes, all nodes from start to the end of the tree will be removed. Unlike gtk, nodes that are removed from the tree are not destroyed. See also: remove_item() GtkTree::select_item void select_item (int position ); Highlights the node in position as selected. This will cause the node to emit the "select" signal. Selecting a node which is already selected will unselect that node. Exemplo 52. Selecting a node twice <?php // Call back function to notify when an item is deselected function itemDeselected() { echo 'A tree item was deselected!'; } // Create a tree $tree =& new GtkTree; // Create an item and add it to the tree $treeItem =& new GtkTreeItem('Select me twice'); $tree->append($treeItem); // Select the item twice and see what happens $tree->select_item(0); $tree->select_item(0); // itemDeselected() will be called. ?> Node positions are indexed begining with zero. The fourth node in a tree is in position three. See also: unselect_item() , select_child() , unselect_child() . GtkTree::unselect_item void unselect_item (int position ); Unselects the node in position. Unselecting a node causes the node to emit the "deselect" signal. Unselecting a node that is not selected will select the node. Node positions are indexed begining with zero. The fourth node is in position three.

GtkTree::select_child void select_child ( GtkWidget tree_item ); Selects the node tree_item. Selecting a node causes the "select" signal to be emitted. GtkTree::unselect_child void unselect_child ( GtkWidget tree_item ); Unselects tree_item. Unselecting a node causes the "deselect" signal to be emitted. GtkTree::child_position int child_position ( GtkWidget child ); Returns the position of child. The first node of a tree is in position zero. If child is not a node of the tree, -1 is returned. GtkTree::set_selection_mode void set_selection_mode ( GtkSelectionMode mode ); Sets the selection mode to mode. GTK_SELECTION_SINGLE is the default. The selection mode determines how many nodes may/must be selected at one time. See also: GtkSelectionMode GtkTree::set_view_mode void set_view_mode ( GtkTreeViewMode mode ); Sets the tree's view mode to mode. The view mode defines how the tree looks when items are selected. The default mode is GTK_TREE_VIEW_ITEM. See also: GtkTreeViewMode GtkTree::set_view_lines void set_view_lines (int flag ); Sets whether or not lines between nodes and children should be drawn. If flag evaluates to true (flag > 0) connecting lines between nodes and children will be drawn. If flag evaluates to false (flag <= 0) connecting lines between nodes and children will not be drawn. By default tree's begin with view lines set to one. GtkTreeItem

One node of a GtkTree widget. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkItem `-- GtkTreeItem Direct subclasses None. Descrio A GtkTreeItem is one node of a GtkTree. Because GtkTreeItem extends GtkItem, it may contain one child. That child should be a GtkTree. See also: GtkTree GtkTreeItem has been deprecated since GTK+ 2.0 and should not be used in newly written code. Construtor GtkTreeItem (string node_text ); -- Creates a new GtkTreeItem with the given text. Mtodos set_subtree() Adds a tree of children nodes. remove_subtree() Removes a node's subtree. select() Selects the node. deselect() Deselects the node. expand() Shows the node's subtree. collapse() Hides the node's subtree. Sinais

"expand" Emitted when expand() is called. "collapse" Emitted when collapse() is called. "select" Emitted when the tree item is selected. "deselect" Emitted when the tree item is deselected. GtkTreeItem Construtor GtkTreeItem (string node_text ); Creates a new instance of GtkTreeItem with node_text as the node label. The new item should be added to a GtkTree using append() , prepend() , or insert() . Strictly speaking node_text is optional. That is, you will not get a run time error if you do not supply the text, but if no text is given the node will not display. GtkTreeItem::set_subtree void set_subtree ( GtkTree subtree ); Sets a GtkTree as the subtree (or tree of children) for a node. A GtkTreeItem may only have one subtree. Attempting to set a second tree will generate a Gtk-Warning. The orginal subtree will not be overwritten or removed. A node that has a subtree will be shown with a box to the left containing either a plus for a collapsed tree or a minus for an expanded tree. Exemplo 53. Adding a subtree <?php // Create the top level tree item. $tree =& new GtkTree(); $treeItem =& new GtkTreeItem('Top Level Item'); $tree->append( $treeItem); // Create the sub tree with one sub tree item. $subTree =& new GtkTree; $subTreeItem =& new GtkTreeItem('Sub Level Item'); $subTree->append($subTreeItem); // Add the sub tree to the top level item. $treeItem->set_subtree($subTree); ?>

Controlling whether or not the subtree is visible is done using expand() and collapse() functions. GtkTreeItem::remove_subtree void remove_subtree (void); Removes the subtree set using set_subtree() . If no subtree has been set a Gtk-CRITICAL message will be issued. GtkTreeItem::select void select (void); Selects the node and emits the select signal. Exemplo 54. Selecting a node <?php function treeItemSelected() { echo "A tree item was selected.\n"; } // Create a new button. $button =& new GtkButton('Press Me'); // Create a new tree item $treeItem =& new GtkTreeItem('I\'ll get selected.'); // Have the treeItemSelected function called when // the tree item is selected. $treeItem->connect('select', 'treeItemSelected'); // When the button is clicked the treeItemSelected // function will be called and a message will be // printed to the terminal. $button->connect('clicked', array(&$treeItem, 'select')); ?> This method is connected to the "clicked" signal on construction. See also: deselect() GtkTreeItem::deselect void deselect (void); Deselects the node and emits the deselect signal. This method is called implicitly when another node in either the parent or child trees is selected. See also: select() GtkTreeItem::expand void expand (void);

Shows the node's subtree and emits the "expand" signal. When expanded, the icon to the left of the node changes from a + (plus) to a (minus). Show must also be called on each subtree item before it will be visible. GtkTreeItem::collapse void collapse(void); Hides the node's subtree and emits the "collapse" signal. When collapsed the icon to the left of the node changes from a - (minus) to a + (plus). expand The "expand" signal is emitted when the expand() method is called. This normally occurs when the user clicks on the label of a collapsed node. Funo Callback void callback(GtkTreeItem tree_item); collapse The "collapse" signal is emitted when the collapse() method is called. This normally occurs when the user clicks on the label of an expanded node. Funo Callback void callback(GtkTreeItem tree_item); select The "select" signal is emitted when a tree item is about to be selected. This occurs when the user clicks on an unseleted item or the item is selected by its parent tree using the select_item() method. Funo Callback void callback(GtkTreeItem tree_item); deselect The "deselect" signal is emitted when a tree item is about to be deselected. This occurs when the user clicks on a selected item or the item is unselected by its parent tree using the unselect_item() method. Funo Callback void callback(GtkTreeItem tree_item);

GtkVBox Vertical box container. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBox `-- GtkVBox Direct subclasses GtkColorSelection, GtkGammaCurve Descrio GtkVBox is a box container that packs child widgets in a single column, using the packing methods inherited from GtkBox, such as pack_start() , as well as the less flexible add() method available to most container widgets. Note that all children in a GtkVBox are allocated the same width, regardless of settings and child requisition size. Widgets taking up less than the allocated width are by default centered within the available area in that dimension. See also: GtkContainer, GtkBox, GtkHBox, GtkButtonBox, GtkTable. Construtor GtkVBox ([bool homogeneous = false , [int spacing = 0 ]]); -- Creates a container for a single column of child widgets. GtkVBox Construtor GtkVBox ([bool homogeneous = false , [int spacing = 0 ]]); Creates a new vertical box container designed for packing a single column of child widgets. The first parameter, homogeneous, is a boolean value which, if set to true, will set each child widget in the GtkVBox to the same height as that of the largest child widget. The second parameter, spacing, sets the minimum spacing between the child widgets, in pixels. Leaving both parameters empty, e.g. $vbox = &new GtkVBox(); will set the default behaviour of individual sizing and zero spacing. Exemplo 55. Packing child widgets using GtkVBox and GtkHBox <?php

$window = &new GtkWindow(); $window->set_title("GtkHBox and GtkVBox packing demonstration"); $window->set_position(GTK_WIN_POS_CENTER); $window->connect_object("destroy", array("gtk", "main_quit")); $window->show(); $vbox = &new GtkVBox(false, 5); $window->add($vbox); $label = &new GtkLabel(); $label->set_text("This GtkLabel is packed at the start of a GtkVBox. The GtkCalendar below is\npacked at the start of a GtkHBox, which is in turn packed at the end of the\nGtkVBox. The empty GtkText widget is packed at the end of the GtkHBox."); $label->set_justify(GTK_JUSTIFY_LEFT); $vbox->pack_start($label, true, true, 5); $label->show(); $hbox = &new GtkHBox(true, 0); $vbox->pack_end($hbox); $calendar = &new GtkCalendar(); $hbox->pack_start($calendar, true, true, 2); $calendar->show(); $text = &new GtkText(); $text->set_editable(true); $hbox->pack_end($text, true, true, 2); $text->show(); $window->show_all(); gtk::main(); ?> GtkVButtonBox Container for arranging a group of buttons vertically. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBox `-- GtkButtonBox `-- GtkVButtonBox Direct subclasses None.

Descrio GtkVButtonBox is a container widget designed for arranging a column of buttons in accordance with a specified GtkButtonBoxStyle setting. See also: GtkButtonBox, GtkHButtonBox. Construtor GtkVButtonBox (void); -- Creates the basis for a vertical button container. GtkVButtonBox Construtor GtkVButtonBox (void); The syntax for creating a vertical buttonbox is: $vbuttonbox = &new GtkVButtonBox(); There are no parameters. As with all container widgets, no physical space is taken by a GtkVButtonBox until its child widgets are in place. GtkViewport Provides scrolling capability for non-scrolling aware widgets. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkViewport Direct subclasses None. Descrio The GtkViewport object is only used alongside a GtkScrolledWindow, and provides scrolling capability where the child widget being added to a scrolled window is not otherwise scrollable. It is not possible in most cases to use it outside this context, as its adjustment values are set internally by the child's sizing policies and can neither be overridden manually nor used directly. Note that directional keybindings in a non-scrolling aware widget are not usually bound to any adjustment value by default; the

GtkViewport simply allows the use of scrollbars with such a widget. The exception that proves this rule is GtkList, which is set up so that it can be made to be scrollable via the keyboard if it is added to a GtkViewport. In most circumstances, it is easier to construct the viewport object by using the convenience method add_with_viewport() rather than by using its own constructor. Construtor GtkViewport ([ GtkAdjustment hadjustment = NULL , [ GtkAdjustment vadjustment = NULL ]]); -- Creates a scrollable container. Mtodos get_hadjustment() Returns the horizontal adjustment object. get_vadjustment() Returns the vertical adjustment object. set_shadow_type() Sets the shadow style on the viewport's border. GtkViewport Construtor GtkViewport ([ GtkAdjustment hadjustment = NULL , [ GtkAdjustment vadjustment = NULL ]]); You should rarely need to construct a GtkViewport directly, as its main use is where a GtkScrolledWindow needs a scrollable widget as its child - which situation is catered for with the method add_with_viewport() , saving three or four coding lines. Exemplo 56. Creating a GtkViewport the hard way <?php dl('php_gtk.'.(strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); /* set up a window */ $window = &new GtkWindow(); $window->set_position(GTK_WIN_POS_CENTER); $window->connect_object('destroy', array('gtk', 'main_quit')); /* set up the scrolled window and add it to the main window, sizing it if necessary. */ $scrolledwindow = &new GtkScrolledWindow(); $scrolledwindow->set_usize(150, 150); $window->add($scrolledwindow); /* create the viewport */

$viewport = &new GtkViewport(); $viewport->set_shadow_type(GTK_SHADOW_ETCHED_OUT); /* create a box container and add child widget or widgets to it - because as with most widgets, a GtkCalendar has no adjustment-friendly focus internals, whereas a box container does */ $box = &new GtkVBox(); $calendar = &new GtkCalendar(); $box->pack_start($calendar, false); /* add the box to the viewport, and the viewport to the scrolled window */ $viewport->add($box); $scrolledwindow->add($viewport); $box->show_all(); $window->show_all(); gtk::main(); ?> GtkViewport::get_hadjustment GtkAdjustment get_hadjustment (void); get_hadjustment() returns the GtkAdjustment object that is used in horizontal scrolling. GtkViewport::get_vadjustment GtkAdjustment get_vadjustment (void); get_vadjustment() returns the GtkAdjustment object that is used in vertical scrolling. GtkViewport::set_shadow_type void set_shadow_type( GtkShadowType type ); Sets the shadow style of the border area around a GtkViewport to one of five possible GtkShadowType values. The default setting is GTK_SHADOW_IN. GtkVPaned Container with two panes arranged vertically. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkPaned

`-- GtkVPaned Direct subclasses None. Descrio GtkVPaned is a widget derived from GtkPaned, consisting of two panes arranged vertically and separated by a dividing handle. The handle can be adjusted by the end user to alter the relative sizes of the panes. See also: GtkPaned, GtkHPaned. Construtor GtkVPaned (void); -- Creates the basis for a vertical dual-paned container. GtkVPaned Construtor GtkVPaned (void); The GtkVPaned widget should be thought of in terms of an arrangement of two child widgets, rather than as an object in its own right. The construct $vbox = &new GtkVBox(); needs to be within a containing GtkWindow and to contain two child widgets of its own in order to work. There is a code sample demonstrating the construction of a paned widget under the entry for the GtkHPaned constructor. GtkVRuler Vertical ruler. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkRuler `-- GtkVRuler Direct subclasses None. Descrio Construtor

GtkVRuler (void); -GtkVRuler Construtor GtkVRuler (void); GtkVScale Vertical slider widget for selecting a value from a range. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkRange `-- GtkScale `-- GtkVScale Direct subclasses None. Descrio A GtkVScale is a vertical scrollbar-like widget that is able to display its adjustment value as text. There are some configuration issues with this widget when it is used in such a way; please refer to GtkScale for further information. Construtor GtkVScale ([ GtkAdjustment adjustment = NULL ]); -- Creates a vertical slider. GtkVScale Construtor GtkVScale ([ GtkAdjustment adjustment = NULL ]); A GtkVScale that can be given its own GtkAdjustment settings has no configuration issues whatever. Reasonable settings on an adjustment object for a GtkVScale on a single full page might look something like this: <?php $adjustment = &new GtkAdjustment(0, 0, 100, 1, 25, 0); $vscale = &new GtkVScale($adjustment);

?> This would give a scale of 0 to 100 along the height of the page, and no overlap. GtkVScrollbar Vertical scrollbar. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkRange `-- GtkScrollbar `-- GtkVScrollbar Direct subclasses None. Descrio A GtkVScrollbar is a vertical scrollbar. Tabela 8. Key bindings for GtkVScrollbar Key combination Scroll function Up arrow Move up one step increment Down arrow Move down one step increment Page Up Move up one page increment Page Down Move down one page increment Control + Page Up Move to top of scroll Control + Page Down Move to bottom of scroll Construtor GtkVScrollbar ([ GtkAdjustment adjustment = NULL ]); -- Creates a vertical scrollbar. GtkVScrollbar Construtor GtkVScrollbar ([ GtkAdjustment adjustment = NULL ]); A scrollbar needs a GtkAdjustment in order to operate. The values that you give to the adjustment object will depend on the situation where the scrollbar is intended to be used. All scrollable widgets have their own adjustment object(s), and in all instances where you are most likely to need a vertical scrollbar it is possible to create a handle for the widget's vertical GtkAdjustment and assign that as the new scrollbar's adjustment object. For example:

<?php $text = &new GtkText(); $adjustment = $text->vadj; $scrollbar = &new GtkVScrollbar($adjustment); ?> GtkVSeparator Vertical separator. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkSeparator `-- GtkVSeparator Direct subclasses None. Descrio A GtkVSeparator is a widget that consists of a vertical line. It is used to separate widgets that are laid out horizontally. Separators cannot be used in menu widgets, and there is currently no way to put a vertical separator into a GtkMenuBar. See also: GtkHSeparator, gtk::paint_vline() . Construtor GtkVSeparator (void); -- Draws a vertical line. GtkVSeparator Construtor GtkVSeparator (void); Constructing a GtkVSeparator and adding it to a widget amounts to the same thing as drawing a vertical line across that widget. Use the container's packing methods to determine the spacing around the separator. GtkWidget Base class for user interface elements. Hierarquia do Objeto

GtkObject `-- GtkWidget Direct subclasses GtkCalendar, GtkContainer, GtkDrawingArea, GtkEditable, GtkMisc, GtkPreview, GtkProgress, GtkRange, GtkRuler, GtkSeparator Descrio GtkWidget is an abstract base class providing its descendants with properties, methods and signals pertinent to displayable user interface elements. The only objects that do not inherit GtkWidget characteristics are GtkTooltips, GtkAdjustment and GtkItemFactory all of which are relatively abstract concepts. Everything else that is a member of the object hierarchy is a descendant of the GtkWidget class, takes up screen space, and may be referred to as a widget. Note that GtkWidget cannot be constructed directly. Mtodos drag_highlight() Highlight the widget. drag_unhighlight() Unhighlight the widget. drag_dest_set() Set a widget as a drag-and-drop destination. drag_dest_unset() Unregister a widget as a drag-and-drop destination. drag_source_set() Allows to drag data from the widget. drag_source_unset() Undo the effects of drag_source_set(). drag_source_set_icon() selection_owner_set() selection_add_target() selection_convert() selection_remove_all()

unparent() Dissociates widget from current parent. show() Displays the calling widget. show_now() Shows a widget and enters the main loop. hide() Hides the calling widget. show_all() Displays calling widget and its children. hide_all() Hides calling widget and its children. map() Maps calling widget to the screen. unmap() Unmaps calling widget from the screen. realize() Instantiates calling widget's GdkWindow. unrealize() Removes calling widget's GdkWindow. queue_draw() Queues widget's redraw requests, for the whole widget. queue_draw_area() Queues widget's redraw requests, for any area within the widget. queue_clear() queue_clear_area() queue_resize() Queues widget's resize requests. draw() draw_focus() draw_default()

add_accelerator() Adds accelerator key to a widget. remove_accelerator() Removes a single accelerator. remove_accelerators() Removes all accelerators meeting certain criteria. lock_accelerators() Locks accelerator key definitions. unlock_accelerators() Unlocks accelerators to allow alterations. accelerators_locked() Tests accelerator lock status. event() Triggers an event. activate() reparent() Moves a widget to a new container. popup() intersect() Checks for an intersection with a given area. grab_focus() Gives grab and focus to the calling widget. grab_default() Gives grab and default to the calling widget. set_name() Sets widget name. get_name() Returns name of widget. set_state() Sets widget's state. set_sensitive() Toggles sensitivity. set_app_paintable()

set_parent() Sets the parent of the widget. set_parent_window() get_parent_window() set_uposition() Sets widget's position relative to its container. set_usize() Sets widget's size in pixels. set_events() Extends capturable events prior to realization. add_events() Extends capturable events after realization. get_toplevel() get_ancestor() get_colormap() Returns the GdkColormap object used by the widget. get_visual() Returns the GdkVisual object used by the widget. set_colormap() Sets the widget's colormap. set_visual() get_events() is_ancestor() Tests relationship with other widgets. hide_on_delete() set_style() Sets a widget's style property. set_rc_style()

ensure_style() get_style() Returns the GtkStyle object used by the widget. restore_default_style() set_composite_name() get_composite_name() reset_rc_styles() shape_combine_mask() Give the widget an unusual shape. Sinais "show" "hide" "map" "unmap" "realize" "unrealize" "draw" "draw-focus" "draw-default" "size-request"

"size-allocate" "state-changed" "parent-set" "style-set" "add-accelerator" "remove-accelerator" "grab-focus" "event" Emitted when any event is captured. "button-press-event" Emitted when a GDK_BUTTON_PRESS event is captured. "button-release-event" Emitted when a GDK_BUTTON_RELEASE event is captured. "motion-notify-event" Emitted when a GDK_MOTION_NOTIFY event is captured. "delete-event" Emitted when a GDK_DELETE event is captured. "destroy-event" Emitted when a GDK_DESTROY event is captured. "expose-event" Emitted when a GDK_EXPOSE event is captured. "key-press-event" Emitted when a GDK_KEY_PRESS event is captured. "key-release-event" Emitted when a GDK_KEY_RELEASE event is captured. "enter-notify-event" Emitted when a GDK_ENTER_NOTIFY event is captured. "leave-notify-event" Emitted when a GDK_LEAVE_NOTIFY event is captured.

"configure-event" Emitted when a GDK_CONFIGURE event is captured. "focus-in-event" Emitted when a GDK_FOCUS_CHANGE event is captured. "focus-out-event" Emitted when a GDK_FOCUS_CHANGE event is captured. "map-event" Emitted when a GDK_MAP event is captured. "unmap-event" Emitted when a GDK_UNMAP event is captured. "property-notify-event" Emitted when a GDK_PROPERTY_NOTIFY event is captured. "selection-clear-event" Emitted when a GDK_SELECTION_CLEAR event is captured. "selection-request-event" Emitted when a GDK_SELECTION_REQUEST event is captured. "selection-notify-event" Emitted when a GDK_SELECTION_NOTIFY event is captured. "selection-received" "selection-get" "proximity-in-event" Emitted when a GDK_PROXIMITY_IN event is captured. "proximity-out-event" Emitted when a GDK_PROXIMITY_OUT event is captured. "drag-begin" "drag-end" "drag-data-delete" "drag-motion" The mouse cursor is moved over the drop target "drag-leave" The mouse leaves the drop target

"drag-drop" "drag-data-get" Requests drag'n'drop data. "drag-data-received" Receives data dropped over the widget. "visibility-notify-event" Emitted when a GDK_VISIBILITY_NOTIFY event is captured. "client-event" Emitted when a GDK_CLIENT_EVENT event is captured. "no-expose-event" "debug-msg" Propriedades style: Style associated with a widget. window: Underlying GdkWindow that captures events on a widget. allocation: Size and position allocated to a widget. state: Degree of response to events. parent: A widget's parent. GtkWidget::drag_highlight void drag_highlight(void); Highlights the calling widget. This method is usually called internally when a widget is selected. When called, drag_hihglight attaches handlers to "expose-event" and "draw" so that the widget will remain highlighed until it is unhighlighted using drag_unhighlight() . See also: drag_unhighlight() GtkWidget::drag_unhighlight void drag_unhighlight(void);

Unhighlights the calling widget. This method is usually used internally when another widget is selected. See also: drag_highlight() GtkWidget::drag_dest_set void drag_dest_set( GtkDestDefaults flags , array targets , GdkDragAction actions ); Sets the calling widget as a drag-and-drop destination. flags is one of four GtkDestDefaults values which define how the widget reacts when the drag is over the widget. The targets parameter defines a list with all data types which can be dropped over the widget. The parameter is an array of arrays of size three: $targets = array( //array( target, flags, info), array( 'text/plain', GTK_TARGET_SAME_APP, 0), array( 'text/uri-list', 0, 1) ); In our example, the widget would accept textual data and files. The files could be dragged from everywhere (flag parameter 0), but the textual data are only accepted if they come from within our application. It is not possible to use a "*" mime type in the target. The flags of the targets determine from which widget the drag has to come from: Tabela 9. Values for flags 0 Accept drags from everywhere. GTK_TARGET_SAME_APP Accept drags only from widgets of the same application only. GTK_TARGET_SAME_WIDGET Accept drags only from the same widget. This is useful for e.g. moving items up/down in a list by dragging them. info allows you to pass a number to the function connected to the "drag-data-received" signal. This is useful when e.g. allowing multiple image types to be dropped, as well as some other non-image types: All image types could be assigned "1" as info parameter, all other types "2" or so. In the drag received function could pass the necessary data to a image open function by checking if the info parameter is "1", without having to compare the mime type. Exemplo 57. Using the info parameter define('TYPE_IMAGE', 1); define('TYPE_PDF' , 2); define('TYPE_OTHER', 3); $targets = array( array( 'image/jpg' , 0, TYPE_IMAGE),

array( 'image/jpeg', 0, TYPE_IMAGE), array( 'image/gif' , 0, TYPE_IMAGE), array( 'image/png' , 0, TYPE_IMAGE), array( 'application/pdf', 0, TYPE_PDF), array( 'text/plain' , 0, TYPE_OTHER) ); $list->drag_dest_set(GTK_DEST_DEFAULT_ALL, $targets, GDK_ACTION_COPY | GDK_ACTI ON_MOVE); $list->connect('drag-data-received', 'dnd_drag_data_received'); function dnd_drag_data_received( $widget, $context, $x, $y, $data, $info, $time ) { if( $info == TYPE_IMAGE) { handle_image( $data); return; } //do different things with pdf and other type here } See also: drag_dest_unset() GtkWidget::drag_dest_unset void drag_dest_unset(void); Unregisters the calling widget as a drag-and-drop destination. After calling this method, no special action will take place when the drag is over the widget. This method has no effect if the widget was not registered as a drag-and-drop destination using drag_dest_set() . See also: drag_dest_set() GtkWidget::drag_source_set void drag_source_set( GdkModifierType start_button_mask , array targets , GdkDragAction actions ); Sets the calling widgets as a drag-and-drop source, so that data can be dragged from the widget to a drop target. Exemplo 58. Using drag_source_set() $targets = array( array( 'text/uri-list', 0, 0)); $list->drag_source_set(GDK_BUTTON1_MASK|GDK_BUTTON3_MASK, $targets, GDK_ACTION_ COPY); The first parameter, start_button_mask, is a bitmask with all mouse buttons allowed to start the drag. The targets is an array of data types provided as drag/drop data. See drag_dest_set() for a detailed explanation of this topic. actions determine which actions will take place if the drop event occurs; a copy/move/delete. See GdkDragAction for all possible options.

GtkWidget::drag_source_unset void drag_source_unset(void); Unregisters the settings which have been done with drag_source_set() . After calling this function, the widget won't act as a drag source any more. GtkWidget::drag_source_set_icon void drag_source_set_icon( GdkColormap colormap , GdkPixmap pixmap , GdkBitmap mask ); GtkWidget::selection_owner_set int selection_owner_set(GdkAtom selection, int time); GtkWidget::selection_add_target void selection_add_target(GdkAtom selection, GdkAtom target, int info); GtkWidget::selection_convert int selection_convert(GdkAtom selection, GdkAtom target, int time); GtkWidget::selection_remove_all void selection_remove_all(void); GtkWidget::unparent void unparent(void); This method takes away the association between the calling widget and its current GdkWindow parent, allowing a new parent to be set for the widget. GtkWidget::show void show(void); show() is a commonly-used method that combines a series of other methods in order to display a widget on the screen. A widget cannot be shown until its containing parent is shown. If show() is called on a widget whose parent has not been shown, that widget will not be realized or mapped until the show is called by the parent widget. See also: map() , realize() , hide. GtkWidget::show_now

void show_now (void); Shows a widget. If the widget is an unmapped toplevel widget (i.e. a GtkWindow that has not yet been shown), enter the main loop and wait for the window to actually be mapped. This is equivilent to calling show immediately followed by gtk::main() . Note: Once the main loop has begun your application will be able to recveive user events. Make sure that show_now() is the method you want to call before using it. See also: show() . GtkWidget::hide void hide(void); hide() is the corollary to the show() method. It combines other methods in order to hide the calling widget from display. See also: show() . GtkWidget::show_all void show_all(void); This method is used to display the calling widget and its children. The extent to which it 'sees' children is system-dependant; some systems will not display children belonging to a child widget when show_all() is called from a top-level container. You may find that you still need to show() the children individually in order to display them, and it is good practice to do so consistently. GtkWidget::hide_all void hide_all(void); hide_all() is the corollary to show_all() , and the same reservations regards the levels of children that will respond to this call, apply. If in doubt, hide() the child widgets individually. See also: hide() GtkWidget::map void map(void); This method maps a widget to the screen area it will take. It is mostly used internally, being one of the methods that is called as part of the show() routine. It causes the "map" signal to be emitted by the widget, which in turn switches a flag causing the widget to be mapped.

At the point of a widget's becoming mapped, the GdkEvent GDK_MAP is triggered, causing the "map-event" signal to also be emitted by that widget. Use this signal to trigger functions that rely on the map event having occurred. See also: show() , realize() . GtkWidget::unmap void unmap(void); This method destroys information regards the dimensions of the screen area where the widget is displayed . It is mostly used internally, being one of the methods that is called as part of the hide() routine. It causes the "unmap" signal to be emitted by the widget, which in turn switches a flag causing the widget to be unmapped. At the point of a widget's becoming unmapped, the GdkEvent GDK_UNMAP is triggered, causing the "unmap-event" signal to also be emitted by that widget. Use this signal to trigger functions that rely on the unmap event having occurred. See also: map() GtkWidget::realize void realize (void); realize() allocates the GDK resources associated with the calling widget. A widget must be realized before it can be mapped to the screen. This means that when show() is called, the widget is first realized and then mapped to the screen. Before a widget can be realized, its parent and all of its ancestors must be realized. If an ancestor of a widget has not been realized at the time realize() is called, it will be implicitly realized before the calling widget is realized. If you want a widget to be displayed on the screen do not use realize() . Instead use show() . See the pixmap tutorial for an example of when it is appropriate to use realize() . See also: map() unrealize() . GtkWidget::unrealize void unrealize (void); unrealize() is the corollary to realize() . When a widget is unrealized, all of its GDK resources ($widget->window) are released. See also: realize() GtkWidget::queue_draw

void queue_draw(void); This method is the one to use if you need to force a widget to redraw itself. Put it into a callback function and determine an appropriate signal to trigger the redraws. queue_draw() creates an expose event, in most situations. In the event that this method does not have the desired effect, try calling queue_resize() instead. If that also fails, you will need to resort to calling hide() followed immediately by show() in the callback. GtkWidget::queue_draw_area void queue_draw_area (int x , int y , int width , int height ); This has exactly the same functionality as queue_draw() , with the exception that the area to be redrawn can be defined in the parameters. The upper left corner of the rectangle to be redrawn is given by x and y. width is the width of the rectangle to be redrawn and height is the height of the rectangle to be redrawn. See also: queue_draw() GtkWidget::queue_clear void queue_clear(void); GtkWidget::queue_clear_area void queue_clear_area(int x, int y, int width, int height); GtkWidget::queue_resize void queue_resize(void); Use this method to force a widget to resize. See GtkScale for a working example. queue_resize() is useful in conjunction with a GtkDrawingArea, where the widget creates synthetic configure events in response to the resizing. It can also trigger expose events in some situations where the queue_draw() has proved ineffective in doing same. This method is used extensively within GTK+ internals. GtkWidget::draw void draw(GdkRectangle area); GtkWidget::draw_focus void draw_focus(void);

GtkWidget::draw_default void draw_default(void); GtkWidget::add_accelerator void add_accelerator(string accel_signal, GtkAccelGroup accel_group , int accel_key, GdkModifierType accel_mods, GtkAccelFlags accel_flags ); add_accelerator() defines and adds a keyboard accelerator to the calling widget, usually a GtkMenuItem. The first parameter is the name of the signal that you want the widget to emit when the key is pressed. Generally this will probably be "activate". The second parameter is the GtkAccelGroup that this GtkAccelEntry will belong to when it has been created. This will generally be an accelerator group that has been newly created and added to the toplevel window. Thirdly there is the accel_key parameter. This can be pulled from the GtkAccelLabel using the parse_uline() method if you have an underscore under the appropriate letter, or alternatively you could use the key symbols which have been hard-coded into PHP-GTK. Usually these would be in the format GDK_KEY__a - always in lower case, because the accelerator functions return lower case key values. The full list of PHP-GTK key symbol hard codings is available in the source code in the file ext/gtk+/php_gdk.c. The fourth and fifth parameters are GdkModifierType and GtkAccelFlags respectively. In both cases, passing 0 is accepted as a null field. There is no limit on the number of accelerator keys that can be associated with a widget. GtkWidget::remove_accelerator void remove_accelerator( GtkAccelGroup accel_group , int accel_key, GdkModifierType accel_mods); remove_accelerator() is a way to remove a single accelerator, defined by its key value and GtkModifierType. Note that the accelerator needs to be unlocked before this method will work. GtkWidget::remove_accelerators void remove_accelerators(string accel_signal, bool visible_only);

remove_accelerators() is a way to remove any number of accelerators belonging to the calling widget and causing the given signal to be fired. The second parameter toggles whether this should include all such accelerators, or only those displayed on the GtkAccelLabel. Note that the accelerators on the widget need to be unlocked before this method will work. GtkWidget::lock_accelerators void lock_accelerators(void); lock_accelerators() locks any accelerators defined on the calling widget - usually a GtkMenuItem - so that no further keys can be entered or existing keys removed or altered. Note that if you do not lock your accelerators the end user will be able to define their own, whether any exist on that widget or not. See also: unlock_accelerators() , accelerators_locked() GtkWidget::unlock_accelerators void unlock_accelerators(void); unlock_accelerators() unlocks the accelerator entries defined in the calling widget, allowing changes or additions to be made to them. See also: lock_accelerators() , accelerators_locked() GtkWidget::accelerators_locked bool accelerators_locked(void); accelerators_locked() returns true if the accelerators on the calling widget are locked, and false if they are not. See also: lock_accelerators() , unlock_accelerators() GtkWidget::event int event( GdkEvent event ); This method causes event to be triggered. This in turn causes the widget to emit an appropriate signal. Note: This is not the recommended method for triggering events. It is better to use main_do_event() because this ensures that the event is entered into the events queue. GtkWidget::activate bool activate(void);

GtkWidget::reparent void reparent ( GtkWidget new_parent ); reparent() moves the calling widget from its current GtkContainer to the new GtkContainer new_parent. When called, reparent() will cause the "parent-set" signal to be emitted. See also: reparent() GtkWidget::popup void popup(int x, int y); GtkWidget::intersect GdkRectangle intersect ( GdkRectangle area ); intersect() returns the rectangle consisting of the overlap of the area taken up by the calling widget and area. This method could be useful to determine if a use is trying to drag and drop a widget some where that they shouldn't. If the two areas do not intersect false is return. GtkWidget::grab_focus void grab_focus(void); This method sets the initial grab and focus on the calling widget so that, for example, if a GtkText were to call it, any keyboard events would be picked up immediately by the text widget. grab_focus() can only be called when the widget in question has the GTK_CAN_FOCUS flag set. Some will have this set at source, others will not, and will generate an error message to that effect when the method is called. Use set_flags() to override the source settings. GtkWidget::grab_default void grab_default(void); This method sets the keyboard grab and default status on the calling widget. The single most likely scenario where you might use this would be to set up a GtkButton so that the user could activate it by immediately pressing the return key. In order to make this possible, you will need to set the GTK_CAN_DEFAULT widget flag on the button. See also: set_flags() .

GtkWidget::set_name void set_name(string name); You may give a widget a unique name. This is mainly intended for use when creating a derived object, but it can also be useful for identifying individual widgets, for example, when an array of buttons is going to be queried at a later point in the script. See also: get_name() . GtkWidget::get_name string get_name(void); This method returns the name of the calling widget. If no name has been set for the widget, this will be in the format GtkWidget. get_name() is very useful where the widget could be one of many, e.g. in a callback that is used by several different widgets. See also: get_type, set_name() . GtkWidget::set_state void set_state( GtkStateType state ); Sets the initial GtkStateType for the calling widget. Note that this will be overridden when the user interacts with the widget, and is primarily useful for offering visual cues. A widget's current state can be queried using the state property. See also: GtkStyle. GtkWidget::set_sensitive void set_sensitive(bool sensitive); Use this function to toggle whether or not the user can interact with a widget. Setting it to false sets the widget's state to GTK_STATE_INSENSITIVE, which 'greys out' the widget. You might use this if, for instance, you wanted to prevent a button from being pressed in certain situations. Setting a container as 'insensitive' will make all that container's children insensitive too. GtkWidget::set_app_paintable void set_app_paintable(bool app_paintable); GtkWidget::set_parent

void set_parent( GtkWidget container ); set_parent() sets container as the parent of the calling widget. container should be a subclass of GtkContainer. When called, set_parent() will cause the "parent-set" signal to be emitted. See also: reparent() GtkWidget::set_parent_window void set_parent_window( GdkWindow parent_window ); GtkWidget::get_parent_window GdkWindow get_parent_window (void); GtkWidget::set_uposition void set_uposition(int x, int y); set_uposition() sets the position of a child widget in pixels relative to the top left corner of its container or, if the widget is a toplevel window, relative to the top left corner of the screen. GtkWidget::set_usize void set_usize(int width, int height); set_usize() sets a widget's size in pixels. Sizing methods should only be called at one level of the packing hierarchy; you may need to size either the container or its children, but doing both will create conflicts in the size requests made by child widgets internally, which in turn can lead to unexpected results. If you need either parameter to be ignored, use -1. See also: GtkAlignment, and the packing methods supplied by GtkBox and GtkTable. GtkWidget::set_events void set_events( GdkEventMask events ); This method is used to set the GdkEventMask flags on a widget, extending the type of event that the widget can capture from its default capabilities. You may need to do this, for instance, to capture a key press event on a widget that does not normally capture such events. set_events() can be used at any point in the widget's life-cycle.

Staying with the key-press example, the syntax would be: $widget->set_events(GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK); This would enable a previously keyboard-insensitive widget to emit "key-press-event" and "key-release-event" signals. GtkWidget::add_events void add_events( GdkEventMask events ); This method is used to set the GdkEventMask flags on a widget, extending the type of event that the widget can capture from its default capabilities. You may need to do this, for instance, to capture a button press event on a widget that does not normally capture such events. add_events() can only be used after a widget has had realize() called on it. Note that realization is a part of the show() routine as well as being a method/signal pair in its own right. Staying with the button-press example, the syntax would be: $widget->add_events(GDK_BUTTON_PRESS_MASK|GDK_BUTTON_RELEASE_MASK); This would enable a previously mouse-insensitive widget to emit "button-press-event" and "button-release-event" signals. GtkWidget::get_toplevel GtkWidget get_toplevel (void); GtkWidget::get_ancestor GtkWidget get_ancestor (int widget_type); GtkWidget::get_colormap GdkColormap get_colormap (void); GtkWidget::get_visual GdkVisual get_visual (void); GtkWidget::set_colormap void set_colormap( GdkColormap colormap ); Sets the widget's colormap to colormap. The widget must not have been realized or shown before calling set_colormap() . GtkWidget::set_visual void set_visual( GdkVisual visual ); GtkWidget::get_events int get_events(void);

GtkWidget::is_ancestor bool is_ancestor( GtkWidget ancestor ); is_ancestor() tests whether the widget named in the ancestor parameter is an ancestor of the calling widget, in the packing hierarchy rather than in the GTK object hierarchy. This method is used extensively in GTK+ internals, but can also be useful in PHP-GTK, particularly for debugging purposes. GtkWidget::hide_on_delete int hide_on_delete(void); GtkWidget::set_style void set_style( GtkStyle style ); set_style() is used when some or all of the elements that make up an individual widget's default style property are being overwritten by a different instance of a GtkStyle object. See also: GtkStyle, copy() . GtkWidget::set_rc_style void set_rc_style(void); GtkWidget::ensure_style void ensure_style(void); GtkWidget::get_style GtkStyle get_style (void); GtkWidget::restore_default_style void restore_default_style(void); GtkWidget::set_composite_name void set_composite_name(string name); GtkWidget::get_composite_name string get_composite_name(void); GtkWidget::reset_rc_styles void reset_rc_styles(void);

GtkWidget::shape_combine_mask void shape_combine_mask( GdkBitmap shape_mask , int offset_x, int offset_y); This method can be used to give widgets an unnormal shape, e.g. a circle or something angulary. You can use it with all types of widgets, e.g. buttons and even windows. But see yourself: Exemplo 59. Making an unusual shaped button <?php if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); } $clickme = array( "174 70 3 1", " c None", ". c #000000", "+ c #FFBA01", " +++++++++++++++++++++++++++++++++++++++++++++ " ." ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++ " ." ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ " ." ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ " ." ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ " ." ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++" . "+++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++" . "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++" . "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", "

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++ ++++++++++" . "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ ++++++++++" . "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++ ++++++++++" . "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++ +++++++++++++++++++++ ++++++++++" . "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + ", " +++++++++++++++++++++ ++++++++++++++++++++ ++++++++++" . "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ ", " ++++++++++++++++++++ ++++++++++++++++++ ++++++++++" . "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++ + ", " ++++++++++++++++ ++++++++++++++++ ++++++++++" . "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++ ++ ", " ++++++++++++++ +++++ ++++++++++" . "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++ ++++ ", " +++++++++++++ +++ ++++ " . " +++++++++++++++++++++++++++++++++++ +++++ ", " ++++++++++++ " . " ++++++++++++++++++++++++

++++++ ", " +++++++++++ " . " ++++++++++++++++++ ++++++ ", " +++++++++++ " . " ++++++++++++++ +++++++ ", " +++++++++++ " . " ++++++++++++ +++++++ ", " +++++++++++ " . " ++++++++++ ++++++++ ", " +++++++++++ " . " ++++++++ ++++++++ ", "++++++++++++ " . " ++++++ +++++++++ ", "++++++++++++ " . " +++++ ++++++++++", "++++++++++++ " . " ++++ ++++++++++", "++++++++++++ .. . ." . " +++ ++++++++++", "++++++++++++ ........ .... ... .. .. " . " +++ ++++++++++", "+++++++++++ ........... .... ..... .. .. " . " ++ ++++++++++", "+++++++++++ ............ .... ..... .. .. " . " ++ ++++++++++", "+++++++++++ ............. .... ... .. .. " ."+ ++++++++++", "+++++++++++ ....... ..... .... ..

... " ."+ ++++++++++", "+++++++++++ ...... .... .... .. ... " ."+ ++++++++++", "+++++++++++ ...... ... .... .. ... " ."+ ++++++++++", "+++++++++++ ..... .... .. ... ." . ".. .. + ++++++++++", "+++++++++++ ..... .... .. ....... .. ... .." . "... .... ...... ...... ...... + ++++++++++", "+++++++++++ ..... .... .... .......... .. ... ..." . "... .... ................ .......... + ++++++++++", "+++++++++++ ..... .... .... ............ .. ... ...." . "... ..................... ............ + ++++++++++", "+++++++++++ .... .... .... ............. .. ... ....." . ".. ...................... ............. + ++++++++++", "+++++++++++ .... .... .... ..... ... .. ... ......" . ". ........ ....... ..... ...... ..... + ++++++++++", "+++++++++++ ..... .... .... ..... .. .........." . " ....... ..... .... ..... ..... ++ ++++++++++", "+++++++++++ .... .... .... ..... .. ......... " . " ...... .... .... .... ....... ++ ++++++++++", "+++++++++++ .... .... .... ..... .. ........ " . " ..... .... .... .... ........ +++ ++++++++++", "+++++++++++ .... .... .... ..... .. ......... " . " .... .... .... ............ ++++ ++++++++++", "+++++++++++ .... .. .... .... .... .. .........." . " .... .... ..... .......... ++++

++++++++++", "++++++++++++ ..... ..... .... .... .... .. .... ....." . " .... ..... ..... ........ ++++ +++++++++ ", "++++++++++++ ..... ...... .... .... .... .. .. ...." . ". .... ..... ..... ...... ++++ +++++++++ ", "+++++++++++++ ...... ........ .... .... ..... .. .. .. ...." . ".. .... ..... ..... ..... ... +++++ ++++++++ ", "++++++++++++++ ............... .... .... ...... ..... .. .. ..." . "... .... .... .... ...... ..... +++++ ++++++++ ", "+++++++++++++++ ............ .... .... .............. .. .. .." . "... .... .... .... ............... +++++ +++++++ ", " ++++++++++++++++ .......... .... .... ............. .. .. ." . ".... .... .... .... ............. +++++ +++++++ ", " +++++++++++++++++ ..... .... .... .......... .. .. ." . "... .... .... .... ........... ++++++ +++++++ ", " +++++++++++++++++++ .. .. ...... . ." . "... .. ... ... ....... +++++++ ++++++ ", " +++++++++++++++++++ " . " ++++++++ ++++++ ", " ++++++++++++++++++++++ " . " +++++++++++ ++++++ ", " +++++++++++++++++++++++++++++ " . " +++++++++++++ ++++++ ", " +++++++++++++++++++++++++++++++++ " . " +++++++++++++++++ +++++ ", " ++++++++++++++++++++++++++++++++++++++++++++ " . " +++++++++++++++++++++++++++ +++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++

" . " +++++++++++++++++++++++++++++++++ ++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++" . "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++ +++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++" . "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++ ++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++" . "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++ + ", " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++" . "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++" . "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++" . "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++ ", " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++" . "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++" . "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " +++++++++++++++++++++++++++++++++++++++++++++ ++++++++++" . "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ", " ++++++++++++++++++++++++++++++++ ++++++++++" . "++++++++++++++++++++++++++++++++++++++++++++++++++++++

", " ++++++++++++++++++++++ ++++++++++" . "++++++++++++++++++++++++++++++++++++++++++++++++ " ); $window = &new GtkWindow(); $window->set_default_size( 200, 100); $window->connect_object('destroy', array('gtk', 'main_quit')); $window->realize(); list($pixmap, $mask) = gdk::pixmap_create_from_xpm_d( $window->window, null, $c lickme); $btn = &new GtkButton( ''); $btn->shape_combine_mask($mask, 5, 5); $style = $btn->style; $style->bg[GTK_STATE_NORMAL] = new GdkColor( 'orange'); $style->bg[GTK_STATE_PRELIGHT] = new GdkColor('#FF0000'); $style->bg[GTK_STATE_ACTIVE] = new GdkColor('#00FF00'); $btn->set_style( $style); $window->add( $btn); $window->show_all(); gtk::main(); ?> show Funo Callback void callback(GtkWidget widget); hide Funo Callback void callback(GtkWidget widget); map Funo Callback void callback(GtkWidget widget); unmap Funo Callback void callback(GtkWidget widget);

realize Funo Callback void callback(GtkWidget widget); unrealize Funo Callback void callback(GtkWidget widget); draw Funo Callback void callback(GtkWidget widget, ); draw-focus Funo Callback void callback(GtkWidget widget); draw-default Funo Callback void callback(GtkWidget widget); size-request Funo Callback void callback(GtkWidget widget, ); size-allocate Funo Callback void callback(GtkWidget widget, ); state-changed Funo Callback void callback(GtkWidget widget, ); parent-set Funo Callback void callback(GtkWidget widget, GtkWidget parent);

style-set Funo Callback void callback(GtkWidget widget, ); add-accelerator Funo Callback void callback(GtkWidget widget); remove-accelerator Funo Callback void callback(GtkWidget widget); grab-focus Funo Callback void callback(GtkWidget widget); event The "event" signal is emitted when any GdkEvent is captured by the connected widget's underlying GdkWindow. All event signals return false until the event has been propagated to the widget that will handle it, at which point they return true, the event is no longer propagated and the signal is no longer fired. Each event causes two signal emissions; the generic event signal described here, and the specific event signal that is being called, such as the "key-press-event" signal. The "event" signal itself is unlikely to be used directly on its own account very often. All event signals carry the event that caused the signal to be fired as the first parameter after the connecting widget. You may add as many parameters as you like that contain data specific to your application. You can limit or extend the events that are captured by a windowed widget by setting one or more GdkEventMask flags for the widget. See add_events() , and set_events() . Funo Callback bool callback(GtkWidget widget, GdkEvent event); button-press-event

This is an event signal, fired when the connected widget picks up a GDK_BUTTON_PRESS event. Button press events are generated by any of the mouse buttons being pressed. You can distinguish between the mouse buttons in the callback by using an if or switch statement: <?php function on_click($widget, $event, $data) { switch($event->button) { case 1: /* do something appropriate to a left click */ break; case 2: /* do something appropriate to a middle click */ break; case 3: /* do something appropriate to a right click */ break; } } $widget->connect('button-press-event', 'on_click', $data); ?> See also: "button-release-event", "event", "key-press-event". Funo Callback bool callback(GtkWidget widget, GdkEvent button_press); button-release-event This is an event signal, fired when the connected widget picks up a GDK_BUTTON_RELEASE event. Button release events are generated by any of the mouse buttons being released. You can distinguish between the mouse buttons in the callback by using $event->button. See also: "button-press-event", "event", "key-press-event". Funo Callback bool callback(GtkWidget widget, GdkEvent button_release); motion-notify-event This is an event signal, fired when the connected widget picks up a GDK_MOTION_NOTIFY event. Motion notify events are triggered when the mouse pointer moves across the screen. There are a great many of them, which has given rise to several different kinds of GdkEventMask aiming to minimise the amount that are captured. See also: "event". Funo Callback

bool callback(GtkWidget widget, GdkEvent motion_notify); delete-event This is an event signal, fired when the window manager requests that a widget be deleted. This is generally when a user clicks the X close button on a toplevel window. The delete event is not propagated. If you want to prevent the end user from using the window decorations to close your application, returning true from the "delete-event" signal will do just that. Allowing it to return false - which it does by default - will cause its default handler to be called. This happens to be the destroy() method, which in turns fires the "destroy" signal. In most cases, it's simpler to connect directly to the latter. See also: "event". Funo Callback bool callback(GtkWidget widget, GdkEvent delete); destroy-event You really shouldn't ever find a widget that emits this signal. The destroy event is triggered by the destruction of a widget's underlying GdkWindow, so if that widget is still capable of emitting the "destroy-event" signal something has gone badly awry. See also: "delete-event", "event". Funo Callback bool callback(GtkWidget widget, GdkEvent destroy); expose-event This is an event signal, initially emitted when the connected widget becomes fully visible on screen. Every widget can capture expose events; they are even synthesized for widgets that don't have a GdkWindow. Expose events are also generated when a widget has been partially or fully covered by another widget, and is re-exposed. These events trigger a redraw internally; a GdkWindow that is not currently exposed is not currently drawn, and the same applies to any unexposed area of a window. Following suit, the most likely reason to connect to an "expose-event" signal is that you have a drawing function in the callback. See also: "event", GtkDrawingArea, GdkWindow, and the numerous GTK and GDK drawing functions filed under 'Misc'.

Funo Callback bool callback(GtkWidget widget, GdkEvent expose); key-press-event This is an event signal, fired when the connected widget picks up a GDK_KEY_PRESS event. Key press events are generated by any of the keys on a keyboard being pressed. You can distinguish between the key values in the callback using an if or switch statement: <?php function on_click($widget, $event, $data) { if($event->keyval==GDK_KEY_Return) { /*do something appropriate for the return key being pressed*/ } elseif($event->keyval > GDK_KEY__a) { /*we can reach the character strings, too*/ echo $event->string."\n"; } } ?> Yes, we have hard-coded keysyms. The full list of PHP-GTK keysymbol constants is in the source code in the file php-gtk/ext/gtk+/php_gdk.c. Funo Callback bool callback(GtkWidget widget, GdkEvent key_press); key-release-event Funo Callback bool callback(GtkWidget widget, GdkEvent key_release); enter-notify-event Funo Callback bool callback(GtkWidget widget, GdkEvent enter_notify); leave-notify-event Funo Callback bool callback(GtkWidget widget, GdkEvent leave_notify); configure-event Funo Callback

bool callback(GtkWidget widget, GdkEvent configure); focus-in-event Funo Callback bool callback(GtkWidget widget, GdkEvent focus_change); focus-out-event Funo Callback bool callback(GtkWidget widget, GdkEvent focus_change); map-event Funo Callback bool callback(GtkWidget widget, GdkEvent map); unmap-event Funo Callback bool callback(GtkWidget widget, GdkEvent unmap); property-notify-event Funo Callback bool callback(GtkWidget widget, GdkEvent property_notify); selection-clear-event Funo Callback bool callback(GtkWidget widget, GdkEvent selection_clear); selection-request-event Funo Callback bool callback(GtkWidget widget, GdkEvent selection_request); selection-notify-event Funo Callback bool callback(GtkWidget widget, GdkEvent selection_notify); selection-received Funo Callback

void callback(GtkWidget widget, , ); selection-get Funo Callback void callback(GtkWidget widget, , , ); proximity-in-event Funo Callback bool callback(GtkWidget widget, GdkEvent proximity_in); proximity-out-event Funo Callback bool callback(GtkWidget widget, GdkEvent proximity_out); drag-begin Funo Callback void callback(GtkWidget widget, ); drag-end Funo Callback void callback(GtkWidget widget, ); drag-data-delete Funo Callback void callback(GtkWidget widget, ); drag-motion This signal is emitted when the "loaded" mouse cursor (dragging something) is moved over the widget, which accepts the data the cursor carries. Funo Callback bool callback( GtkWidget widget , GdkDragContext context , int x, int y, int time); drag-leave When a "loaded" (dragging) mouse moves away (leaves) the current widget it entered before (signaled by "drag-motion"), this signal is emitted. It can be used to self-un-highlight the widget, restoring it

to the normal state. Funo Callback void callback( GtkWidget widget , GdkDragContext context , int time); drag-drop Funo Callback bool callback(GtkWidget widget, , , , ); drag-data-get This signal is emitted when the user has dragged something from one widget and dropped it onto another widget. The data to be transferred from one to another widget is requested via this signal. To set the data, use the set() function of the selection. Exemplo 60. Passing drag data to the drop target function dnd_drag_data_get($widget, $context, $selection_data, $info, $time) { $dnd_string = "Perl is the only language that looks\nthe same before and af ter RSA encryption"; $selection_data->set($selection_data->target, 8, $dnd_string); } Funo Callback void callback( GtkWidget widget , GdkDragContext context , GtkSelectionData selection_data , int info, int time); drag-data-received This signal is emitted when the user has dropped drag data over the widget. Funo Callback void callback( GtkWidget widget , GdkDragContext context , int x, int y, GtkSelectionData data , int info, int time); visibility-notify-event Funo Callback bool callback( GtkWidget widget , GdkEvent visibility_notify ); client-event Funo Callback bool callback(GtkWidget widget, GdkEvent client_event);

no-expose-event Emitted when a GDK_NO_EXPOSE event is captured. Funo Callback bool callback(GtkWidget widget, GdkEvent no_expose); debug-msg Funo Callback void callback(GtkWidget widget, ); GtkWidget::style Access: Read Only Type: GtkStyle GtkWidget::window Access: Read Only Type: GdkWindow GtkWidget::allocation Access: Read Only Type: GtkAllocation GtkWidget::state Access: Read Only Type: GtkStateType GtkWidget::parent Access: Read Only Type: GtkWidget The widget's parent must be derived from GtkContainer. GtkWindow Widget that provides windows for an application. Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkWindow

Direct subclasses GtkColorSelectionDialog, GtkDialog, GtkFileSelection, GtkFontSelectionDialog, GtkPlug Descrio GtkWindow is the widget providing the windows for an application. There are three different types, defined by the programmer during construction - toplevel, dialog or popup. Toplevel windows contain the standard window decorations minimize, maximize and close. Of these, the first two exhibit the expected default behaviour; this is pre-set within the GDK source, and cannot currently be altered from within PHP-GTK. The close button is not pre-set in same way, in that its emission of the "destroy" signal can be overridden by connecting a function to the window's "delete-event" signal and having that function return true. Note that the main window's "destroy" signal should be connected, directly or otherwise, to a function that will quit the GTK main loop. A dialog window is not the same thing as a GtkDialog, but is simply a normal toplevel window with the maximize function disabled. Both dialog and popup windows are designed to be used when a message to the user requires a response, and should be used in conjunction with the set_transient_for() and set_modal() methods. A popup window lacks any window decoration, so needs an alternative means of closure. This could triggered by a timer, an event, or a widget capable of user interaction. Note that both the window decorations and the associated functions described above are provided by the underlying system's window manager, and could possibly vary or be absent. A GtkWindow object is derived from GtkBin, and can therefore only have one child widget added to it directly. To add more children it is necessary to make that child a container that can hold mulitple children. See GtkBox. There is no clean way to maximize a window in php-gtk 1. You only can use the following workaround: $window->set_usize(gdk::screen_width(),gdk::screen_height()); This leads to the problem that the size of task bars are not respected; so you shouldn't do that. For Windows you can use an API call: dl("php_w32api.dll"); $api =& new win32; define('SW_MAXIMIZE',3); define('SW_MINIMIZE',6);

//register windows functions $api->registerfunction("long GetLastError Alias GetError () From kernel32.dll") ; $api->registerfunction("long FindWindow (string &ClassName, string &WindowName) From user32.dll"); $api->registerfunction("long ShowWindow (long hWnd, long nCmdShow) From user32. dll"); $window =& new GtkWindow(); $window->set_title('PHP Test'); $window->show(); $class_string = 'gdkWindowToplevel'; $title_string = 'PHP Test'; if(!$sw = $api->FindWindow($class_string,$title_string)){ $error = $api->getError(); echo ' Oops FindWindow error: '.$error."\n"; }else{ $api->ShowWindow($sw,SW_MAXIMIZE); } You still have to take care only to call these functions when the php-gtk application is running on Windows. If you need to set the window cursor, you should have look at GdkWindow. Construtor GtkWindow ([ GtkWindowType type = GTK_WINDOW_TOPLEVEL ]); -- Creates a new GtkWindow. Mtodos set_title() Sets window title. set_wmclass() Sets window manager class and name. set_policy() Sets window resizing policy. *deprecated in GTK2* add_accel_group() Associates accelerator group with window. remove_accel_group() Removes associated accelerator group from window. set_position() Sets screen position of window. activate_focus()

Activates child that currently has focus. activate_default() Activates child currently set as default. set_transient_for() Sets window as transient for the given parent. set_default_size() Sets default window size. set_modal() Toggles window modality. set_focus() Gives child widget focus. set_default() Sets child widget as default. Sinais "set-focus" Emitted when set_focus() is called. GtkWindow Construtor GtkWindow ([ GtkWindowType type = GTK_WINDOW_TOPLEVEL ]); Creates a new GtkWindow which is toplevel by default. Most of the other widgets in PHP-GTK need to have a window constructed and to be added to that window (or a container within that window) before they can be instantiated. There are exceptions, such as GtkDialog and GtkColorSelectionDialog; these are compound widgets which are already based upon their own internal instance of a GtkWindow. As the GtkWindow is such a fundamental object in the design of windowed applications, there follows a brief code sample to reiterate the essential basic steps in creating any PHP-GTK script: <?php /*load the php_gtk module*/ dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')) || die("Can't load php_gtk module!\n"); /*create the main window*/ $window = &new GtkWindow(); /*ensure that the destruction of the main window also kills the main loop*/ $window->connect_object('destroy', array('gtk', 'main_quit')); /*realize the underlying GdkWindow, flag the GtkWindow's visibility and map it onto the screen, all in one simple line*/ $window->show();

/*without the main loop, there is no PHP-GTK script*/ gtk::main(); ?> GtkWindow::set_title void set_title(string title); Sets the title shown in the window's title bar, and also in the task bar icon for the window when it is minimized. The text is truncated to the width of the window. Either single or double quotation marks may be used to contain the string. Note that any apostrophes will need to be escaped with a backslash if single quotation marks are used. GtkWindow::set_wmclass void set_wmclass(string wmclass_name, string wmclass_class); Sets the window manager name and class across an application. However, given that the window manager class is already set in precisely this way by GTK, and that there are no functions in PHP-GTK where we might need this information, this method is best left untouched. GtkWindow::set_policy void set_policy(int allow_shrink, int allow_grow, int auto_shrink); The default policy on a GtkWindow is false, true, false, which retains the default size of the window on opening and allows the user to resize it thereafter. allow_shrink when set to true allows the window to be smaller than its child's size requisition, which has the effect of truncating the child. For this reason, it should always be set to false. allow_grow when set to true allows the window to be expanded beyond its initial size. The default behaviour of the child is to expand with the window, in most cases. Setting the allow_grow parameter to false prevents such resizing, taking the requisition size of the window's child as the window's base size. auto_shrink when set to true overrides the window's default size setting, and shrinks or expands the window to fit the child's requisition size if the second parameter hasn't already done so. Basically the only reason to use this method is likely to be when you don't want the window to be user-resizable. In this case, the setting you should use is false, false, true, or alternatively false, false, false which will have the same effect due to the redundancy of the third parameter here.

This method has been deprecated in GTK 2.0 in favour of a new and more efficient method. It would be wise to bear this in mind and use set_policy() sparingly. GtkWindow::add_accel_group void add_accel_group( GtkAccelGroup accel_group ); Adds an existing GtkAccelGroup to the window, allowing keyboard shortcuts to be created - usually for menus. GtkWindow::remove_accel_group void remove_accel_group( GtkAccelGroup accel_group ); Removes the named accelerator group from the window. GtkWindow::set_position void set_position( GtkWindowPosition position ); set_position() sets the position of the window on opening to one of four possible GtkWindowPosition values. GtkWindow::activate_focus int activate_focus(void); activate_focus() is a method that will emit the activate signal from the child widget having focus at the point that the method is called. In GTK+, each widget has one signal which has activate signal status; the signal with this status has the ability to respond to events generated from the keyboard. If you do not have that widget-specific activate signal connected to the widget with focus, nothing will be fired. The widget that is most likely to be used in this situation is probably GtkButton, which has "clicked" as its activate signal. If this method is part of a callback called from another widget, that widget will have focus at the time that the callback is run and PHP will - understandably - crash. It needs to be called from an event signal in order to work. See also: Signals and Events in the PHP-GTK userguide, activate_default() , set_focus() , "activate". GtkWindow::activate_default int activate_default(void); As with activate_focus() , the activate_default() method causes the widget-specific activate signal to be emitted by the targeted child.

See also: activate_focus() , set_default() , "activate". GtkWindow::set_transient_for void set_transient_for( GtkWindow parent ); set_transient_for() is used to set a dialog or popup window as a temporary child of the toplevel window it is associated with. This prevents there being an additional icon for the transient message in the taskbar, and also allows the transient window to take on the behaviour of the parent window, e.g. if the parent is minimized the child will minimize along with it. This method does not work in the win32 version of GTK+ currently used by PHP-GTK, but as the bug causing the problem has now been fixed in Gnome CVS it would be sensible to use it. Attempting to delete the parent window before destroying the transient window produces a gdk warning on win32. To avoid this, always use set_modal() where you have used set_transient_for() . GtkWindow::set_default_size void set_default_size(int width, int height); set_default_size() sets the default opening size of a window, in pixels. This can be overridden by size requests from the window's child widget exceeding the default size of the window, or by actively setting the resizing policy of the window so that the window always shrink-wraps its child. Note that a smaller child widget whose size has not been set or otherwise restricted by the programmer will generally expand to fit the default size of the parent window. GtkWindow::set_modal void set_modal(bool modal); set_modal() is used to prevent the other windows in an application from reacting to user activity until the modal window has had an appropriate user response. It is usually used where dialog or popup windows are acting as message boxes. A similar effect can be achieved with most widgets by using the static function gtk::grab_add() ; however note that set_modal() is a slightly more complex method and is equipped to deal more fully with the scenarios likely to arise when using modal windows. GtkWindow::set_focus void set_focus( GtkWidget focus );

set_focus() sets the focus to the child widget passed as the parameter. The child must have the flag GTK_CAN_FOCUS set in order to be allowed focus. Some widgets are created with this flag already set (including the GtkButton widget), others are not. See also: GtkWidgetFlags, GtkWidget, set_flags() . GtkWindow::set_default void set_default( GtkWidget defaultw ); set_default() sets the child widget passed to it as the default child. (This will usually be a GtkButton.) The child must have the flag GTK_CAN_DEFAULT set in order to be allowed focus. Some widgets are created with this flag already set; GtkButton is not one of those widgets, and needs to be flagged. Child widgets that are set as default are marked as such in a way that will be familiar to users. For instance, a button set as default has a decorative frame and shadow around it. See also: GtkWidgetFlags, GtkWidget, set_flags() . set-focus The "set-focus" signal is emitted by the GtkWindow in response to a set_focus() method call, which is triggered each time the child having focus within that window changes, that is, every time the user chooses a different child widget. The signal is primarily for internal GTK use. Funo Callback void callback( GtkWindow window , GtkWidget child_widget ); GTK Functions GTK functions not belonging to any class. gtk::accel_group_get_default() Gets the toplevel window's default GtkAccelGroup. gtk::button_box_set_child_ipadding_default() Sets GtkButtonBox default child internal padding. gtk::button_box_set_child_size_default() Sets GtkButtonBox default minimum child size. gtk::check_version() Checks which version of GTK+ is being used. gtk::drag_finish()

gtk::drag_get_source_widget() gtk::drag_set_default_icon() gtk::drag_set_icon_default() gtk::drag_set_icon_pixmap() gtk::drag_set_icon_widget() gtk::drag_dest_handle_event() gtk::drag_source_handle_event() gtk::draw_arrow() Draws an arrow. gtk::draw_box() Draws a box. gtk::draw_diamond() gtk::draw_hline() gtk::draw_oval() Not implemented. gtk::draw_shadow() gtk::draw_string() Draws text in a given GdkWindow gtk::draw_vline() Draws a vertical line in a given GdkWindow gtk::entry_new_with_max_length() Creates a limited-character GtkEntry. gtk::events_pending() Tests whether there are GdkEvents queueing. gtk::false()

Returns false. gtk::hbutton_box_get_layout_default() Returns GtkHButtonBox layout default. gtk::hbutton_box_get_spacing_default() Returns GtkHButtonBox spacing default. gtk::grab_add() Endows a widget with keyboard grab. gtk::grab_get_current() Returns widget that currently has keyboard grab. gtk::grab_remove() Removes keyboard grab from a widget. gtk::hbutton_box_set_layout_default() Sets layout default for GtkHButtonBoxes. gtk::hbutton_box_set_spacing_default() Sets spacing default for GtkHButtonBoxes. gtk::idle_add() Causes the mainloop to call a function whenever no events are to be processed. gtk::idle_remove() Removes the idle function with the given id. gtk::input_add() gtk::input_remove() gtk::item_factories_path_delete() gtk::item_factory_from_path() gtk::item_factory_from_widget() Get the GtkItemFactory that created a widget gtk::item_factory_parse_rc() gtk::item_factory_parse_rc_string() gtk::item_factory_path_from_widget()

gtk::main() Runs the main loop. gtk::main_do_event() Processes a single GdkEvent. gtk::main_iteration() Runs the main loop once and then blocks GTK until an event is pending. gtk::main_iteration_do() Runs the main loop once, with optional blocking. gtk::main_level() Returns the main loop nesting level. gtk::main_quit() Quits the main loop. gtk::paint_arrow() gtk::paint_box() gtk::paint_box_gap() gtk::paint_check() gtk::paint_cross() gtk::paint_diamond() gtk::paint_extension() gtk::paint_flat_box() Paints a flat box. gtk::paint_focus() A quick way to draw focus-like shadow around a given rectangle. gtk::paint_handle() gtk::paint_hline() gtk::paint_option()

gtk::paint_oval() Not implemented. gtk::paint_ramp() gtk::paint_shadow() gtk::paint_shadow_gap() gtk::paint_slider() gtk::paint_string() gtk::paint_tab() gtk::paint_vline() gtk::preview_get_cmap() gtk::preview_get_visual() gtk::preview_reset() gtk::preview_set_color_cube() gtk::preview_set_gamma() gtk::preview_set_install_cmap() gtk::preview_set_reserved() gtk::quit_add() Register a function to be called when a main loop level is exited. gtk::quit_remove() Unregister a function from being called when a main loop level is exited. gtk::rc_add_default_file()

Add a file to the list of files to be parsed at the end of gtk_init(). gtk::rc_get_module_dir() Return the directory that PHP-GTK looks for theme engines in. gtk::rc_get_style() Return the GtkStyle that will be applied to the widget. gtk::rc_parse() Parses an application's rc file(s). gtk::rc_parse_string() Parse resource information directly from a string. gtk::rc_reparse_all() Reparse all of an application's rc files. gtk::timeout_add() Sets up a function to be called at regular intervals. gtk::timeout_remove() Removes timeout. gtk::true() Returns true. gtk::type_from_name() Returns object type from object name. gtk::type_name() Returns name of object. gtk::vbutton_box_get_layout_default() Returns GtkVButtonBox layout default. gtk::vbutton_box_get_spacing_default() Returns GtkVButtonBox spacing default. gtk::vbutton_box_set_layout_default() Sets layout default for GtkVButtonBoxes. gtk::vbutton_box_set_spacing_default() Sets spacing default for GtkVButtonBoxes. gtk::widget_get_default_colormap() Returns the application's default GdkColormap. gtk::widget_get_default_style() Returns the application's default GtkStyle. gtk::widget_get_default_visual() Returns the application's default GdkVisual.

gtk::widget_pop_colormap() gtk::widget_pop_composite_child() gtk::widget_pop_style() gtk::widget_pop_visual() gtk::widget_push_colormap() gtk::widget_push_composite_child() gtk::widget_push_style() gtk::widget_push_visual() gtk::widget_set_default_colormap() Sets a GdkColormap as default for the application. gtk::widget_set_default_style() Sets a GtkStyle as default for the application. gtk::widget_set_default_visual() Sets a GdkVisual as default for the application. gtk::accel_group_get_default GtkAccelGroup gtk::accel_group_get_default (void); gtk::button_box_set_child_ipadding_default void gtk::button_box_set_child_ipadding_default (int ipad_x, int ipad_y); gtk::button_box_set_child_size_default void gtk::button_box_set_child_size_default (int min_width, int min_height); gtk::check_version string gtk::check_version(int required_major, int required_minor, int required_micro); gtk::drag_finish

void gtk::drag_finish( GdkDragContext context , bool success, bool del, int time); gtk::drag_get_source_widget GtkWidget gtk::drag_get_source_widget ( GdkDragContext context ); gtk::drag_set_default_icon void gtk::drag_set_default_icon( GdkColormap colormap , GdkPixmap pixmap , GdkBitmap mask , int hot_x, int hot_y); gtk::drag_set_icon_default void gtk::drag_set_icon_default( GdkDragContext context ); gtk::drag_set_icon_pixmap void gtk::drag_set_icon_pixmap( GdkDragContext context , GdkColormap colormap , GdkPixmap pixmap , GdkBitmap mask , int hot_x, int hot_y); gtk::drag_set_icon_widget void gtk::drag_set_icon_widget( GdkDragContext context , GtkWidget widget , int hot_x, int hot_y); gtk::drag_dest_handle_event void gtk::drag_dest_handle_event( GtkWidget toplevel , GdkEvent event ); gtk::drag_source_handle_event void gtk::drag_source_handle_event ( GtkWidget widget , GdkEvent event ); gtk::draw_arrow void gtk::draw_arrow( GtkStyle style , GdkWindow window , GtkStateType state_type , GtkShadowType shadow_type , GtkArrowType arrow_type , bool fill, int x, int y, int width, int height); The chief advantage of drawing your own GTK arrow rather than using the GtkArrow widget is that you can shape it, using the width and height parameters. The fill parameter refers to the color of the arrow, with false giving it the same color as the area it is drawn onto. All positions and sizes are absolute in terms of the underlying drawable. gtk::draw_arrow($style, $gdkwindow, GTK_STATE_NORMAL, GTK_SHADOW_OUT, GTK_ARROW_RIGHT, false, $x, $y, $width, $height); gtk::draw_box

void gtk::draw_box( GtkStyle style , GdkWindow window , GtkStateType state_type , GtkShadowType shadow_type , int x, int y, int width, int height); This is the simplest way to draw a box, with or without a shadow. Any coloring is completely dependant on the GtkStyle that is passed as the first parameter. gtk::draw_box($style, $gdkwindow, GTK_STATE_ACTIVE, GTK_SHADOW_IN, $x, $y, $width, $height); gtk::draw_diamond void gtk::draw_diamond( GtkStyle style , GdkWindow window , GtkStateType state_type , GtkShadowType shadow_type , int x, int y, int width, int height); gtk::draw_hline void gtk::draw_hline( GtkStyle style , GdkWindow window , GtkStateType state_type , int x1, int x2, int y); See also: draw_vline gtk::draw_oval void gtk::draw_oval( GtkStyle style , GdkWindow window , GtkStateType state_type , GtkShadowType shadow_type , int x, int y, int width, int height); gtk::draw_shadow void gtk::draw_shadow( GtkStyle style , GdkWindow window , GtkStateType state_type , GtkShadowType shadow_type , int x, int y, int width, int height); gtk::draw_string void gtk::draw_string( GtkStyle style , GdkWindow window , GtkStateType state_type , int x, int y, string string); Draws string in window. style is used to set the style of the text to be written. The upper left hand corner of string will begin x pixesl from the left edge of window and y pixels from the top of window. gtk::draw_vline void gtk::draw_vline( GtkStyle style , GdkWindow window , GtkStateType state_type , int y1, int y2, int x); Draws a vertical line in window. The line will be x pixels from the left edge of window, start y1 pixels from the top edge of window, and end y2 pixels from the top edge of window. style will be used to define the style of the line.

gtk::entry_new_with_max_length GtkWidget gtk::entry_new_with_max_length (int max); gtk::events_pending int gtk::events_pending(void); gtk::events_pending() is useful when there is a function that needs to be carried out during a long-running process, for example, updating a status bar during an SQL query. The way it would be used in such a situation is to have <?php while(gtk::events_pending()) gtk::main_iteration(); ?> after every update that is made to the GUI. This causes the main loop to run once each time events are anticipated. See also: gtk::main_iteration() , gtk::main_iteration_do() , gtk::timeout_add() . gtk::false int gtk::false(void); A static function that simply returns false. By default this is null; you can force a 0 return by declaring it as a PHP (int) type. gtk::hbutton_box_get_layout_default GtkButtonBoxStyle gtk::hbutton_box_get_layout_default (void); gtk::hbutton_box_get_spacing_default int gtk::hbutton_box_get_spacing_default (void); gtk::grab_add void gtk::grab_add( GtkWidget widget ); gtk::grab_get_current GtkWidget gtk::grab_get_current (void); Returns the widget which currently has the keyboard grab. NULL is returned if there is no active grab. Widgets can grab the pointer and keyboard away from other widgets. This essentially means that the widget becomes "modal"; input goes

only to that widget, and the focus can't be changed to another widget. A typical reason to grab input is to create a modal dialog; if a window has the grab, interaction with other windows is blocked. gtk::grab_remove void gtk::grab_remove( GtkWidget widget ); Removes the keyboard grab from the given widget. If you don't know what a grab is, have a look at grab_get_current function. gtk::hbutton_box_set_layout_default void gtk::hbutton_box_set_layout_default ( GtkButtonBoxStyle layout ); gtk::hbutton_box_set_spacing_default void gtk::hbutton_box_set_spacing_default (int spacing); gtk::idle_add int gtk::idle_add( GtkFunction function , [mixed data ]); Causes the mainloop to call the given function whenever no events with higher priority are to be processed. The returned number is an unique handle which you should keep saved somewhere for the case you want to remove the idle function. gtk::idle_remove void gtk::idle_remove(int idle_handler_id); Removes the idle function with the given idle_handler_id. You get this id when adding an idle function gtk::input_add XXX gtk::input_add(XXX); gtk::input_remove void gtk::input_remove(int input_handler_id); gtk::item_factories_path_delete void gtk::item_factories_path_delete (string ifactory_path, string path); gtk::item_factory_from_path GtkItemFactory gtk::item_factory_from_path (string path);

gtk::item_factory_from_widget GtkItemFactory gtk::item_factory_from_widget ( GtkWidget widget ); Returns the GtkWidgetFactory that created widget. gtk::item_factory_parse_rc void gtk::item_factory_parse_rc(string file_name); gtk::item_factory_parse_rc_string void gtk::item_factory_parse_rc_string (string rc_string); gtk::item_factory_path_from_widget string gtk::item_factory_path_from_widget ( GtkWidget widget ); gtk::main void gtk::main(void); gtk::main_do_event void gtk::main_do_event( GdkEvent event ); gtk::main_iteration int gtk::main_iteration(void); Runs the main loop once (e.g. updates the GUI) and blocks until an event is pending. This is useful during long-running functions which block the whole application. Have a look at the example at events_pending. gtk::main_iteration_do int gtk::main_iteration_do([bool blocking = TRUE ]); Runs the main loop once, with optional blocking. gtk::main_level int gtk::main_level(void); gtk::main_quit void gtk::main_quit(void); gtk::paint_arrow void gtk::paint_arrow( GtkStyle style , GdkWindow window , GtkStateType state_type , GtkShadowType shadow_type , GdkRectangle

area, GtkWidget widget , string detail, GtkArrowType arrow_type , bool fill, int x, int y, int width, int height); gtk::paint_box void gtk::paint_box( GtkStyle style , GdkWindow window , GtkStateType state_type , GtkShadowType shadow_type , GdkRectangle area, GtkWidget widget , string detail, int x, int y, int width, int height); gtk::paint_box_gap void gtk::paint_box_gap( GtkStyle style , GdkWindow window , GtkStateType state_type , GtkShadowType shadow_type , GdkRectangle area, GtkWidget widget , string detail, int x, int y, int width, int height, GtkPositionType gap_side , int gap_x, int gap_width); gtk::paint_check void gtk::paint_check( GtkStyle style , GdkWindow window , GtkStateType state_type , GtkShadowType shadow_type , GdkRectangle area, GtkWidget widget , string detail, int x, int y, int width, int height); gtk::paint_cross void gtk::paint_cross( GtkStyle style , GdkWindow window , GtkStateType state_type , GtkShadowType shadow_type , GdkRectangle area, GtkWidget widget , string detail, int x, int y, int width, int height); gtk::paint_diamond void gtk::paint_diamond( GtkStyle style , GdkWindow window , GtkStateType state_type , GtkShadowType shadow_type , GdkRectangle area, GtkWidget widget , string detail, int x, int y, int width, int height); gtk::paint_extension void gtk::paint_extension( GtkStyle style , GdkWindow window , GtkStateType state_type , GtkShadowType shadow_type , GdkRectangle area, GtkWidget widget , string detail, int x, int y, int width, int height, GtkPositionType gap_side ); gtk::paint_flat_box void gtk::paint_flat_box( GtkStyle style , GdkWindow window , GtkStateType state_type , GtkShadowType shadow_type , GdkRectangle area, GtkWidget widget , string detail, int x, int y, int width, int height); Regardless of the GtkShadowType detailed here, the effect is similar to the box drawn using gtk::draw_box() and GTK_SHADOW_NONE.

The GdkRectangle used should be in the same position and have the same dimensions as those passed in the function, as otherwise only the overlap between the two rectangles will be displayed, or nothing at all if there is no overlapping area. The detail parameter actually does nothing here, but is needed for back compatibility. Passing it as null, or as any string you feel, is okay. $rectangle = &new GdkRectangle($x, $y, $width, $height); gtk::paint_flat_box($style, $gdkwindow, GTK_STATE_ACTIVE, GTK_SHADOW_NONE, $rectangle, $drawingarea, null, $x, $y, $width, $height); gtk::paint_focus void gtk::paint_focus( GtkStyle style , GdkWindow window , GdkRectangle area, GtkWidget widget , string detail, int x, int y, int width, int height); gtk::paint_focus() is a convenience function that draws a dark shadow along the left and top sides of the given rectangle, making it appear as GTK widgets generally do when they have focus. This is the only function that uses the detail parameter at all now; if you pass 'set-mode' as that parameter, the shadow will appear as long dashes rather than as a continuous line. Any other string is regarded the same as if it were null. The other parameters are on the whole self-explanatory. The widget parameter refers to the widget that is being drawn upon (usually a GtkDrawingArea). gtk::paint_handle void gtk::paint_handle( GtkStyle style , GdkWindow window , GtkStateType state_type , GtkShadowType shadow_type , GdkRectangle area, GtkWidget widget , string detail, int x, int y, int width, int height, GtkOrientation orientation ); gtk::paint_hline void gtk::paint_hline( GtkStyle style , GdkWindow window , GtkStateType state_type , GdkRectangle area, GtkWidget widget , string detail, int x1, int x2, int y); gtk::paint_option void gtk::paint_option( GtkStyle style , GdkWindow window , GtkStateType state_type , GtkShadowType shadow_type , GdkRectangle area, GtkWidget widget , string detail, int x, int y, int width, int height); gtk::paint_oval void gtk::paint_oval( GtkStyle style , GdkWindow window , GtkStateType state_type , GtkShadowType shadow_type , GdkRectangle area, GtkWidget

widget , string detail, int x, int y, int width, int height); gtk::paint_ramp void gtk::paint_ramp( GtkStyle style , GdkWindow window , GtkStateType state_type , GtkShadowType shadow_type , GdkRectangle area, GtkWidget widget , string detail, GtkArrowType arrow_type , int x, int y, int width, int height); gtk::paint_shadow void gtk::paint_shadow( GtkStyle style , GdkWindow window , GtkStateType state_type , GtkShadowType shadow_type , GdkRectangle area, GtkWidget widget , string detail, int x, int y, int width, int height); gtk::paint_shadow_gap void gtk::paint_shadow_gap( GtkStyle style , GdkWindow window , GtkStateType state_type , GtkShadowType shadow_type , GdkRectangle area, GtkWidget widget , string detail, int x, int y, int width, int height, GtkPositionType gap_side , int gap_x, int gap_width); gtk::paint_slider void gtk::paint_slider( GtkStyle style , GdkWindow window , GtkStateType state_type , GtkShadowType shadow_type , GdkRectangle area, GtkWidget widget , string detail, int x, int y, int width, int height, GtkOrientation orientation ); gtk::paint_string void gtk::paint_string( GtkStyle style , GdkWindow window , GtkStateType state_type , GdkRectangle area, GtkWidget widget , string detail, int x, int y, string string); gtk::paint_tab void gtk::paint_tab( GtkStyle style , GdkWindow window , GtkStateType state_type , GtkShadowType shadow_type , GdkRectangle area, GtkWidget widget , string detail, int x, int y, int width, int height); gtk::paint_vline void gtk::paint_vline( GtkStyle style , GdkWindow window , GtkStateType state_type , GdkRectangle area, GtkWidget widget , string detail, int y1, int y2, int x); gtk::preview_get_cmap GdkColormap gtk::preview_get_cmap (void); gtk::preview_get_visual

GdkVisual gtk::preview_get_visual (void); gtk::preview_reset void gtk::preview_reset(void); gtk::preview_set_color_cube void gtk::preview_set_color_cube(int nred_shades, int ngreen_shades, int nblue_shades, int ngray_shades); gtk::preview_set_gamma void gtk::preview_set_gamma(double gamma); gtk::preview_set_install_cmap void gtk::preview_set_install_cmap(int install_cmap); gtk::preview_set_reserved void gtk::preview_set_reserved(int nreserved); gtk::quit_add int gtk::quit_add(int level , string callback , [mixed data ]); Registers the function callback to be called when main loop level level exits. If data is given, it will be passed to callback when called. Adding a function using gtk::quit_add() is similar to connecting a method to the destroy signal for a gtk loop. gtk::quit_add() returns an integer identifier which can be passed to gtk::quit_remove() in order to prevent the function from being called. See also: gtk::quit_remove() gtk::quit_remove void gtk::quit_remove(int quit_handler_id); Unregisters a function which was preivously registered by calling gtk::quit_add() . quit_handler_id is the value returned from gtk::quit_add() . See also: quit_add gtk::rc_add_default_file void gtk::rc_add_default_file(string filename); Adds a file to the list of files to be parsed at the end of gtk_init(). The default file to be parsed is ~/.gtkrc. This file does not need to be added using gtk::rc_add_default_file() in order to be

parsed. See also: gtk::rc_parse() gtk::rc_get_module_dir string gtk::rc_get_module_dir(void); Returns the directory that PHP-GTK looks for theme engines in. The default theme directory is /usr/lib/gtk/themes/engines/. gtk::rc_get_style GtkStyle gtk::rc_get_style ( GtkWidget widget ); Returns the GtkStyle that will be applied to widget. gtk::rc_get_style() finds all rc styles that will be applied to widget and combines them into one GtkStyle widget representing the final appearance of the widget. Exemplo 61. Getting the rc style for a widget <?php // Create a backgound style to apply to buttons only. $style = 'style "button" { bg[NORMAL] = "#ff6060" }'; gtk::rc_parse_string($style); // Create a foreground style that applies to the entire application. $style = 'style "window" { fg[NORMAL] = "#ffffff" }'; gtk::rc_parse_string($style); // Create a window and add a button. $window =& new GtkWindow(); $button =& new GtkButton('Example'); $window->add($button); // Get the rc style $rcStyle = gtk::rc_get_style($button); // Output the style properties. echo $rcStyle->fg . "\n"; // Will print #ffffff echo $rcStyle->bg . "\n"; // Will print #ff6060 ?> gtk::rc_parse void gtk::rc_parse(string filename); Parses an application's rc file(s). filename is the name of the rc file to parse. RC files are PHP-GTK's method for setting the default look and feel

for and application, class of widgets, or an individaul widget. When an application loads you can tell it to parse an rc file that acts similar to a style sheet for GTK objects. It defines how widgets should appear in their default state (before any user code alters their appearance). For more details about rc files, including their format, see http://www.gtk.org/tutorial/ch-gtkrcfiles.html See also: gtk::rc_parse_string() , gtk::rc_add_default_file() , gtk::rc_reparse_all() gtk::rc_parse_string void gtk::rc_parse_string(string rc_string); Parse resource information directly from a string. This can be used to dynamically change colors and background images for whole widgets and widget classes at once. There is an example at GtkTooltips::set_colors. gtk::rc_reparse_all bool gtk::rc_reparse_all(void); Reparses all of an application's rc files if the modification time of any of the previously parse files has changed. This will reset the look and feel of the application to its original state. Any changes that were made to an individual widget's style will be lost. If the files were reread, true is returned. See also: gtk::rc_parse() gtk::timeout_add int gtk::timeout_add(int interval, GtkFunction function , [mixed data ]); Registers function to be called periodically. The function will be called repeatedly after interval milliseconds while it returns TRUE. When function no longer returns TRUE the timeout is destroyed and will not be called again. You should save the returned number if you want to gtk::timeout_remove() it. gtk::timeout_remove void gtk::timeout_remove(int timeout_handler_id); Removes the given timeout destroying all information about it. You get the timeout_handler_id when you gtk::timeout_add() a function.

gtk::true int gtk::true(void); This is a static function that simply returns 1. It has no other functionality. gtk::type_from_name int gtk::type_from_name(string name); gtk::type_name string gtk::type_name(int type); gtk::vbutton_box_get_layout_default GtkButtonBoxStyle gtk::vbutton_box_get_layout_default (void); gtk::vbutton_box_get_spacing_default int gtk::vbutton_box_get_spacing_default (void); gtk::vbutton_box_set_layout_default void gtk::vbutton_box_set_layout_default ( GtkButtonBoxStyle layout ); gtk::vbutton_box_set_spacing_default void gtk::vbutton_box_set_spacing_default (int spacing); gtk::widget_get_default_colormap GdkColormap gtk::widget_get_default_colormap (void); Returns the application's default GdkColormap. gtk::widget_get_default_style GtkStyle gtk::widget_get_default_style (void); Returns the default GtkStyle that is currently being used throughout an application. Use gtk::widget_set_default_style() to change aspects of the default style. gtk::widget_get_default_visual GdkVisual gtk::widget_get_default_visual (void); Returns the application's default GdkVisual. gtk::widget_pop_colormap

void gtk::widget_pop_colormap(void); gtk::widget_pop_composite_child void gtk::widget_pop_composite_child(void); gtk::widget_pop_style void gtk::widget_pop_style(void); gtk::widget_pop_visual void gtk::widget_pop_visual(void); gtk::widget_push_colormap void gtk::widget_push_colormap( GdkColormap cmap ); gtk::widget_push_composite_child void gtk::widget_push_composite_child(void); gtk::widget_push_style void gtk::widget_push_style( GtkStyle style ); gtk::widget_push_visual void gtk::widget_push_visual( GdkVisual visual ); gtk::widget_set_default_colormap void gtk::widget_set_default_colormap ( GdkColormap colormap ); gtk::widget_set_default_style void gtk::widget_set_default_style ( GtkStyle style ); gtk::widget_set_default_visual void gtk::widget_set_default_visual ( GdkVisual visual ); Classes do GDK Classes derivadas da Biblioteca GDK ndice GdkAtom GdkBitmap

GdkColor A structure that holds a defined color. GdkColormap Mapping between the color values stored in memory and the RGB values that are used to display color values. GdkCursor A GdkCursor is represents a predefined or self-created mouse pointer. GdkDragContext GdkEvent One of the stream of mainloop events. GdkFont Structure holding font information. GdkGC A structure that contains graphics information. GdkPixmap GdkVisual GdkWindow Underlying window class for every GtkWidget. GDK Functions GDK functions not belonging to any class. GdkAtom Hierarquia do Objeto GdkAtom Direct subclasses None. Descrio GdkBitmap Hierarquia do Objeto GdkBitmap

Direct subclasses None. Descrio Mtodos extents() lock()

height() width() GdkBitmap::extents array extents(void); GdkBitmap::lock int lock(void); GdkBitmap::height int height(void); GdkBitmap::width int width(void); GdkColor A structure that holds a defined color. Hierarquia do Objeto GdkColor Direct subclasses None. Descrio A GdkColor provides an object structure for retaining information about a defined color. This is an XcmsColor structure, and will take values in any XcmsColor format accordingly. Probably the most generally useful of

these formats is the gamma-corrected XcmsRGB structure, which takes the range 0 to 65535 per RGB value, with 0, 0, 0 being the color black. RGB values that are given in this way are scaled to match the color range of the hardware device currently being used. Colors can be assigned through an application's RC files, where the GdkColor objects are constructed via the application colormap defined through the file. Colors that are assigned in this way can be constructed using any of the formats accepted by the XcmsColor structure, including intensity doubles. Note that this is not the case when assigning a color to a GdkColor directly. Construtor GdkColor (int red, int green, int blue); -- Creates a new color object using one of three possible constructs. Propriedades red: The red part of the color green: The green part of the color blue: The blue part of the color GdkColor Construtor GdkColor (int red, int green, int blue); When constructing a GdkColor directly, you will need to use the system's color names, hex RGB triples or XcmsRGB values. Attempting to use other formats here will not result in an error message, because the structure itself recognises them, but equally they will not display, because the function doesn't recognise them at all. The options when directly constructing colors in PHP-GTK are: <?php /* XcmsRGB values, expressed as three integers */ $cyan = &new GdkColor(0, 65535, 65535); /* hex triples expressed as a single string */ $cyan = &new GdkColor('#00FFFF'); /* a color name expressed as a single string */ $cyan = &new GdkColor('cyan'); ?>

Color names that are used on a given system are defined in a file named rgb.txt. The equivalent file is not available in human-readable form under win32, although utilised. Here is one of the better reference pages currently online detailing the standard color names used by window management systems. See also: GtkStyle. GdkColor::red Access: Read Write Type: int Returns the red part of the color in the range from 0 to 65536. If you convert it to hexadecimal via dechex, you will see that only the first 2 values are used, the last 2 are zero. So if you want to convert it to a nice html-like hexadecimal value like AF, you've got to shift it bitwise. $orange = &new GdkColor('#FF8000'); echo dechex( $orange->red >> 8); You can use the property to set the red part of the color as well. GdkColor::green Access: Read Write Type: int Returns the green part of the color in the range from 0 to 65536. If you convert it to hexadecimal via dechex, you will see that only the first 2 values are used, the last 2 are zero. So if you want to convert it to a nice html-like hexadecimal value like AF, you've got to shift it bitwise. $orange = &new GdkColor('#FF8000'); echo dechex( $orange->green >> 8); You can use the property to set the green part of the color as well. GdkColor::blue Access: Read Write Type: int Returns the blue part of the color in the range from 0 to 65536. If you convert it to hexadecimal via dechex, you will see that only the first 2 values are used, the last 2 are zero. So if you want to convert it to a nice html-like hexadecimal value like AF, you've got to shift it bitwise. $orange = &new GdkColor('#FF8000'); echo dechex( $orange->blue >> 8); You can use the property to set the blue part of the color as well.

GdkColormap Mapping between the color values stored in memory and the RGB values that are used to display color values. Hierarquia do Objeto GdkColormap Direct subclasses None. Descrio A GdkColormap maps the color values stored in memory to the RGB values that are used to display color values. The RGB component values correspond to the GdkColor red, green and blue values. Mtodos size() alloc() GdkColormap::size void size(void); GdkColormap::alloc void alloc(void); GdkCursor A GdkCursor is represents a predefined or self-created mouse pointer. Hierarquia do Objeto GdkCursor Direct subclasses None. Descrio A GdkCursor is represents an X11 mouse pointer. There are several predefined cursors (see GdkCursorType), but you can create your own monochrome (2-color, not just black/white) pointers as well. See: cursor_new, cursor_new_from_pixmap, set_cursor()

Propriedades type: The number of the current GdkCursorType. name: The name of the current cursor type. GdkCursor::type Access: Read Only Type: int The number of the current GdkCursorType. GdkCursor::name Access: Read Only Type: string The name of the current cursor type. The names are the same as the GdkCursorType constants, except that they are lowercase, omit the beginning GDK_ and have hyphens instead of underscores. For example, GDK_IRON_CROSS has the name iron-cross. GdkDragContext Hierarquia do Objeto GdkDragContext Direct subclasses None. Descrio Propriedades protocol:

is_source: source_window: dest_window:

targets: actions: suggested_action: action: start_time: GdkDragContext::protocol Access: Read Only Type: int GdkDragContext::is_source Access: Read Only Type: bool GdkDragContext::source_window Access: Read Only Type: GdkWindow GdkDragContext::dest_window Access: Read Only Type: GdkWindow GdkDragContext::targets Access: Read Only Type: array GdkDragContext::actions Access: Read Only Type: int GdkDragContext::suggested_action Access: Read Only Type: int GdkDragContext::action Access: Read Only Type: int

GdkDragContext::start_time Access: Read Only Type: int GdkEvent One of the stream of mainloop events. Hierarquia do Objeto GdkEvent Direct subclasses None. Descrio A GdkEvent is one of the continual stream of events that help make up the GTK main loop. Events crossing a widget indicate some form of activity - generally, but not exclusively, user activity. There are 32 different kinds of GdkEvent, each of which has only the properties appropriate to it exposed. Those differences are keyed using an enumerated value known as GdkEventType, which is a type property of both GdkEventAny and GdkEvent itself. Confused yet? That'll be because GdkEvent has a union structure, which is unique in GTK+ programming, and because the type property is intentionally accessible both through $event->type and through $any->type. Each event carries GdkEventType and GdkEventAny information. Beyond that, the properties that can be accessed within an event depend completely on its type. See the table below for details. The types of event that can be captured by an object depend on the GdkEventMask or masks that are in effect on that object. Each GTK widget is created with a set of these flags; this base set can be added to or limited within PHP-GTK using set_events() or add_events() as appropriate. The masks required by each event type are also listed in the table below, where applicable. See also: GtkEventBox, add_events() , set_events() , and the section on events in the Userguide. Further reading: The relevant chapter of Havoc Pennington's GTK+ / Gnome Application Development provides an in-depth overview of GDK events. It's aimed at C programmers, but is easy to read despite that caveat. Tabela 10. GdkEvent properties GdkEventType property GdkEventMask GDK_NOTHING

GDK_DELETE GDK_DESTROY GDK_EXPOSE expose GDK_EXPOSURE_MASK GDK_MOTION_NOTIFY motion GDK_POINTER_MOTION_MASK GDK_BUTTON1_MOTION_MASK GDK_BUTTON2_MOTION_MASK GDK_BUTTON3_MOTION_MASK GDK_BUTTON_PRESS GDK_2BUTTON_PRESS GDK_3BUTTON_PRESS GDK_BUTTON_RELEASE button GDK_BUTTON_PRESS_MASK GDK_BUTTON_RELEASE_MASK GDK_KEY_PRESS GDK_KEY_RELEASE key GDK_KEY_PRESS_MASK GDK_KEY_RELEASE_MASK GDK_ENTER_NOTIFY GDK_LEAVE_NOTIFY crossing GDK_ENTER_NOTIFY_MASK GDK_LEAVE_NOTIFY_MASK GDK_FOCUS_CHANGE focus_change GDK_FOCUS_CHANGE_MASK GDK_CONFIGURE configure GDK_MAP GDK_UNMAP GDK_PROPERTY_NOTIFY property GDK_PROPERTY_CHANGE_MASK GDK_SELECTION_CLEAR GDK_SELECTION_REQUEST GDK_SELECTION_NOTIFY selection GDK_PROXIMITY_IN GDK_PROXIMITY_OUT proximity GDK_PROXIMITY_IN_MASK GDK_PROXIMITY_OUT_MASK GDK_DRAG_ENTER GDK_DRAG_LEAVE GDK_DRAG_MOTION GDK_DRAG_STATUS GDK_DROP_START GDK_DROP_FINISH dnd

GDK_CLIENT_EVENT client GDK_VISIBILITY_NOTIFY visibility GDK_VISIBILITY_NOTIFY_MASK GDK_NO_EXPOSE no_expose GdkEventAny Hierarquia do Objeto GdkEventAny Direct subclasses None. Descrio Propriedades type:

window: send_event: GdkEventAny::type Access: Read Only Type: GdkEventType GdkEventAny::window Access: Read Only Type: GdkWindow GdkEventAny::send_event Access: Read Only Type: bool GdkEventButton Hierarquia do Objeto GdkEventButton Direct subclasses

None. Descrio Propriedades time:

x: y: pressure: xtilt: ytilt: state: button: source: deviceid: x_root: y_root: GdkEventButton::time Access: Read Only Type: int GdkEventButton::x Access: Read Only Type: double GdkEventButton::y

Access: Read Only Type: double GdkEventButton::pressure Access: Read Only Type: double GdkEventButton::xtilt Access: Read Only Type: double GdkEventButton::ytilt Access: Read Only Type: double GdkEventButton::state Access: Read Only Type: int GdkEventButton::button Access: Read Only Type: int GdkEventButton::source Access: Read Only Type: GdkInputSource GdkEventButton::deviceid Access: Read Only Type: int GdkEventButton::x_root Access: Read Only Type: double GdkEventButton::y_root Access: Read Only Type: double GdkEventClient Hierarquia do Objeto GdkEventClient

Direct subclasses None. Descrio Propriedades message_type:

data_format: data: GdkEventClient::message_type Access: Read Only Type: GdkAtom GdkEventClient::data_format Access: Read Only Type: int GdkEventClient::data Access: Read Only Type: array GdkEventConfigure Hierarquia do Objeto GdkEventConfigure Direct subclasses None. Descrio Propriedades x:

y: width:

height: GdkEventConfigure::x Access: Read Only Type: int GdkEventConfigure::y Access: Read Only Type: int GdkEventConfigure::width Access: Read Only Type: int GdkEventConfigure::height Access: Read Only Type: int GdkEventCrossing Hierarquia do Objeto GdkEventCrossing Direct subclasses None. Descrio Propriedades subwindow:

time: x: y: x_root:

y_root: mode: detail: focus: state: GdkEventCrossing::subwindow Access: Read Only Type: GdkWindow GdkEventCrossing::time Access: Read Only Type: int GdkEventCrossing::x Access: Read Only Type: double GdkEventCrossing::y Access: Read Only Type: double GdkEventCrossing::x_root Access: Read Only Type: double GdkEventCrossing::y_root Access: Read Only Type: double GdkEventCrossing::mode Access: Read Only Type: GdkCrossingMode GdkEventCrossing::detail Access: Read Only Type: GdkNotifyType

GdkEventCrossing::focus Access: Read Only Type: bool GdkEventCrossing::state Access: Read Only Type: int GdkEventDND Hierarquia do Objeto GdkEventDND Direct subclasses None. Descrio Propriedades context:

time: x_root: y_root: GdkEventDND::context Access: Read Only Type: GdkDragContext GdkEventDND::time Access: Read Only Type: int GdkEventDND::x_root Access: Read Only Type: int GdkEventDND::y_root Access: Read Only

Type: int GdkEventExpose Hierarquia do Objeto GdkEventExpose Direct subclasses None. Descrio Propriedades area:

count: GdkEventExpose::area Access: Read Only Type: GdkRectangle GdkEventExpose::count Access: Read Only Type: int GdkEventFocus Hierarquia do Objeto GdkEventFocus Direct subclasses None. Descrio Propriedades in: GdkEventFocus::in Access: Read Only Type: int

GdkEventKey Hierarquia do Objeto GdkEventKey Direct subclasses None. Descrio Propriedades time:

state: keyval: length: string: GdkEventKey::time Access: Read Only Type: int GdkEventKey::state Access: Read Only Type: int GdkEventKey::keyval Access: Read Only Type: int GdkEventKey::length Access: Read Only Type: int GdkEventKey::string Access: Read Only Type: string

GdkEventMotion Hierarquia do Objeto GdkEventMotion Direct subclasses None. Descrio Propriedades time:

x: y: pressure: xtilt: ytilt: state: is_hint: source: deviceid: x_root: y_root: GdkEventMotion::time Access: Read Only Type: int

GdkEventMotion::x Access: Read Only Type: double GdkEventMotion::y Access: Read Only Type: double GdkEventMotion::pressure Access: Read Only Type: double GdkEventMotion::xtilt Access: Read Only Type: double GdkEventMotion::ytilt Access: Read Only Type: double GdkEventMotion::state Access: Read Only Type: int GdkEventMotion::is_hint Access: Read Only Type: int GdkEventMotion::source Access: Read Only Type: GdkInputSource GdkEventMotion::deviceid Access: Read Only Type: int GdkEventMotion::x_root Access: Read Only Type: double GdkEventMotion::y_root Access: Read Only

Type: double GdkEventNoExpose Hierarquia do Objeto GdkEventNoExpose Direct subclasses None. Descrio Propriedades type:

window: send_event: GdkEventNoExpose::type Access: Read Only Type: GdkEventType GdkEventNoExpose::window Access: Read Only Type: GdkWindow GdkEventNoExpose::send_event Access: Read Only Type: bool GdkEventProperty Hierarquia do Objeto GdkEventProperty Direct subclasses None. Descrio Propriedades

atom:

time: state: GdkEventProperty::atom Access: Read Only Type: GdkAtom GdkEventProperty::time Access: Read Only Type: int GdkEventProperty::state Access: Read Only Type: int GdkEventProximity Hierarquia do Objeto GdkEventProximity Direct subclasses None. Descrio Propriedades time:

source: deviceid: GdkEventProximity::time Access: Read Only Type: int GdkEventProximity::source

Access: Read Only Type: GdkInputSource GdkEventProximity::deviceid Access: Read Only Type: int GdkEventSelection Hierarquia do Objeto GdkEventSelection Direct subclasses None. Descrio Propriedades selection:

target: property: requestor: time: GdkEventSelection::selection Access: Read Only Type: GdkAtom GdkEventSelection::target Access: Read Only Type: GdkAtom GdkEventSelection::property Access: Read Only Type: GdkAtom GdkEventSelection::requestor

Access: Read Only Type: int GdkEventSelection::time Access: Read Only Type: int GdkEventVisibility Hierarquia do Objeto GdkEventVisibility Direct subclasses None. Descrio Propriedades state: GdkEventVisibility::state Access: Read Only Type: GdkVisibilityState GdkFont Structure holding font information. Hierarquia do Objeto GdkFont Direct subclasses None. Descrio A GdkFont is a data structure containing basic information about a font, in terms of its type, ascent and descent. There is no constructor, as the fonts available are provided by the system. The GdkFont structure simply allows a new font to be loaded and queried. To load a font, use gdk::font_load() . To load a fontset - a range of different fonts - use gdk::fontset_load() . Either function will return a single GdkFont.

Under win32 currently, all fonts are of the type GDK_FONT_FONTSET, regardless of the loading method. Mtodos extents() Returns an array of sizing information. measure() The drawn width of a text-string, measured in pixels. height() Returns the line height, measured in pixels. width() The logical width of a text string, measured in pixels. Propriedades type: Font or fontset type. ascent: Baseline to top of logical area. descent: Baseline to bottom of logical area. GdkFont::extents array extents(string text_string); extents() returns an array of five integers representing the left bearing, right bearing, width, ascent and descent of the string using the font, or the font itself, as appropriate. The left and right bearing are the distance from the drawing origin to the leftmost and rightmost extent of the drawn string respectively, measured in pixels. The width is the length of the current string, measured in pixels. This measurement supplies information regarding where to begin drawing the next string, if there is more than one. The returned integer may be greater or smaller than the value of the right bearing. The ascent and descent are the pixel measurements of the extents of the current string above and below the baseline. If you're working with unix, all the above should be correct. If you're using win32, the left bearing will always be 0, the right bearing will match the width, the ascent is actually the line-height + 1 pixel, and the descent is the descent + 1 pixel. Use GdkFont properties if you need the ascent and descent values under win32.

GdkFont::measure int measure(string text_string); The return from this method is the equivalent of the right bearing returned by extents() . It is the size in pixels of the width of the string, to the point where the final part of the final character in the string is drawn. If you need the logical width of the string - that is, to the point where the next character should be inserted - use width() instead. GdkFont::height int height(string text_string); The return value of height() is arrived at by summing the values of ascent and descent returned by extents() and relating to the current string. Under win32, this is a bogus value. Add the values returned by the GdkFont properties ascent and descent to get the value of the font's height. The value of the height is the line-height, given in pixels, and represents the logical space required by a line. If you are using this measurement to calculate the size of a text box, you will need to add 6 pixels to the total to allow for the borders of the text widget. GdkFont::width int width(string text_string); width() returns the logical width of the text string, measured in pixels. The logical width includes the area up to where the next character should be drawn. This method is completely broken in Windows, and will always return the right bearing measurement instead. GdkFont::type Access: Read Only Type: int The returned integer may have a value of 0, indicating that the font was loaded as a unique font, or of 1, indicating that the font was loaded as part of a fontset. See GdkFontType. Note that under win32 this property will always have a value of 1, as all fonts are loaded as fontsets in order to provide support for the wide characters used by the operating system. GdkFont::ascent

Access: Read Only Type: int The ascent is the distance between a font's baseline and the top of the logical space taken up by that font. Add this to the descent to obtain the full font height value in pixels. GdkFont::descent Access: Read Only Type: int The descent is the distance between a font's baseline and the bottom of the logical space taken up by that font. GdkGC A structure that contains graphics information. Hierarquia do Objeto GdkGC Direct subclasses None. Descrio A GdkGC is made up of a series of properties, each of which may or may not be set, that describe everything from color to font to line-width. It forms several of the underlying elements of the style property in widgets, and is used in GDK where GtkStyle would be used at GTK level. The GC part of GdkGC stands for graphics context, and every GDK drawing function requires one in much the same way that every GTK drawing function requires a style. The functions that allow the getting and setting of GdkGC properties are internalised in PHP-GTK. For the most part, we have writeable properties instead of these methods. Please note that there is no guarantee that all these properties will be supported by your operating system; win32's 'little black boxes' text issue is there because win32 does not support stippling, for example. There is no direct constructor for a GdkGC. To create one, you will need to use the GdkWindow method new_gc() and set the properties that you are interested in directly. Mtodos set_dashes()

Configures the appearance of dashed lines. Propriedades foreground: The foreground color. background: The background color. font: The loaded font. function: Bitwise description of the drawing function. fill: The style of the fill. tile: The pixmap used for tiling. stipple: The pixmap used for stippling. clip_mask: The clip mask bitmap. subwindow_mode: The way subwindows are treated. ts_x_origin: Tile or stipple's x origin. ts_y_origin: Tile or stipple's y origin. clip_x_origin: Clip mask's x origin. clip_y_origin: Clip mask's y origin. graphics_exposures: Whether expose events are generated during pixmap copies. line_width: The pixel width of a drawn line. line_style: The way a dashed line is drawn. cap_style: The way the end of a line is drawn.

join_style: The way line joins are drawn. GdkGC::set_dashes void set_dashes(int offset, array dash_list); GdkGC::foreground Access: Read Write Type: GdkColor This looks so straightforward, and isn't. GdkGC objects are so far down in the evolutionary scale that they don't have an associated colormap. If you try to apply color directly, any color will be returned as a muddy brown. The way around this is to borrow an existing GdkColormap and allocate a color from there. You can use gdk::colormap_get_system() to do this, or you can access the colormap in a GdkWindow. The syntax is: $gc->foreground = $colormap->alloc('red'); As with the GdkColor constructor, you could use '#FF0000' or 65535, 0, 0 in place of 'red', but not 1.0, 0.0. 0.0. GdkGC::background Access: Read Write Type: GdkColor It is not possible to apply a new or existing GdkColor to a GdkGC, because there is no colormap there for the color to reference. You will need to take an existing GdkColormap, either by using gdk::colormap_get_system() or by accessing the colormap property in the existing GdkWindow that most widgets have, and give it a handle. Then you do something like: $gc->background = $colormap->alloc('lime green'); and the color is allocated intelligently. The background color fills the areas not taken up by the foreground color, e.g. the gaps in a dashed line will take the background color. If you don't want this, just don't set this property. GdkGC::font Access: Read Write Type: GdkFont GdkGC::function Access: Read Write Type: GdkFunction

GdkGC::fill Access: Read Write Type: GdkFill GdkGC::tile Access: Read Write Type: GdkPixmap GdkGC::stipple Access: Read Write Type: GdkPixmap GdkGC::clip_mask Access: Read Write Type: GdkBitmap GdkGC::subwindow_mode Access: Read Write Type: GdkSubwindowMode GdkGC::ts_x_origin Access: Read Write Type: int GdkGC::ts_y_origin Access: Read Write Type: int GdkGC::clip_x_origin Access: Read Write Type: int GdkGC::clip_y_origin Access: Read Write Type: int GdkGC::graphics_exposures Access: Read Write Type: bool GdkGC::line_width Access: Read Write

Type: int GdkGC::line_style Access: Read Write Type: GdkLineStyle GdkGC::cap_style Access: Read Write Type: GdkCapStyle GdkGC::join_style Access: Read Write Type: GdkJoinStyle GdkPixmap Hierarquia do Objeto GdkPixmap Direct subclasses None. Descrio Construtor GdkPixmap (); -Mtodos new_gc() property_get() property_change() property_delete() GdkPixmap Construtor GdkPixmap (); GdkPixmap::new_gc

void new_gc(void); GdkPixmap::property_get void property_get(void); GdkPixmap::property_change void property_change(void); GdkPixmap::property_delete void property_delete(void); GdkVisual Hierarquia do Objeto GdkVisual Direct subclasses None. Descrio Propriedades type:

depth: byte_order: colormap_size: bits_per_rgb: red_mask: red_shift: red_prec: green_mask:

green_shift: green_prec: blue_mask: blue_shift: blue_prec: GdkVisual::type Access: Read Only Type: int GdkVisual::depth Access: Read Only Type: int GdkVisual::byte_order Access: Read Only Type: int GdkVisual::colormap_size Access: Read Only Type: int GdkVisual::bits_per_rgb Access: Read Only Type: int GdkVisual::red_mask Access: Read Only Type: int GdkVisual::red_shift Access: Read Only Type: int GdkVisual::red_prec Access: Read Only

Type: int GdkVisual::green_mask Access: Read Only Type: int GdkVisual::green_shift Access: Read Only Type: int GdkVisual::green_prec Access: Read Only Type: int GdkVisual::blue_mask Access: Read Only Type: int GdkVisual::blue_shift Access: Read Only Type: int GdkVisual::blue_prec Access: Read Only Type: int GdkWindow Underlying window class for every GtkWidget. Hierarquia do Objeto GdkWindow Direct subclasses None. Descrio A GdkWindow represents the underlying window class of any GtkWidget, resp. the onscreen display areas in the target window system which the widget covers. It can be accessed using the window property of the GtkWidget class. Mtodos

raise() Raises the window to the top of the z-order. lower() Lowers the window to the bottom of the Z-order. get_pointer() Returns an array of information about the mouse pointer. set_cursor() Sets the mouse cursor used in that window. new_gc() property_get() property_change() property_delete() set_icon() Sets the window icon. Propriedades width: The width of the window in pixels. height: The height of the window in pixels. x: The x coordinate of the window position relative to the parent. y: The y coordinate of the window position relative to the parent. colormap: pointer: Array with the current mouse cursor position. pointer_state: The current status of the mouse buttons. parent: Returns the parent GdkWindow.

toplevel: Returns the GdkWindow of the toplevel GtkWindow. children: Array of all direct children. type: Returns the type of the widget. depth: Returns the color depth in bits per pixel. xid: Returns the XWindow window id, but not on Windows. GdkWindow::raise void raise(void); Raises the window to the top of the Z-order (stacking order), so that other windows with the same parent window appear below the window. If the window is a toplevel, the window manager may choose to deny the request to move the window in the Z-order. Therefore, the raise() method only requests the restack, it does not guarantee it. GdkWindow::lower void lower(void); Lowers the window to the bottom of the Z-order (stacking order), so that other windows with the same parent window appear above the window. If the window is a toplevel, the window manager may choose to deny the request to move the window in the Z-order. Therefore, the lower() method only requests the restack, it does not guarantee it. Note that the show() method raises the window again, so don't call this method before calling the show() method to avoid duplication. GdkWindow::get_pointer array get_pointer(void); Returns an array of information about the mouse pointer. The first 2 values are the X and Y coordinates of the mouse pointer, and the third is the button pointer_state. GdkWindow::set_cursor void set_cursor([ GdkCursor cursor ]); Sets the mouse cursor used in that window. The parameter is omitted, the cursor is reset to the default pointer.

Exemplo 62. Setting the cursor $cursor = gdk::cursor_new(150); //GDK_WATCH $window = $mainWindow->window; //GdkWindow $window->set_cursor($cursor); GdkWindow::new_gc void new_gc(void); GdkWindow::property_get void property_get(void); GdkWindow::property_change void property_change(void); GdkWindow::property_delete void property_delete(void); void GdkWindow::set_icon void set_icon(GdkWindow window, GdkPixmap pixmap, GdkBitmap mask); Sets the window icon which can be shown by the window manager in the title or the task bar. This function does not work on Windows. list( $pixmap, $mask) = gdk::pixmap_create_from_xpm($window->window, null, 'win dow.xpm'); $gdkwindow = $window->window; $gdkwindow->set_icon( $gdkwindow, $pixmap, $mask); GdkWindow::width Access: Read Only Type: int The width of the window in pixels. GdkWindow::height Access: Read Only Type: int The height of the window in pixels. GdkWindow::x Access: Read Only Type: int

The x coordinate of the window position relative to parent. GdkWindow::y Access: Read Only Type: int The y coordinate of the window position relative to parent. GdkWindow::colormap Access: Read Only Type: GdkColormap GdkWindow::pointer Access: Read Only Type: array Array with the current mouse cursor position. pointer[0] contains the X and pointer[1] the Y position. GdkWindow::pointer_state Access: Read Only Type: int Returns the current status of the mouse buttons, so that you can determine if the left/middle/right button is being held. GdkWindow::parent Access: Read Only Type: GdkWindow Returns the parent GdkWindow. The highest window in the packing hierarchy will return itself as the parent. Note that even the GdkWindow of a GtkWindow has a parent. $gtk_window =& new GtkWindow(); $gdk_window = $gtk_window->window; var_dump( $gdk_window == $gdk_window->parent); The example output is false. GdkWindow::toplevel Access: Read Only Type: GdkWindow Returns the GdkWindow of the toplevel Widget, usually the GtkWindow. GdkWindow::children

Access: Read Only Type: array The array contains all direct widgets of this container which have been added with add() or another pack function. GdkWindow::type Access: Read Only Type: GdkWindowType Returns the GdkWindowType of the widget's GdkWindow. GdkWindow::depth Access: Read Only Type: int Returns the color depth in bits per pixel, e.g. 24. GdkWindow::xid Access: Read Only Type: int This property is not available on the Windows operating system. On *nix, it returns the XWindow window id. GDK Functions GDK functions not belonging to any class. gdk::atom_intern()

gdk::beep() Emits a sound. gdk::colormap_new() Creates a new GdkColormap. gdk::colormap_get_system() Returns the system colormap. gdk::colormap_get_system_size() Returns the size of the system colormap. gdk::color_parse() Creates a GdkColor from a color specification. gdk::cursor_new() Creates a new GdkCursor.

gdk::cursor_new_from_pixmap() Creates a new GdkCursor using a pixmap. gdk::drag_status() gdk::draw_arc() Draws an arc. gdk::draw_gray_image() gdk::draw_line() Draws a line. gdk::draw_pixmap() gdk::draw_point() gdk::draw_rectangle() Draws a rectangle. gdk::draw_rgb_32_image() gdk::draw_rgb_image() gdk::draw_rgb_image_dithalign() gdk::draw_string() Draws a string of text. gdk::draw_text() gdk::flush() gdk::font_load() Loads the given font. gdk::fontset_load() Loads a selection of fonts described as a fontset. gdk::get_display() Returns the name of the system. gdk::input_remove()

gdk::pixmap_colormap_create_from_xpm() gdk::pixmap_colormap_create_from_xpm_d() gdk::pixmap_create_from_xpm() Creates a GdkPixmap from an xpm file. gdk::pixmap_create_from_xpm_d() Creates a GdkPixmap from inline data. gdk::pointer_is_grabbed() gdk::rgb_gc_set_background() gdk::rgb_gc_set_foreground() gdk::rgb_get_cmap() gdk::rgb_get_visual() gdk::rgb_xpixel_from_rgb() gdk::screen_height() Returns screen height in pixels. gdk::screen_height_mm() Returns screen height in mm. gdk::screen_width() Returns screen width in pixels. gdk::screen_width_mm() Returns screen width in mm. gdk::threads_enter() gdk::threads_leave() gdk::visual_get_best() gdk::visual_get_best_with_both()

gdk::visual_get_best_with_depth() gdk::visual_get_best_with_type() gdk::visual_get_system() Returns the system visual. gdk::atom_intern GdkAtom gdk::atom_intern(string atom_name, [int only_if_exists = FALSE ]); gdk::beep void gdk::beep(void); This function causes a warning sound to be emitted. The precise nature of the sound is system and setup dependant. gdk::colormap_new GdkColormap gdk::colormap_new ( GdkVisual visual , bool allocate); gdk::colormap_get_system GdkColormap gdk::colormap_get_system (void); gdk::colormap_get_system_size int gdk::colormap_get_system_size(void); gdk::color_parse GdkColor gdk::color_parse(string color_spec); This function creates a new GdkColor structure and fills it according to the color named in the color_spec parameter. The string that is passed as the parameter can be the hex triplet version of the color, e.g. '#FF0000', or the equivalent color name linked in rgb.txt, e.g. 'red'. Win32 users will not be able to find that file, as it is compiled. There is a good rgb.txt reference page here. gdk::cursor_new GdkCursor gdk::cursor_new ( GdkCursorType cursor_type ); Creates a new cursor from one of the predefined cursor types. You can find an example at set_cursor() .

gdk::cursor_new_from_pixmap GdkCursor gdk::cursor_new_from_pixmap ( GdkPixmap source , GdkPixmap mask , GdkColor fg , GdkColor bg , int x, int y); This function creates a new cursor from a pixmap. After you have created the cursor, the set_cursor() has to be used on a widget's gdk window to make the cursor active. The cursor will be visible when the mouse hovers the widget on which it has been set. In Gtk 1.x, you can make monochrome cursors only. This means, that every color (except black and None) is converted to the fg or bg color. The x and y parameters are the hotspot coordinates with (0,0) describing the top left position. This function is working since PHP-Gtk 1.0.1 Exemplo 63. Using a new cursor <?php if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); } $window = &new GtkWindow(); $window->set_default_size(300, 300); $window->connect_object('destroy', array('gtk', 'main_quit')); $cursorpmp = array( "16 16 3 1", " c None", ". c white", "1 c black", " ", ".... . . ... ", ".111..1.1.111. ", ".1..1.1.1.1..1. ", ".111..111.111. ", ".1.. .1.1.1.. ", ".1. .1.1.1. ", " . . . ", " ... . ", " .111. .1. . . ", ".1... .1..1..1.", ".1. .. .1..1.1. ", ".1..11.111.11. ", ".1. .1..1..1.1. ", " .111. .11.1..1.", " ... .. . . ", ); $window->realize(); $gdkwin = $window->window;

list($pixmap, $mask) = gdk::pixmap_create_from_xpm_d($gdkwin, null, $cursorpmp) ; $colBlue = &new GdkColor( 'blue'); $style = new GtkStyle(); $cursor =gdk::cursor_new_from_pixmap($pixmap, $mask, $style->white, $colBlue, 1 , 1); $gdkwin->set_cursor($cursor); $window->show(); gtk::main(); ?> gdk::drag_status void gdk::drag_status( GdkDragContext context , GdkDragAction action , int time); gdk::draw_arc void gdk::draw_arc(GdkWindow drawable, GdkGC gc , int filled, int x, int y, int width, int height, int angle1, int angle2); gdk::draw_gray_image void gdk::draw_gray_image(GdkWindow drawable, GdkGC gc , int x, int y, int width, int height, GdkRgbDither dith , string buf, int rowstride); gdk::draw_line void gdk::draw_line(GdkWindow drawable, GdkGC gc , int x1, int y1, int x2, int y2); gdk::draw_pixmap void gdk::draw_pixmap(GdkWindow drawable, GdkGC gc , GdkWindow src, int xsrc, int ysrc, int xdest, int ydest, int width, int height); gdk::draw_point void gdk::draw_point(GdkWindow drawable, GdkGC gc , int x, int y); gdk::draw_rectangle void gdk::draw_rectangle(GdkWindow drawable, GdkGC gc , int filled, int x, int y, int width, int height); gdk::draw_rgb_32_image void gdk::draw_rgb_32_image(GdkWindow drawable, GdkGC gc , int x, int y, int width, int height, GdkRgbDither dith , string buf, int rowstride);

gdk::draw_rgb_image void gdk::draw_rgb_image(GdkWindow drawable, GdkGC gc , int x, int y, int width, int height, GdkRgbDither dith , string rgb_buf, int rowstride); gdk::draw_rgb_image_dithalign void gdk::draw_rgb_image_dithalign (GdkWindow drawable, GdkGC gc , int x, int y, int width, int height, GdkRgbDither dith , string rgb_buf, int rowstride, int xdith, int ydith); gdk::draw_string void gdk::draw_string(GdkWindow drawable, GdkFont font , GdkGC gc , int x, int y, string string); gdk::draw_text void gdk::draw_text(GdkWindow drawable, GdkFont font , GdkGC gc , int x, int y, string text, int text_length); gdk::flush void gdk::flush(void); gdk::font_load GdkFont gdk::font_load (string font_name); This method loads a font_name, which must be given in the form of an X Logical Font Description (XLFD). The XLFD is a way of describing a font that is completely system-independant. It contains 14 fields, most of which can be represented by a wildcard * in order to allow flexibility when a match is being sought - the exceptions are addedstyle, which doesn't need one, and registry, which is the only mandatory field. The description opens with a hyphen, -, and each field is also separated by a hyphen. If you need more information on fonts than is given here, the full XWindows definition is available online through the relevant XWindows documentation. foundry xxx (where the font was created. 'unknown' is okay) family xxx (e.g. Arial) weight xxx (e.g. bold, medium) slant x (r - roman, i = italic, o = oblique) setwidth xxx (e.g. normal, condensed) addedstyle xxx (e.g. serif, sans. Leave blank for none) pixelsize N (set either this or pointsize, not both) pointsize N (point size, e.g. 120) resx N (x res the font was created for, in dots per inch) resy N (y res the font was created for, in dots per inch)

space x (m = monospaced, p = proportional, c = cell) averagewidth N (average character width in pixels. 0 if unknown) registry xxx (e.g. utf, iso8859 or adobe) encoding xxx (e.g. 1 or 2 (for iso8859) or fontspecific) A typical font-load would look something like this: $font = gdk::font_load('-unknown-Arial-normal-r-normal--*-120-96-96-p-0-iso885 9-1'); Font information in the XLFD format can be retrieved from any system by utilising the GtkFontSelection or GtkFontSelectionDialog widgets. Note that there are sizing issues in GdkFont in the version of GTK+ currently used in PHP-GTK under win32. As a result, the point size should always be set in win32 - using the pixel size may give unexpected results. gdk::fontset_load GdkFont gdk::fontset_load (string fontset_name); This method is used when any of a range of fonts would be acceptable. Usually, that would be when internationalization is an issue. It could also be useful anywhere that some flexibility over the choice of font is needed. Load in exactly the same way as with gdk::font_load() , separating each of the potential fonts to be used with a comma. The system running the application will use the first font in the set that achieves a match. In win32, the fontset_load method is used internally regardless of whether this or gdk::font_load() is called. gdk::get_display string gdk::get_display(void); gdk::input_remove void gdk::input_remove(int tag); gdk::pixmap_colormap_create_from_xpm XXX gdk::pixmap_colormap_create_from_xpm (XXX); gdk::pixmap_colormap_create_from_xpm_d XXX gdk::pixmap_colormap_create_from_xpm_d (XXX); gdk::pixmap_create_from_xpm array gdk::pixmap_create_from_xpm (GdkWindow window , GdkColor transparent_color , string filename);

gdk::pixmap_create_from_xpm() returns a array consisting of a GdkPixmap and a GdkBitmap mask that has been created from the specified .xpm file. The GdkPixmap is the underlying structure that holds the image ready to be displayed in a GtkPixmap. In order to make that image appear on the screen, you will need to use one of the following constructs: <?php $gdkpixmap = gdk::pixmap_create_from_xpm($main_window->window, null, 'test.xpm'); $image = &new GtkPixmap($gdkpixmap[0], $gdkpixmap[1]); ?> or <?php list ($gdkpixmap, $mask) = gdk::pixmap_create_from_xpm($gdkwindow, $transparent_color, 'test.xpm'); $image = &new GtkPixmap($gdkpixmap, $mask); ?> The transparent_color determines what color the None pixels will get if you don't use the pixmask. See the tutorial for more details and some examples. gdk::pixmap_create_from_xpm_d array gdk::pixmap_create_from_xpm_d (GdkWindow window , GdkColor transparent_color , array data); gdk::pixmap_create_from_xpm() returns a array consisting of a GdkPixmap and a GdkBitmap mask that has been created from the specified pixmap data given by the array. The array has to have the same structure like the "normal" C-array in an xpm file. $gdkpixmap = gdk::pixmap_create_from_xpm_d($main_window->window, $transparent_color, $data); The transparent_color determines what color the None pixels will get if you don't use the pixmask. See the tutorial for more details and some examples. gdk::pointer_is_grabbed bool gdk::pointer_is_grabbed(void);

gdk::rgb_gc_set_background void gdk::rgb_gc_set_background( GdkGC gc , int rgb); gdk::rgb_gc_set_foreground void gdk::rgb_gc_set_foreground( GdkGC gc , int rgb); gdk::rgb_get_cmap GdkColormap gdk::rgb_get_cmap (void); gdk::rgb_get_visual GdkVisual gdk::rgb_get_visual (void); gdk::rgb_xpixel_from_rgb int gdk::rgb_xpixel_from_rgb(int rgb); gdk::screen_height int gdk::screen_height(void); This function returns the screen height in pixels. This can be used in size-setting methods to ensure that containers are sized relative to the screen resolution. gdk::screen_height_mm int gdk::screen_height_mm(void); This function returns the screen height in millimeters. This can be used in size-setting methods to ensure that containers are sized relative to the screen size being used. gdk::screen_width int gdk::screen_width(void); This function returns the screen width in pixels. This can be used in size-setting methods to ensure that containers are sized relative to the screen resolution. gdk::screen_width_mm int gdk::screen_width_mm(void); This function returns the screen width in millimeters. This can be used in size-setting methods to ensure that containers are sized relative to the screen size being used. gdk::threads_enter

void gdk::threads_enter(void); gdk::threads_leave void gdk::threads_leave(void); gdk::visual_get_best GdkVisual gdk::visual_get_best (void); gdk::visual_get_best_with_both GdkVisual gdk::visual_get_best_with_both (int depth, GdkVisualType visual_type ); gdk::visual_get_best_with_depth GdkVisual gdk::visual_get_best_with_depth (int depth); gdk::visual_get_best_with_type GdkVisual gdk::visual_get_best_with_type ( GdkVisualType visual_type ); gdk::visual_get_system GdkVisual gdk::visual_get_system (void); This function returns the GdkVisual that is currently used by the system. GTK Extra Classes GtkExtra is set of widget classes which fill gaps the original gtk classes left. It can be found at gtkextra.sourceforge.net ndice GtkSheet A spreadsheet widget for displaying and editing data in tables GtkSheet A spreadsheet widget for displaying and editing data in tables Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkSheet Direct subclasses

None. Descrio A spreadsheet widget for displaying and editing data in tables. It gives all the tools and the graphic interface to build applications that need an editable grid of cells. Construtor GetSheet (int rows, int cols, String title); -Mtodos add_column() Add a column at a specific position add_row() Add a row at a specific position attach() Attach a widget to a cell. button_attach() Attach a button??? cell_clear() Clear a cell (remove contents) cell_delete() Removes all the content from a cell cell_get_state() Get the cell state??? cell_get_text() Get the content of a cell change_entry() ??? columns_labels_set_visibility() Shows or hides the column labels columns_set_sensitivity() Sets the sensitivity of all columns - like col_set_sensitivity, but for all rows column_button_add_label() Add a label to the column title

column_button_justify() Sets the alignment of a column title column_label_set_visibility() Shows or hides a column title column_set_justification() Set the justification/alignment of a whole column column_set_sensitivity() Set the column sensivity. column_set_visibility() Shows or hides an entire column construct() ... construct_browser() ??? construct_with_custom_entry() ??? delete_columns() Delete columns from the sheet delete_rows() Delete rows from the sheet freeze() Freeze the widget. get_active_cell() Returns the position of the active cell get_columns_count() Get the number of columns defined in the GtkSheet get_entry() [perhaps] Returns the entry used for cell content insertion get_entry_widget() Returns the widget with which you enter the text in the cells get_rows_count() Get the number of rows defined in the GtkSheet get_state() Checks the state???? grid_visible() Checks if the grid is visible

hide_column_titles() Hide the column titles on the top hide_row_titles() Hide the row titles on the left side insert_columns() Insert a number of columns into the sheet insert_rows() Insert a number of columns into the sheet moveto() ??? move_child() ??? remove_link() ... rows_labels_set_visibility() Hides or shows all row titles rows_set_sensitivity() Sets the sensitivity of all rows. row_button_add_label() Add a label to the row title row_button_justify() Sets the alignment of a row title row_label_set_visibility() Shows or hides a row title row_set_sensitivity() Set the row sensivity. row_set_visibility() Shows or hides an entire row select_column() Select an entire column select_row() Select an entire row set_active_cell() Activate/select one cell set_background() Set the background color of the whole sheet

set_cell() Set the contents of a cell set_cell_text() Set the text of a cell set_column_title() Set the title of a column set_column_titles_height() Set the height of the column titles set_column_width() Set the width of a column set_grid() Set the color of the grid lines set_hadjustment() ... set_row_height() Set the height of a row set_row_title() Set the title of a row set_row_titles_width() Set the width of the row titles on the left set_selection_mode() Set the selection mode set_title() Set the title of the whole sheet set_vadjustment() ... show_column_titles() Make the column titles visible show_grid() Show or hide the grid show_row_titles() Show the row titles thaw() Continue updating the widget unclip_range() ...

unselect_range() Removes a selection on more than 1 cell leaving only 1 cell selected Sinais "select_row" "select_column" "select_range" "clip_range" "resize_range" "move_range" "deactivate" "activate" "set_cell" "clear_cell" "changed" "new_col_width" "new_row_height" "last_signal" GtkSheet Construtor GetSheet (int rows, int cols, String title); Default constructor; creates an GtkSheet object GtkSheet::add_column

add_column (int position); Add a column at a specific position GtkSheet::add_row add_row (int position); Add a row at a specific position GtkSheet::attach null attach(GtkWidget widget, int row, int column, double ??? perhaps offset, double ???); Attach a widget to a cell. GtkSheet::button_attach null button_attach(GtkWidget widget, int row, int column, double ??? perhaps offset, double ???); Attach a button??? GtkSheet::cell_clear null cell_clear(int row, int column); Clear a cell (remove contents) GtkSheet::cell_delete cell_delete (int row, int column); Removes all the content from a cell GtkSheet::cell_get_state int cell_get_state(int row, int column); Get the cell state??? GtkSheet::cell_get_text String cell_get_text(int row, int column); Get the content of a cell GtkSheet::change_entry change_entry (int ???); ??? GtkSheet::columns_labels_set_visibility columns_labels_set_visibility (boolean true - the column labels are shown); Shows or hides the column labels GtkSheet::columns_set_sensitivity columns_set_sensitivity (boolean If the columns shall be sensitive);

Sets the sensitivity of all columns - like col_set_sensitivity, but for all rows GtkSheet::column_button_add_label column_button_add_label (int column, String title); Add a label to the column title GtkSheet::column_button_justify column_button_justify (int row, int/String The style???); Sets the alignment of a column title GtkSheet::column_label_set_visibility column_label_set_visibility (int column, boolean visibility); Shows or hides a column title true - the title is shown GtkSheet::column_set_justification column_set_justification (int column, int/String style???); Set the justification/alignment of a whole column GtkSheet::column_set_sensitivity column_set_sensitivity (int column, boolean sensitivity); Set the column sensivity. If a column is insensitive, it can't be selected and the title of the column is greyed out. The cells in this column can still be edited. true - the column is sensitive, false - not sensitive GtkSheet::column_set_visibility column_set_visibility (int column, boolean visibility); Shows or hides an entire column GtkSheet::construct construct (int ???); ... GtkSheet::construct_browser construct_browser (int ???, int ???, String ???); ??? GtkSheet::construct_with_custom_entry construct_with_custom_entry (int ???, int ???, String ???, int ???);

??? GtkSheet::delete_columns delete_columns (int column_begin, int column_amount); Delete columns from the sheet GtkSheet::delete_rows delete_rows (int row_begin, int row_amount); Delete rows from the sheet GtkSheet::freeze freeze (void); Freeze the widget - it will stop updating the gui until you thaw it This is good for big content operations GtkSheet::get_active_cell Array get_active_cell(void); Returns the position of the active cell GtkSheet::get_columns_count int get_columns_count(void); Get the number of columns defined in the GtkSheet GtkSheet::get_entry GtkEntry get_entry(void); [perhaps] Returns the entry used for cell content insertion GtkSheet::get_entry_widget GtkEntry get_entry_widget(void); Returns the widget with which you enter the text in the cells GtkSheet::get_rows_count int get_rows_count(void); Get the number of rows defined in the GtkSheet GtkSheet::get_state int get_state(void); Checks the state???? GtkSheet::grid_visible boolean grid_visible(void); Checks if the grid is visible

GtkSheet::hide_column_titles null hide_column_titles(void); Hide the column titles on the top GtkSheet::hide_row_titles null hide_row_titles(void); Hide the row titles on the left side GtkSheet::insert_columns insert_columns (int column_begin, int column_amount); Insert a number of columns into the sheet GtkSheet::insert_rows insert_rows (int row_begin, int row_amount); Insert a number of columns into the sheet GtkSheet::moveto moveto (int row, int column, double ???, double ???); ??? GtkSheet::move_child move_child (GtkWidget widget, int row, int column); ??? GtkSheet::remove_link remove_link (int ???); ... GtkSheet::rows_labels_set_visibility rows_labels_set_visibility (boolean visibility); Hides or shows all row titles (true - show, false - hide) GtkSheet::rows_set_sensitivity rows_set_sensitivity (boolean sensitivity); Sets the sensitivity of all rows - like row_set_sensitivity, but for all rows GtkSheet::row_button_add_label row_button_add_label (int row, String title); Add a label to the row title GtkSheet::row_button_justify

row_button_justify (int row, int/String style???); Sets the alignment of a row title GtkSheet::row_label_set_visibility row_label_set_visibility (int row, boolean visibility); Shows or hides a row title (true - the title is shown, false - the title is hidden) GtkSheet::row_set_sensitivity row_set_sensitivity (int row, boolean sensitivity); Set the row sensivity. If a row is insensitive, it can't be selected and the title of the row is greyed out. The cells in this row can still be edited. true - the row is sensitive, false - the row is insensitive GtkSheet::row_set_visibility row_set_visibility (int row, boolean visibility); Shows or hides an entire row true - the row is visible, false - the row is hidden GtkSheet::select_column select_column (int column); Select an entire column GtkSheet::select_row select_row (int row); Select an entire row GtkSheet::set_active_cell boolean set_active_cell(int row, int column); Activate/select one cell GtkSheet::set_background set_background (GdkColor bg_color); Set the background color of the whole sheet (but not the headers) GtkSheet::set_cell set_cell (int row, int column, int/String style???, String text); Set the contents of a cell GtkSheet::set_cell_text

set_cell_text (int row, int column, String text); Set the text of a cell GtkSheet::set_column_title set_column_title (int column, String text); Set the title of a column GtkSheet::set_column_titles_height set_column_titles_height (int height); Set the height of the column titles GtkSheet::set_column_width set_column_width (int column, int width); Set the width of a column (in pixels) GtkSheet::set_grid set_grid (GdkColor color); Set the color of the grid lines GtkSheet::set_hadjustment set_hadjustment (GtkAdjustment ???); ... GtkSheet::set_row_height set_row_height (int row, int height); Set the height of a row (in pixels) GtkSheet::set_row_title set_row_title (int row, String text); Set the title of a row GtkSheet::set_row_titles_width set_row_titles_width (int width); Set the width of the row titles on the left GtkSheet::set_selection_mode set_selection_mode (int mode); Set the selection mode GtkSheet::set_title set_title (String text); Set the title of the whole sheet GtkSheet::set_vadjustment

set_vadjustment (GtkAdjustment ???); ... GtkSheet::show_column_titles show_column_titles (void); Make the column titles visible if they were hidden with hide_column_titles GtkSheet::show_grid show_grid (boolean visibility); Show or hide the grid (true - show, false - hide) GtkSheet::show_row_titles show_row_titles (void); Show the row titles if they were hidden with hide_row_titles GtkSheet::thaw thaw (void); Let the GtkSheet continue updating the widget GUI if it was frozen with freeze GtkSheet::unclip_range unclip_range (int ???); ... GtkSheet::unselect_range unselect_range (void); Removes a selection on more than 1 cell leaving only 1 cell selected select_row Funo Callback void callback(GtkWidget widget); select_column Funo Callback void callback(GtkWidget widget); select_range Funo Callback void callback(GtkWidget widget);

clip_range Funo Callback void callback(GtkWidget widget); resize_range Funo Callback void callback(GtkWidget widget); move_range Funo Callback void callback(GtkWidget widget); deactivate Funo Callback void callback(GtkWidget widget); activate Funo Callback void callback(GtkWidget widget); set_cell Funo Callback void callback(GtkWidget widget); clear_cell Funo Callback void callback(GtkWidget widget); changed Funo Callback void callback(GtkWidget widget); new_col_width Funo Callback void callback(GtkWidget widget);

new_row_height Funo Callback void callback(GtkWidget widget); last_signal Funo Callback void callback(GtkWidget widget); GTK Enums Os valores enumerados podem ser qualquer um dos valores listados. Flags podem ser uma combinao de qualquer um dos valores listados. Ambos enums e as flags tem um valor nmero e uma chave que pode ser entendida pelo ser humano. ndice GtkAccelFlags GtkAnchorType GtkArrowType GtkAttachOptions GtkButtonAction GtkButtonBoxStyle GtkCalendarDisplayOptions GtkCellType GtkCornerType GtkCTreeExpanderStyle GtkCTreeExpansionType GtkCTreeLineStyle GtkCurveType GtkDestDefaults GtkDirectionType GtkFontFilterType GtkFontType GtkJustification GtkObjectFlags GtkOrientation GtkPackerOptions GtkPackType GtkPolicyType GtkPositionType GtkPreviewType GtkProgressBarOrientation GtkProgressBarStyle GtkReliefStyle GtkResizeMode GtkScrollType GtkSelectionMode GtkShadowType GtkSideType

GtkSortType GtkSpinButtonUpdatePolicy GtkSpinType GtkStateType GtkSubmenuPlacement GtkToolbarChildType GtkToolbarSpaceStyle GtkToolbarStyle GtkTreeViewMode GtkUpdateType GtkVisibility GtkWidgetFlags GtkWindowPosition GtkWindowType GtkAccelFlags Flags Valor Nome simblico Descrio 0 GTK_ACCEL_VISIBLE Denotes that the accelerator key along with any associated modifiers should be displayed to the right of any text in a GtkAccelLabel. Note that this will always be displayed as upper case, whereas a lower case key value is actually being returned. Use a shift modifier if this is likely to cause a problem for your users. (See also: GdkModifierTypes.) 1 GTK_ACCEL_SIGNAL_VISIBLE This flag does not work, and has been eliminated completely in later versions of GTK+. Use GTK_ACCEL_MASK to achieve the desired effect. 2 GTK_ACCEL_LOCKED Denotes that the accelerator entry is locked. However, this does not seem to work everywhere in the current version of GTK+. Call the GtkWidget method lock_accelerators() on the target widget - usually a GtkMenuItem - in order to ensure accelerator entry locking. 3 GTK_ACCEL_MASK Returns full information for a GtkAccelGroupEntry (the individual element in a GtkAccelGroup array), displaying any modifiers, the accelerator key and the name of the associated signal to the right of any existing GtkAccelLabel text. GtkAnchorType Enums Valor Nome simblico Descrio

0 GTK_ANCHOR_CENTER 1 GTK_ANCHOR_NORTH 2 GTK_ANCHOR_NORTH_WEST 3 GTK_ANCHOR_NORTH_EAST 4 GTK_ANCHOR_SOUTH 5 GTK_ANCHOR_SOUTH_WEST 6 GTK_ANCHOR_SOUTH_EAST 7 GTK_ANCHOR_WEST 8 GTK_ANCHOR_EAST 9 GTK_ANCHOR_N 10 GTK_ANCHOR_NW 11 GTK_ANCHOR_NE 12 GTK_ANCHOR_S 13 GTK_ANCHOR_SW 14 GTK_ANCHOR_SE 15 GTK_ANCHOR_W 16 GTK_ANCHOR_E GtkArrowType Enums Valor Nome simblico Descrio 0 GTK_ARROW_UP The arrow points up. 1 GTK_ARROW_DOWN The arrow points down. 2 GTK_ARROW_LEFT The arrow points to the left. 3 GTK_ARROW_RIGHT The arrow points to the right. GtkAttachOptions Flags Valor Nome simblico Descrio 0 GTK_EXPAND The child's allocated area will expand proportionately when the parent container is resized. 1 GTK_SHRINK The child will shrink to the dimensions of its size request regardless of the size of the parent or its allocated area. 2 GTK_FILL The child will expand to fill its allocated area. GtkButtonAction Enums Valor

Nome simblico Descrio 0 GTK_BUTTON_IGNORED Denotes that an instance of GtkCList will ignore mouse button events. 1 GTK_BUTTON_SELECTS Denotes that an instance of GtkCList will react to select mouse events. 2 GTK_BUTTON_DRAGS Denotes that an instance of GtkCList will react to drag mouse button events. 3 GTK_BUTTON_EXPANDS Denotes that an instance of GtkCList will react to expand mouse button events. GtkButtonBoxStyle Enums Valor Nome simblico Descrio 0 GTK_BUTTONBOX_DEFAULT_STYLE The current default style for button arrangement, which can be reset. The default setting is GTK_BUTTONBOX_EDGE. 1 GTK_BUTTONBOX_SPREAD Specifies that the buttons should be spaced evenly across the area of the buttonbox, with a full-sized space at either edge of the column or row. 2 GTK_BUTTONBOX_EDGE Specifies that the buttons should be spaced evenly across the area of the buttonbox, with no space at either edge of the column or row. 3 GTK_BUTTONBOX_START Specifies that the buttons should be packed from the top or left edge of the buttonbox, and spaced according to their spacing and internal padding settings. 4 GTK_BUTTONBOX_END Specifies that the buttons should be packed from the bottom or right edge of the buttonbox, and spaced according to their spacing and internal padding settings. GtkCalendarDisplayOptions Flags GtkCalendarDisplayOptions flags can only ever be set from within a GtkCalendar object. Valor Nome simblico Descrio 0 GTK_CALENDAR_SHOW_HEADING Specifies that the month and year should

be displayed. 1 GTK_CALENDAR_SHOW_DAY_NAMES Specifies that three letter day descriptions should be present. 2 GTK_CALENDAR_NO_MONTH_CHANGE Prevents the user from switching months with the calendar. 3 GTK_CALENDAR_SHOW_WEEK_NUMBERS Displays each week numbers of the current year, down the left side of the calendar 4 GTK_CALENDAR_WEEK_START_MONDAY Starts the calendar week on Monday, instead of the default Sunday GtkCellType Enums Valor Nome simblico Descrio 0 GTK_CELL_EMPTY Denotes that a cell of an instance of GtkCList should not contain anything. 1 GTK_CELL_TEXT Denotes a cell of an instance of GtkCList should contain text. 2 GTK_CELL_PIXMAP Denotes a cell of an instance of GtkCList should contain a pixel map. 3 GTK_CELL_PIXTEXT Denotes a cell of an instance of GtkCList should contain text and a pixelmap. 4 GTK_CELL_WIDGET Support for a GtkClist containing a widget has not been completed in GTK+, therefore it is not currently available in PHP-GTK itself. GtkCornerType Enums Valor Nome simblico Descrio 0 GTK_CORNER_TOP_LEFT The child is above and to the left of the scrollbars, so that the scrollbars are placed to the right and bottom of it. This is the default behaviour. 1 GTK_CORNER_BOTTOM_LEFT The child is below and to the left of the scrollbars, so that the scrollbars are placed at the right and top of the window. 2 GTK_CORNER_TOP_RIGHT The child is above and to the right of the scrollbars, i.e. the scrollbars are positioned at the left and bottom of the window. 3 GTK_CORNER_BOTTOM_RIGHT The child is below and to the right of the scrollbars, so that the scrollbars are displayed at the left and top of the window.

GtkCTreeExpanderStyle Enums Valor Nome simblico Descrio 0 GTK_CTREE_EXPANDER_NONE Denotes that this instance of the GtkCTree should have no visible expanders. 1 GTK_CTREE_EXPANDER_SQUARE Denotes that this instance of the GtkCTree should have square expanders. 2 GTK_CTREE_EXPANDER_TRIANGLE Denotes that this instance of the GtkCTree should have triangular expanders. 3 GTK_CTREE_EXPANDER_CIRCULAR Denotes that this instance of the GtkCTree should have circular expanders. GtkCTreeExpansionType Enums Valor Nome simblico Descrio 0 GTK_CTREE_EXPANSION_EXPAND Tells PHP-GTK to expand the current node of this instance of GtkCTree. 1 GTK_CTREE_EXPANSION_EXPAND_RECURSIVE Tells PHP-GTK to expand the current node, and all nodes below it in this instance of the GtkCTree class. 2 GTK_CTREE_EXPANSION_COLLAPSE Tells PHP-GTK to collapse the current node of this instance of GtkCTree. 3 GTK_CTREE_EXPANSION_COLLAPSE_RECURSIVE Tells PHP-GTK to collapse the current node, and all nodes below it in this instance of the GtkCTree class. 4 GTK_CTREE_EXPANSION_TOGGLE Tells PHP-GTK to toggle the current node of this instance of GtkCTree, this will cause an expanded node to collapse and a collapsed node to expand. 5 GTK_CTREE_EXPANSION_TOGGLE_RECURSIVE Tells PHP-GTK to toggle the current node, and all nodes below it in this instance of the GtkCTree class, this will cause an expanded node to collapse and a collapsed node to expand. GtkCTreeLineStyle Enums Valor

Nome simblico Descrio 0 GTK_CTREE_LINES_NONE Denotes there should be no lines between the nodes on this instance of GtkCTree. 1 GTK_CTREE_LINES_SOLID Denotes that the lines between the nodes in this instance of GtkCTree should be solid. 2 GTK_CTREE_LINES_DOTTED Denotes that the lines between the nodes in this instance of GtkCTree should be dotted lines. 3 GTK_CTREE_LINES_TABBED Denotes that the lines between the nodes in this instance of GtkCTree should be tabs rather than lines. GtkCurveType Enums Valor Nome simblico Descrio 0 GTK_CURVE_TYPE_LINEAR 1 GTK_CURVE_TYPE_SPLINE 2 GTK_CURVE_TYPE_FREE GtkDestDefaults Enums Valor Nome simblico Descrio 0 GTK_DEST_DEFAULT_MOTION 1 GTK_DEST_DEFAULT_HIGHLIGHT 2 GTK_DEST_DEFAULT_DROP 3 GTK_DEST_DEFAULT_ALL GtkDirectionType Enums Valor Nome simblico Descrio 0 GTK_DIR_TAB_FORWARD Intended to tab forward through the children capable of having focus, starting at the left or top. This option

appears not to work in the versions of GTK+ used in PHP-GTK, and has been completely rewritten for GTK 2. 1 GTK_DIR_TAB_BACKWARD Intended to tab backward through the children with focus capability, starting at the right or bottom. This option appears not to work in the versions of GTK+ used in PHP-GTK, and has been completely rewritten for GTK 2. 2 GTK_DIR_UP Sets initial focus on the child nearest the bottom of the container. 3 GTK_DIR_DOWN Sets initial focus on the child nearest the top of the container. 4 GTK_DIR_LEFT Sets initial focus on the child nearest the right edge of the container. 5 GTK_DIR_RIGHT Sets initial focus on the child nearest the left edge of the container. GtkFontFilterType Enums Valor Nome simblico Descrio 0 GTK_FONT_FILTER_BASE Tells PHP-GTK not to allow the user to change the filter via the Filters page of the GtkFontSelection class. 1 GTK_FONT_FILTER_USER Tells PHP-GTK to allow the user to change the filter via the Filters page of the GtkFontSelection class. GtkFontType Enums Valor Nome simblico Descrio 0 GTK_FONT_BITMAP Instructs PHP-GTK to show bitmap fonts when calling GtkFontSelection:: set_filter or GtkFontSelectionDialog:: set_filter. 1 GTK_FONT_SCALABLE Instructs PHP-GTK to show scaleable fonts when calling GtkFontSelection:: set_filter or GtkFontSelectionDialog:: set_filter. 2 GTK_FONT_SCALABLE_BITMAP Instructs PHP-GTK to show scaleable bitmap fonts when calling GtkFontSelection:: set_filter or GtkFontSelectionDialog:: set_filter. 3 GTK_FONT_ALL Instructs PHP-GTK to show any font that matches any of the above flags when calling GtkFontSelection:: set_filter or GtkFontSelectionDialog:: set_filter. GtkJustification

Enums Valor Nome simblico Descrio 0 GTK_JUSTIFY_LEFT Left-justifies text within the containing area. 1 GTK_JUSTIFY_RIGHT Right-justifies text within the containing area. 2 GTK_JUSTIFY_CENTER Centers text within the containing area. 3 GTK_JUSTIFY_FILL Justifies text from edge to edge of the containing area. GtkObjectFlags Flags Valor Nome simblico Descrio 0 GTK_DESTROYED The object has been destroyed and is processing any shutdown callbacks required. 1 GTK_FLOATING The object is not contained within another object. 2 GTK_CONNECTED There are signals which are connected to this object. 3 GTK_CONSTRUCTED The object has undergone its construction process and is ready to be used. GtkOrientation Enums Valor Nome simblico Descrio 0 GTK_ORIENTATION_HORIZONTAL 1 GTK_ORIENTATION_VERTICAL GtkPackerOptions Flags Valor Nome simblico

Descrio 0 GTK_PACK_EXPAND 1 GTK_FILL_X 2 GTK_FILL_Y GtkPackType Flags Valor Nome simblico Descrio 0 GTK_PACK_START Specifies that the packing should be done from top or left of the container widget. 1 GTK_PACK_END Specifies that the packing should be done from the bottom or right of the container widget. GtkPolicyType Enums Valor Nome simblico Descrio 0 GTK_POLICY_ALWAYS The scrollbar is always on display. 1 GTK_POLICY_AUTOMATIC The scrollbar is shown only when it is needed. For instance, a GtkText may alter in size according to the amount of text displayed in it. The scrollbar will not be present when the text widget is empty, but will become apparent when the size of the text exceeds the size of the displayable page. 2 GTK_POLICY_NEVER The scrollbar is never shown. GtkPositionType Enums Valor Nome simblico Descrio 0 GTK_POS_LEFT The feature is at the left edge. 1 GTK_POS_RIGHT The feature is at the right edge. 2 GTK_POS_TOP The feature is at the top edge. 3 GTK_POS_BOTTOM The feature is at the bottom edge.

GtkPreviewType Enums Valor Nome simblico Descrio 0 GTK_PREVIEW_COLOR 1 GTK_PREVIEW_GRAYSCALE GtkProgressBarOrientation Enums Valor Nome simblico Descrio 0 GTK_PROGRESS_LEFT_TO_RIGHT A horizontal progress bar growing from left to right. 1 GTK_PROGRESS_RIGHT_TO_LEFT A horizontal progress bar growing from right to left. 2 GTK_PROGRESS_BOTTOM_TO_TOP A vertical progress bar growing from bottom to top. 3 GTK_PROGRESS_TOP_TO_BOTTOM A vertical progress bar growing from top to bottom. GtkProgressBarStyle Enums Valor Nome simblico Descrio 0 GTK_PROGRESS_CONTINUOUS The progress bar grows in a smooth, continuous manner. 1 GTK_PROGRESS_DISCRETE The progress bar grows in discrete, visible blocks. GtkReliefStyle Enums Valor Nome simblico

Descrio 0 GTK_RELIEF_NORMAL The default relief style for a button. 1 GTK_RELIEF_HALF Sets the shadow around the button to GTK_SHADOW_OUT until the button is pressed, and GTK_SHADOW_IN when it is. This is currently the normal relief style for a button. 2 GTK_RELIEF_NONE Sets the shadow around the button to GTK_SHADOW_NONE except when the cursor enters the area of the button, meaning that only the contents (e.g. the label) of the button show until that point. GtkResizeMode Enums Valor Nome simblico Descrio 0 GTK_RESIZE_PARENT Default setting. Effectively shares the behaviour described in GTK_RESIZE_QUEUE. Only used when writing an original container widget. 1 GTK_RESIZE_QUEUE Adds any resize requests from a container widget to a queue of resize requests marked GTK_RESIZE_PENDING. 2 GTK_RESIZE_IMMEDIATE Immediately resets the private flags on a container to GTK_RESIZE_NEEDED, giving the request priority over any (standard) queued resize requests. GtkScrollType Enums Valor Nome simblico Descrio 0 GTK_SCROLL_NONE The default setting. Indicates that the scrollbar's slider is not moved. 1 GTK_SCROLL_STEP_BACKWARD Sets the scrollbar's slider back one step increment from its current position. The value of the step increment is taken from the underlying GtkAdjustment in the scrollbar. 2 GTK_SCROLL_STEP_FORWARD Sets the scrollbar's slider forward one step increment from its current position. The value of the step increment is taken from the underlying GtkAdjustment in the scrollbar. 3 GTK_SCROLL_PAGE_BACKWARD Sets the scrollbar's slider back one page increment from its current position. The value of the page increment is taken from the underlying GtkAdjustment in the scrollbar. 4 GTK_SCROLL_PAGE_FORWARD Sets the scrollbar's slider forward one page increment from its current position. The value of the page

increment is taken from the underlying GtkAdjustment in the scrollbar. 5 GTK_SCROLL_JUMP Sets the scrollbar's slider to the position described in the accompanying float parameter. The range of values are 0 to 1, with the halfway point being 0.5. GtkSelectionMode Enums Used in: * GtkCList::set_selection_mode() Valor Nome simblico Descrio 0 GTK_SELECTION_SINGLE Only one item can be selected at any given moment. Other items can have focus, but will not be marked as selected. 1 GTK_SELECTION_BROWSE Only one item can be selected at any given moment. Any item currently having focus will be marked as selected. 2 GTK_SELECTION_MULTIPLE Several items may be selected or unselected with a click or using the spacebar. They cannot be selected or unselected in any other way. Note that multiple selection should only be used where all items share the exact same callback routine. 3 GTK_SELECTION_EXTENDED Several items may be selected or unselected using drag, or the shift (selects all items from the leader to the current focus) or control (selects the item having current focus) keys. Note that extended selection should only be used where all items share the exact same callback routine. GtkShadowType Enums Valor Nome simblico Descrio 0 GTK_SHADOW_NONE No shadow is displayed, resulting in a two-dimensional appearance. 1 GTK_SHADOW_IN Displays dark shadow on left and upper sides of the widget, resulting in the appearance of the widget being lower than its surrounding area. 2 GTK_SHADOW_OUT Displays dark shadow on right and lower sides of the widget, resulting in the illusion that the widget is raised above its surrounding area. 3 GTK_SHADOW_ETCHED_IN Displays the appearance of sunken detail. 4 GTK_SHADOW_ETCHED_OUT Displays the appearance of raised detail.

GtkSideType Enums Valor Nome simblico Descrio 0 GTK_SIDE_TOP 1 GTK_SIDE_BOTTOM 2 GTK_SIDE_LEFT 3 GTK_SIDE_RIGHT GtkSortType Enums Used in: * GtkCList::set_sort_type() Valor Nome simblico Descrio 0 GTK_SORT_ASCENDING Lowest value first: 1, 2, 3 1 GTK_SORT_DESCENDING Highest value first: 3, 2, 1 GtkSpinButtonUpdatePolicy Enums Valor Nome simblico Descrio 0 GTK_UPDATE_ALWAYS Always updates the spinbutton value. If an entry is invalid, the value is updated to the lower or upper bound as appropriate. 1 GTK_UPDATE_IF_VALID Prevents the spinbutton's current value from being altered where an entry is invalid. GtkSpinType Enums Valor Nome simblico

Descrio 0 GTK_SPIN_STEP_FORWARD Spins forward by the value set in the underlying step_increment. This value can be overridden by setting the increment parameter to a value above 0.0. 1 GTK_SPIN_STEP_BACKWARD Spins backward by the value set in the underlying step_increment. This value can be overridden by setting the increment parameter to a value above 0.0. 2 GTK_SPIN_PAGE_FORWARD Spins forward by the value set as page_increment in the underlying GtkAdjustment. The value set in the increment parameter is ignored. 3 GTK_SPIN_PAGE_BACKWARD Spins backward by the value set as page_increment in the underlying GtkAdjustment. The value set in the increment parameter is ignored. 4 GTK_SPIN_HOME Spins to value set as lower bound. The value set in the increment parameter is ignored. 5 GTK_SPIN_END Spins to value set as upper bound. The value set in the increment parameter is ignored. 6 GTK_SPIN_USER_DEFINED Used where the amount of spin is not defined anywhere in the underlying GtkAdjustment. Negative or positive values set in the increment parameter are used to indicate the direction of the spin. GtkStateType Enums Valor Nome simblico Descrio 0 GTK_STATE_NORMAL Default state. 1 GTK_STATE_ACTIVE Denotes that the widget is currently active, e.g. that a button is in the process of being clicked. 2 GTK_STATE_PRELIGHT Denotes that the area of the widget has been entered by the cursor. 3 GTK_STATE_SELECTED Denotes that the widget is currently selected. 4 GTK_STATE_INSENSITIVE Denotes that the widget cannot react to user input. GtkSubmenuPlacement Enums Valor Nome simblico Descrio 0 GTK_TOP_BOTTOM

1 GTK_LEFT_RIGHT GtkToolbarChildType Enums Valor Nome simblico Descrio 0 GTK_TOOLBAR_CHILD_SPACE Just a space in the style of the toolbar's GtkToolbarSpaceStyle. 1 GTK_TOOLBAR_CHILD_BUTTON A GtkButton. 2 GTK_TOOLBAR_CHILD_TOGGLEBUTTON A GtkToggleButton. 3 GTK_TOOLBAR_CHILD_RADIOBUTTON A GtkRadioButton, 4 GTK_TOOLBAR_CHILD_WIDGET Tells that you want to insert an existing widget. GtkToolbarSpaceStyle Enums Valor Nome simblico Descrio 0 GTK_TOOLBAR_SPACE_EMPTY 1 GTK_TOOLBAR_SPACE_LINE GtkToolbarStyle Enums Valor Nome simblico Descrio 0 GTK_TOOLBAR_ICONS 1 GTK_TOOLBAR_TEXT 2 GTK_TOOLBAR_BOTH GtkTreeViewMode Enums Valor Nome simblico

Descrio 0 GTK_TREE_VIEW_LINE Entire item, including children, is highlighted when selected. 1 GTK_TREE_VIEW_ITEM Only item, not children, is highlighted when selected. GtkUpdateType Enums Valor Nome simblico Descrio 0 GTK_UPDATE_CONTINUOUS The value of the adjustment is updated while slider is in motion. 1 GTK_UPDATE_DISCONTINUOUS The value of the adjustment is updated only when the user releases the mouse and the slider drag operation is finished. 2 GTK_UPDATE_DELAYED The value of the adjustment is updated shortly after the slider has stopped moving, but not necessarily after the slider drag operation has finished. GtkVisibility Enums Valor Nome simblico Descrio 0 GTK_VISIBILITY_NONE 1 GTK_VISIBILITY_PARTIAL 2 GTK_VISIBILITY_FULL GtkWidgetFlags Flags Valor Nome simblico Descrio 0 GTK_TOPLEVEL Marks a widget as toplevel. This would generally be used internally by GTK. 1 GTK_NO_WINDOW Marks a widget as having no GDK window. This would

generally be used internally by GTK, and indicates that the widget is unable to capture GDK events. See also: GtkEventBox. 2 GTK_REALIZED Marks a widget as having been realized, that is, having its GdkWindow instantiated. 3 GTK_MAPPED Marks a widget as having been mapped to the screen. In order to be mapped, a widget must have the GTK_VISIBLE flag set. See also: realize() , map() , show() . 4 GTK_VISIBLE Marks a widget as visible. This is necessary before the widget can be mapped onto the screen. 5 GTK_SENSITIVE Marks a widget as able to react to user input. 6 GTK_PARENT_SENSITIVE Marks the parent of a widget as able to react to user input. 7 GTK_CAN_FOCUS Marks a widget as able to have focus. 8 GTK_HAS_FOCUS Gives a widget focus. 9 GTK_CAN_DEFAULT Marks a widget as able to have default status. This also has the effect of drawing the widget with enough space around it to display its default style. 10 GTK_HAS_DEFAULT Gives a widget default status. The widget will respond directly to keyboard events, and will be drawn in such a way as to make this apparent to the user. 11 GTK_HAS_GRAB Mostly used internally, to ensure that the widget currently having focus is able to grab events relevant to it. Note that flagging a widget in this way requires that the widget is also flagged as sensitive and has its reference count increased. Flagging the widget does not in itself have any bearing on the widget's relationship with other widgets; if you want modality, use GtkWindow's set_modal() method or the static function gtk::grab_add() as appropriate. 12 GTK_RC_STYLE 13 GTK_COMPOSITE_CHILD 14 GTK_NO_REPARENT 15 GTK_APP_PAINTABLE 16 GTK_RECEIVES_DEFAULT A widget flagged in this way will receive the default action and have GTK_HAS_DEFAULT set when it is focused, even if there is a different widget set as default. GtkWindowPosition Enums Valor Nome simblico Descrio 0 GTK_WIN_POS_NONE Default state. This setting uses the default window gravity on the underlying windowing system to determine the position of the window. This generally results in the window being mapped from the top left corner of the screen. 1 GTK_WIN_POS_CENTER Places the window over the center of the screen. 2 GTK_WIN_POS_MOUSE Draws the window at the point of the mouse cursor. This is useful for popup menus or similar widgets initiated by

a mouse-click. 3 GTK_WIN_POS_CENTER_ALWAYS Places the window over the center of the screen and keeps those co-ordinates stored in memory, so that a redraw following a move elsewhere will reposition the window at the center. GtkWindowType Enums Valor Nome simblico Descrio 0 GTK_WINDOW_TOPLEVEL The default window type, describing a toplevel window with a title bar, minimize, maximize and close buttons. Note that these window decorations are provided by the window manager and may vary in appearance or even not exist on some operating systems. 1 GTK_WINDOW_DIALOG A window type that is intended for messages requiring a user response. If a maximize button is displayed, it is greyed out and the maximize function disabled on a dialog window. 2 GTK_WINDOW_POPUP A window type with no window decorations or associated functions. Do not use this to create popup menus; refer instead to the popup() method in GtkMenu, which provides its own internal popup window. GDK Enums Os valores enumerados podem ser qualquer um dos valores listados. Flags podem ser uma combinao de qualquer um dos valores listados. Ambos enums e as flags tem um valor nmero e uma chave que pode ser entendida pelo ser humano. ndice GdkCapStyle GdkCursorType GdkDragAction GdkEventMask GdkEventType GdkFill GdkFontType GdkFunction GdkInputCondition GdkInputSource GdkJoinStyle GdkLineStyle GdkModifierType GdkRgbDither GdkSubwindowMode GdkVisibilityState GdkVisualType GdkWindowType

GdkCapStyle Enums Valor Nome simblico Descrio 0 GDK_CAP_NOT_LAST 1 GDK_CAP_BUTT 2 GDK_CAP_ROUND 3 GDK_CAP_PROJECTING GdkCursorType Enums The cursor type determines which symbol is used for the mouse pointer. Default is an arrow pointing to the upper left. Valor Nome simblico Descrio -1 GDK_CURSOR_IS_PIXMAP The cursor is self-created from pixmap. 0 GDK_X_CURSOR A fat black line from the upper left to the lower right, and a fat black line lower left to upper right 2 GDK_ARROW Arrow pointing to the upper right. 4 GDK_BASED_ARROW_DOWN 6 GDK_BASED_ARROW_UP 8 GDK_BOAT 10 GDK_BOGOSITY 12 GDK_BOTTOM_LEFT_CORNER Cursor indicating the lower left corner. 14 GDK_BOTTOM_RIGHT_CORNER Cursor indicating the lower right corner. 16 GDK_BOTTOM_SIDE Cursor indicating the lower edge. 18 GDK_BOTTOM_TEE 20 GDK_BOX_SPIRAL 22 GDK_CENTER_PTR 24 GDK_CIRCLE 26 GDK_CLOCK 28 GDK_COFFEE_MUG 30 GDK_CROSS 32 GDK_CROSS_REVERSE 34 GDK_CROSSHAIR 36 GDK_DIAMOND_CROSS 38 GDK_DOT 40 GDK_DOTBOX 42 GDK_DOUBLE_ARROW For resizing a horizontal edge (up-down). 44 GDK_DRAFT_LARGE

46 GDK_DRAFT_SMALL 48 GDK_DRAPED_BOX 50 GDK_EXCHANGE Reload symbol 52 GDK_FLEUR Move symbol 54 GDK_GOBBLER A bird 56 GDK_GUMBY 58 GDK_HAND1 Hand pointing to the upper right. 60 GDK_HAND2 Hand pointing to the upper left. 62 GDK_HEART A heart. 64 GDK_ICON 66 GDK_IRON_CROSS 68 GDK_LEFT_PTR Normal pointer to the upper left. 70 GDK_LEFT_SIDE Cursor indicating the left edge. 72 GDK_LEFT_TEE 74 GDK_LEFTBUTTON Three-button mouse with left button activated. 76 GDK_LL_ANGLE 78 GDK_LR_ANGLE 80 GDK_MAN 82 GDK_MIDDLEBUTTON Three-button mouse with middle button activated. 84 GDK_MOUSE The upper half of a mouse. 86 GDK_PENCIL A pencil. 88 GDK_PIRATE The pirate sign (skull with crossed bones). 90 GDK_PLUS Just a plus. 92 GDK_QUESTION_ARROW Question cursor; mostly used for "What's this?" functions. 94 GDK_RIGHT_PTR Normal cursor pointing to the upper right. 96 GDK_RIGHT_SIDE Cursor indicating the right edge. 98 GDK_RIGHT_TEE 100 GDK_RIGHTBUTTON Three-button mouse with right button activated. 102 GDK_RTL_LOGO 104 GDK_SAILBOAT Sailing boat. 106 GDK_SB_DOWN_ARROW 108 GDK_SB_H_DOUBLE_ARROW 110 GDK_SB_LEFT_ARROW 112 GDK_SB_RIGHT_ARROW 114 GDK_SB_UP_ARROW 116 GDK_SB_V_DOUBLE_ARROW 118 GDK_SHUTTLE Space shuttle. 120 GDK_SIZING 122 GDK_SPIDER Spider... 124 GDK_SPRAYCAN Spraying can, useful for drawing programs. 126 GDK_STAR Star with 5 corners. 128 GDK_TARGET 130 GDK_TCROSS Thin cross. 132 GDK_TOP_LEFT_ARROW Arrow pointing to the upper left. 134 GDK_TOP_LEFT_CORNER Cursor indicating the upper left corner. 136 GDK_TOP_RIGHT_CORNER Cursor indicating the upper right corner. 138 GDK_TOP_SIDE Cursor indicating the upper edge. 140 GDK_TOP_TEE 142 GDK_TREK Star Trek ship NCC 1701-A 144 GDK_UL_ANGLE 146 GDK_UMBRELLA An umbrella symbol. 148 GDK_UR_ANGLE 150 GDK_WATCH A watch for the wrist.

152 GDK_XTERM Caret symbol (text input) GdkDragAction Enums Valor Nome simblico Descrio 0 GDK_ACTION_DEFAULT 1 GDK_ACTION_COPY 2 GDK_ACTION_MOVE 3 GDK_ACTION_LINK 4 GDK_ACTION_PRIVATE 5 GDK_ACTION_ASK GdkEventMask Flags Valor Nome simblico Descrio 0 GDK_EXPOSURE_MASK Setting this flag allows the GDK_EXPOSE event to be captured by a widget's GdkWindow. This causes the widget to emit the "expose-event" signal. 1 GDK_POINTER_MOTION_MASK Setting this flag allows the GDK_MOTION_NOTIFY event to be captured by a widget's GdkWindow. This makes the widget emit the "motion-notify-event" signal. 2 GDK_POINTER_MOTION_HINT_MASK This is a special flag allowing a less intensive version of the GDK_POINTER_MOTION_MASK functionality. This can be necessary to avoid a time-lag in processing caused by the sheer volume of GDK_MOTION_NOTIFY events produced by mouse movement, each once of which causes a "motion-notify-event" signal to be fired by the widget. 3 GDK_BUTTON_MOTION_MASK Allows the GDK_MOTION_NOTIFY events to be picked up by the widget's GdkWindow only while a mouse-button (any) is pressed down. This is a way of limiting the widget's "motion-notify-event" signal emissions. 4 GDK_BUTTON1_MOTION_MASK Allows the GDK_MOTION_NOTIFY events to be picked up by the widget's GdkWindow only while mouse-button 1 is pressed down - usually that's the left button. This is a way of limiting the widget's "motion-notify-event" signal emissions. 5 GDK_BUTTON2_MOTION_MASK Allows the GDK_MOTION_NOTIFY events to be picked up by the widget's GdkWindow only while mouse-button 2 is pressed down - usually that's the center button, where it exists. This is a way of limiting the widget's "motion-notify-event" signal emissions.

6 GDK_BUTTON3_MOTION_MASK Allows the GDK_MOTION_NOTIFY events to be picked up by the widget's GdkWindow only while mouse-button 3 is pressed down - usually that's the right button. This is a way of limiting the widget's "motion-notify-event" signal emissions. 7 GDK_BUTTON_PRESS_MASK Setting this flag allows the GDK_BUTTON_PRESS events to be captured by a widget's GdkWindow. This makes the widget emit the "button-press-event" signal. 8 GDK_BUTTON_RELEASE_MASK Setting this flag allows the GDK_BUTTON_RELEASE event to be captured by a widget's GdkWindow. This makes the widget emit the "button-release-event" signal. 9 GDK_KEY_PRESS_MASK Setting this flag allows the GDK_KEY_PRESS event to be captured by a widget's GdkWindow. This makes the widget emit the "key-press-event" signal. 10 GDK_KEY_RELEASE_MASK Setting this flag allows the GDK_KEY_RELEASE event to be captured by a widget's GdkWindow. This makes the widget emit the "key-release-event" signal. 11 GDK_ENTER_NOTIFY_MASK Setting this flag allows the GDK_ENTER_NOTIFY event to be captured by a widget's GdkWindow. This causes the widget to emit the "enter-notify-event" signal. 12 GDK_LEAVE_NOTIFY_MASK Setting this flag allows the GDK_LEAVE_NOTIFY event to be captured by a widget's GdkWindow. This makes the widget emit the "leave-notify-event" signal. 13 GDK_FOCUS_CHANGE_MASK Setting this flag allows the GDK_FOCUS_CHANGE event to be captured by a widget's GdkWindow. This makes the widget emit the "focus-in-event" or "focus-out-event" signal as appropriate. 14 GDK_STRUCTURE_MASK This flag is set on all new instances of GdkWindow. It allows map, unmap, destroy and configure events to be captured, causing "map-event", "unmap-event", "destroy-event" and "configure-event" signals to be emitted from all windowed widgets. 15 GDK_PROPERTY_CHANGE_MASK Setting this flag allows the GDK_PROPERTY_NOTIFY event to be captured by a widget's GdkWindow. This makes the widget emit the "property-notify-event" signal. 16 GDK_VISIBILITY_NOTIFY_MASK Setting this flag allows the GDK_VISIBILITY_NOTIFY event to be captured by a widget's GdkWindow. This causes the widget to emit the "visibility-notify-event" signal. 17 GDK_PROXIMITY_IN_MASK Setting this flag allows the GDK_PROXIMITY_IN event to be captured by a widget's GdkWindow. This causes the widget to emit the "proximity-in-event" signal. 18 GDK_PROXIMITY_OUT_MASK Setting this flag allows the GDK_PROXIMITY_OUT event to be captured by a widget's GdkWindow. This makes the widget emit the "proximity-out-event" signal. 19 GDK_SUBSTRUCTURE_MASK Enables the widget's GdkWindow to capture GDK_STRUCTURE_MASK events on any child windows. 20 GDK_ALL_EVENTS_MASK Setting this flag allows any GdkEvent to be captured by a widget's GdkWindow. GdkEventType Enums Valor Nome simblico

Descrio -1 GDK_NOTHING A null event. 0 GDK_DELETE This event is triggered when the user clicks on the X button on a decorated window. 1 GDK_DESTROY This event is triggered when a widget is being destroyed. 2 GDK_EXPOSE This event is triggered whenever a widget is exposed to display. That includes all redraws, full or partial. 3 GDK_MOTION_NOTIFY This event is triggered when the mouse is moved. 4 GDK_BUTTON_PRESS This event is triggered when any mouse button is pressed. 5 GDK_2BUTTON_PRESS This event is triggered when there are two mouse button presses in quick succession - a double-click. It is preceded by a second GDK_BUTTON_PRESS and that event's corollary, a GDK_BUTTON_RELEASE. 6 GDK_3BUTTON_PRESS This event is triggered when there are three mouse button presses in quick succession - a treble-click. It is preceded by two GDK_BUTTON_PRESS and one GDK_2BUTTON_PRESS event, as well as the associated GDK_BUTTON_RELEASE events. 7 GDK_BUTTON_RELEASE This event is triggered when any mouse button is released. 8 GDK_KEY_PRESS This event is triggered when any key is pressed. 9 GDK_KEY_RELEASE This event is triggered when any key is released. 10 GDK_ENTER_NOTIFY This event is triggered when the cursor enters the screen area of a widget. 11 GDK_LEAVE_NOTIFY This event is triggered when the cursor leaves the screen area of a widget. 12 GDK_FOCUS_CHANGE This event is triggered whenever there is a keyboard focus change, in or out. 13 GDK_CONFIGURE This event is triggered whenever a widget is drawn, that is, at its first display and on any subsequent redraws caused by moving or resizing. 14 GDK_MAP This event is triggered during the show() process, while the widget is being mapped to the screen. 15 GDK_UNMAP This event is triggered during the hide() process, while the widget is being removed from display. 16 GDK_PROPERTY_NOTIFY 17 GDK_SELECTION_CLEAR 18 GDK_SELECTION_REQUEST 19 GDK_SELECTION_NOTIFY 20 GDK_PROXIMITY_IN 21 GDK_PROXIMITY_OUT 22 GDK_DRAG_ENTER 23 GDK_DRAG_LEAVE 24 GDK_DRAG_MOTION 25 GDK_DRAG_STATUS 26 GDK_DROP_START 27 GDK_DROP_FINISHED 28 GDK_CLIENT_EVENT 29 GDK_VISIBILITY_NOTIFY 30 GDK_NO_EXPOSE

GdkFill Enums Valor Nome simblico Descrio 0 GDK_SOLID 1 GDK_TILED 2 GDK_STIPPLED 3 GDK_OPAQUE_STIPPLED GdkFontType Enums Valor Nome simblico Descrio 0 GDK_FONT_FONT An internal constuct denoting that a single font has been loaded into a GdkFont structure. 1 GDK_FONT_FONTSET An internal construct denoting that several alternate fonts have been loaded into a GdkFont structure. In win32, all GdkFont type queries will return this type. GdkFunction Enums Valor Nome simblico Descrio 0 GDK_COPY 1 GDK_INVERT 2 GDK_XOR 3 GDK_CLEAR 4 GDK_AND 5 GDK_AND_REVERSE 6 GDK_AND_INVERT 7 GDK_NOOP 8 GDK_OR 9 GDK_INVERT 10 GDK_XOR 11 GDK_EQUIV 12 GDK_OR_REVERSE

13 GDK_COPY_INVERT 14 GDK_OR_INVERT 15 GDK_NAND 16 GDK_SET GdkInputCondition Enums Valor Nome simblico Descrio 0 GDK_INPUT_READ 1 GDK_INPUT_WRITE 2 GDK_INPUT_EXCEPTION GdkInputSource Enums Valor Nome simblico Descrio 0 GDK_SOURCE_MOUSE 1 GDK_SOURCE_PEN 2 GDK_SOURCE_ERASER 3 GDK_SOURCE_CURSOR GdkJoinStyle Enums Valor Nome simblico Descrio 0 GDK_JOIN_MITER 1 GDK_JOIN_ROUND 2 GDK_JOIN_BEVEL GdkLineStyle Enums Valor

Nome simblico Descrio 0 GDK_LINE_SOLID 1 GDK_LINE_ON_OFF_DASH 2 GDK_LINE_DOUBLE_DASH GdkModifierType Flags Valor Nome simblico Descrio 0 GDK_SHIFT_MASK Denotes that a shift modifier is in place. A dedicated key or mouse-button will not become active until the Shift key is pressed down. 1 GDK_LOCK_MASK Denotes that a Caps Lock modifier is in place. Note that this modifier is illegal for use with accelerator keys, and will not work there. 2 GDK_CONTROL_MASK Denotes that a control modifier is in place. A dedicated key or mouse-button will not become active until the Control key is pressed down. 3 GDK_MOD1_MASK Denotes that an alt modifier is in place. A dedicated key or mouse-button will not become active until the Alt key is pressed down. 4 GDK_MOD2_MASK 5 GDK_MOD3_MASK 6 GDK_MOD4_MASK 7 GDK_MOD5_MASK 8 GDK_BUTTON1_MASK The first (mostly left) mouse button. 9 GDK_BUTTON2_MASK The second (middle) mouse button. 10 GDK_BUTTON3_MASK The third (mostly right) mouse button. 11 GDK_BUTTON4_MASK Mouse wheel up. 12 GDK_BUTTON5_MASK Mouse wheel down. 13 GDK_RELEASE_MASK Denotes that the act of releasing the button is a modifier. 14 GDK_MODIFIER_MASK Returns all the modifiers that are possible in the current context. GdkRgbDither Enums Valor Nome simblico Descrio

0 GDK_RGB_DITHER_NONE 1 GDK_RGB_DITHER_NORMAL 2 GDK_RGB_DITHER_MAX GdkSubwindowMode Enums Valor Nome simblico Descrio 0 GDK_CLIP_BY_CHILDREN 1 GDK_INCLUDE_INFERIORS GdkVisibilityState Enums Valor Nome simblico Descrio 0 GDK_VISIBILITY_UNOBSCURED 1 GDK_VISIBILITY_PARTIAL 2 GDK_VISIBILITY_FULLY_OBSCURED GdkVisualType Enums Valor Nome simblico Descrio 0 GDK_VISUAL_STATIC_GRAY 1 GDK_VISUAL_GRAYSCALE 2 GDK_VISUAL_STATIC_COLOR 3 GDK_VISUAL_PSEUDO_COLOR 4 GDK_VISUAL_TRUE_COLOR 5 GDK_VISUAL_DIRECT_COLOR GdkWindowType Enums Identifies the type of a GdkWindow

Used by the type property of GdkWindow. Valor Nome simblico Descrio 0 GDK_WINDOW_ROOT The root gdk window of a GtkWindow's GdkWindow. 1 GDK_WINDOW_TOPLEVEL A toplevel GdkWindow, e.g. of a GtkWindow. 2 GDK_WINDOW_CHILD 3 GDK_WINDOW_DIALOG 4 GDK_WINDOW_TEMP 5 GDK_WINDOW_PIXMAP 6 GDK_WINDOW_FOREIGN GtkExtra Enums Enumerated values for the GtkExtra classes ndice GtkPlotEnums GtkPlotScale GtkPlotSymbolType GtkPlotSymbolStyle GtkPlotBorderStyle GtkPlotLineStyle GtkPlotConnector GtkPlotLabelPos GtkPlotError GtkPlotOrientation GtkPlotAxisPos GtkPlotLabelStyle GtkPlotTicksPos GtkPlotCanvas GtkPlotCanvasAction GtkPlotCanvasFlag GtkPlotCanvasArrow GtkPlotCanvasSelection GtkPlotCanvasSelectionMode GtkPlotCanvasType GtkPlotCanvasPos GtkSheetAttrType GtkSheetEnums GtkPlotEnums Enums Valor Nome simblico

Descrio 0 GTK_PLOT_GRADIENT_H 1 GTK_PLOT_GRADIENT_V 2 GTK_PLOT_GRADIENT_S GtkPlotScale Enums Valor Nome simblico Descrio 0 GTK_PLOT_SCALE_LINEAR 1 GTK_PLOT_SCALE_LOG10 GtkPlotSymbolType Enums Valor Nome simblico Descrio 0 GTK_PLOT_SYMBOL_NONE 1 GTK_PLOT_SYMBOL_SQUARE 2 GTK_PLOT_SYMBOL_CIRCLE 3 GTK_PLOT_SYMBOL_UP_TRIANGLE 4 GTK_PLOT_SYMBOL_DOWN_TRIANGLE 5 GTK_PLOT_SYMBOL_RIGHT_TRIANGLE 6 GTK_PLOT_SYMBOL_LEFT_TRIANGLE 7 GTK_PLOT_SYMBOL_DIAMOND 8 GTK_PLOT_SYMBOL_PLUS 9 GTK_PLOT_SYMBOL_CROSS 10 GTK_PLOT_SYMBOL_STAR 11 GTK_PLOT_SYMBOL_DOT 12 GTK_PLOT_SYMBOL_IMPULSE GtkPlotSymbolStyle Enums Valor Nome simblico Descrio 0 GTK_PLOT_SYMBOL_EMPTY

1 GTK_PLOT_SYMBOL_FILLED 2 GTK_PLOT_SYMBOL_OPAQUE GtkPlotBorderStyle Enums Valor Nome simblico Descrio 0 GTK_PLOT_BORDER_NONE 1 GTK_PLOT_BORDER_LINE 2 GTK_PLOT_BORDER_SHADOW GtkPlotLineStyle Enums Valor Nome simblico Descrio 0 GTK_PLOT_LINE_NONE 1 GTK_PLOT_LINE_SOLID 2 GTK_PLOT_LINE_DOTTED 3 GTK_PLOT_LINE_DASHED 4 GTK_PLOT_LINE_DOT_DASH 5 GTK_PLOT_LINE_DOT_DOT_DASH 6 GTK_PLOT_LINE_DOT_DASH_DASH GtkPlotConnector Enums Valor Nome simblico Descrio 0 GTK_PLOT_CONNECT_NONE 1 GTK_PLOT_CONNECT_STRAIGHT 2 GTK_PLOT_CONNECT_SPLINE 3 GTK_PLOT_CONNECT_HV_STEP 4 GTK_PLOT_CONNECT_VH_STEP 5 GTK_PLOT_CONNECT_MIDDLE_STEP GtkPlotLabelPos

Enums Valor Nome simblico Descrio 0 GTK_PLOT_LABEL_NONE 1 GTK_PLOT_LABEL_IN 2 GTK_PLOT_LABEL_OUT GtkPlotError Enums Valor Nome simblico Descrio 0 GTK_PLOT_ERROR_DIV_ZERO GtkPlotOrientation Enums Valor Nome simblico Descrio 0 GTK_PLOT_AXIS_X 1 GTK_PLOT_AXIS_Y 2 GTK_PLOT_AXIS_Z GtkPlotAxisPos Enums Valor Nome simblico Descrio 0 GTK_PLOT_AXIS_LEFT 1 GTK_PLOT_AXIS_RIGHT 2 GTK_PLOT_AXIS_TOP 3 GTK_PLOT_AXIS_BOTTOM GtkPlotLabelStyle

Enums Valor Nome simblico Descrio 0 GTK_PLOT_LABEL_FLOAT 1 GTK_PLOT_LABEL_EXP 2 GTK_PLOT_LABEL_POW GtkPlotTicksPos Enums Valor Nome simblico Descrio 0 GTK_PLOT_TICKS_NONE 1 GTK_PLOT_TICKS_IN 2 GTK_PLOT_TICKS_OUT GtkPlotCanvas Enums Valor Nome simblico Descrio 0 GTK_PLOT_CANVAS_CAN_SELECT 1 GTK_PLOT_CANVAS_CAN_SELECT_ITEM 2 GTK_PLOT_CANVAS_CAN_SELECT_POINT 3 GTK_PLOT_CANVAS_CAN_DND 4 GTK_PLOT_CANVAS_CAN_DND_POINT GtkPlotCanvasAction Enums Valor Nome simblico Descrio 0 GTK_PLOT_CANVAS_ACTION_INACTIVE

1 GTK_PLOT_CANVAS_ACTION_SELECTION 2 GTK_PLOT_CANVAS_ACTION_DRAG 3 GTK_PLOT_CANVAS_ACTION_RESIZE GtkPlotCanvasFlag Enums Valor Nome simblico Descrio 0 GTK_PLOT_CANVAS_FROZEN 1 GTK_PLOT_CANVAS_CAN_MOVE 2 GTK_PLOT_CANVAS_CAN_X_RESIZE 3 GTK_PLOT_CANVAS_CAN_Y_RESIZE GtkPlotCanvasArrow Enums Valor Nome simblico Descrio 0 GTK_PLOT_ARROW_NONE 1 GTK_PLOT_ARROW_ORIGIN 2 GTK_PLOT_ARROW_END GtkPlotCanvasSelection Enums Valor Nome simblico Descrio 0 GTK_PLOT_CANVAS_SELECT_NONE 1 GTK_PLOT_CANVAS_SELECT_MARKERS 2 GTK_PLOT_CANVAS_SELECT_TARGET GtkPlotCanvasSelectionMode Enums Valor Nome simblico

Descrio 0 GTK_PLOT_CANVAS_SELECT_CLICK_1 1 GTK_PLOT_CANVAS_SELECT_CLICK_2 GtkPlotCanvasType Enums Valor Nome simblico Descrio 0 GTK_PLOT_CANVAS_NONE 1 GTK_PLOT_CANVAS_PLOT 2 GTK_PLOT_CANVAS_AXIS 3 GTK_PLOT_CANVAS_LEGENDS 4 GTK_PLOT_CANVAS_TITLE 5 GTK_PLOT_CANVAS_TEXT 6 GTK_PLOT_CANVAS_DATA 7 GTK_PLOT_CANVAS_LINE 8 GTK_PLOT_CANVAS_RECTANGLE 9 GTK_PLOT_CANVAS_ELLIPSE 10 GTK_PLOT_CANVAS_PIXMAP 11 GTK_PLOT_CANVAS_MARKER 12 GTK_PLOT_CANVAS_CUSTOM GtkPlotCanvasPos Enums Valor Nome simblico Descrio 0 GTK_PLOT_CANVAS_OUT 1 GTK_PLOT_CANVAS_IN 2 GTK_PLOT_CANVAS_LEFT 3 GTK_PLOT_CANVAS_RIGHT 4 GTK_PLOT_CANVAS_TOP 5 GTK_PLOT_CANVAS_BOTTOM 6 GTK_PLOT_CANVAS_TOP_LEFT 7 GTK_PLOT_CANVAS_TOP_RIGHT 8 GTK_PLOT_CANVAS_BOTTOM_LEFT 9 GTK_PLOT_CANVAS_BOTTOM_RIGHT GtkSheetAttrType Enums

Valor Nome simblico Descrio 0 GTK_SHEET_FOREGROUND 1 GTK_SHEET_BACKGROUND 2 GTK_SHEET_FONT 3 GTK_SHEET_JUSTIFICATION 4 GTK_SHEET_BORDER 5 GTK_SHEET_BORDER_COLOR 6 GTK_SHEET_IS_EDITABLE 7 GTK_SHEET_IS_VISIBLE GtkSheetEnums Enums Valor Nome simblico Descrio 0 GTK_SHEET_IS_LOCKED 1 GTK_SHEET_IS_FROZEN 2 GTK_SHEET_IN_XDRAG 3 GTK_SHEET_IN_YDRAG 4 GTK_SHEET_IN_DRAG 5 GTK_SHEET_IN_SELECTION 6 GTK_SHEET_IN_RESIZE 7 GTK_SHEET_IN_CLIP 8 GTK_SHEET_ROW_FROZEN 9 GTK_SHEET_COLUMN_FROZEN 10 GTK_SHEET_AUTORESIZE 11 GTK_SHEET_CLIP_TEXT 12 GTK_SHEET_ROW_TITLES_VISIBLE 13 GTK_SHEET_COL_TITLES_VISIBLE 14 GTK_SHEET_AUTO_SCROLL 15 GTK_SHEET_JUSTIFY_ENTRY Classes do Glade A Classe Glade ndice GladeXML Loading XML GUI definition files on the fly Misc Glade Functions Prefix the functions with "libglade::".

GladeXML Loading XML GUI definition files on the fly Hierarquia do Objeto GtkObject `-- GtkData `-- GladeXML Direct subclasses None. Descrio Glade is a user interface builder for Gtk. With it you can create your the surface of your applications in a WYSIWYG manner withouth having to worry about commands like add() , pack_start() and pack_end() . Glade has the ability to generate source code which creates the whole interface - but only for C, C++ and Ada95. Another way of using the interfaces created with glade is to load the .glade files dynamically from the application with the GladeXML class, and PHP-Gtk supports this. When using glade in your PHP-Gtk applications, you have at least 2 files: * Your .phpw application with the php code * A .glade file which contains the user interface definition When starting the program, the glade class is used to load the full contents (if you designed the full UI in glade) or only a part of the user interface (if you e.g. created just the menus with glade) from the .glade file. After loading, the widgets behave the same as if they were created the "normal" way. Single widgets can be accessed with the get_widget() functions. Signals which can be assigned directly in Glade can be connected automatically with signal_autoconnect() . The original glade application can be found at glade.gnome.org and a windows port at wingtk.sourceforge.net. There is also a tool called AppWizard which creates the php framework from .glade files so that you can concentrate on implementing the real application functions. PHP-Gtk 1.x supports glade 1 files only. This means you can not use Glade2 for user interface creation but Glade1. Construtor

GladeXML (string fname, [string root = NULL, [string domain = NULL]]); -- Creates a new GladeXML instance. Mtodos get_widget() Returns the widget with the given name. get_widget_by_long_name() Returns the widget specified by the given path. signal_connect() Connects all signals with the given handler to a callback function. signal_connect_object() Connects all signals with the given handler to a callback function. signal_autoconnect() Connects all signal handlers to functions. signal_autoconnect_object() Connects all signal handlers to functions. relative_file() Creates an absolute filename from a relative one. GladeXML Construtor GladeXML (string fname, [string root = NULL, [string domain = NULL]]); Creates a new instance of the glade class, based on a glade file fname. If you want to load the whole glade file, you can omit the root parameter. For loading only a part of the file, e.g. the menu definition, you can pass the name of the wished root element. In the example we could use "btnClose" to load the close button only. If the button had subwidgets, they would be loaded as well. When using the GNU Gettext module for internationalization, you can specifiy the gettext domain as third parameter. Glade will translate all the properties marked with "translatable" via the gettext functions on this domain. The following two files result in a sample application which loads the glade file and connect the button's "clicked" signal to exit the application. You don't need to call the show() and realize() functions as glade takes care of this. Exemplo 64. Basic application which loads a glade file <?php

if( !extension_loaded('gtk')) { dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); } $glade =& new GladeXML( dirname( __FILE__) . "/hellowg.glade"); $dlgHello = $glade->get_widget( 'dlgHellow'); $dlgHello->connect_object( 'destroy', array( 'gtk', 'main_quit')); $btnClose = $glade->get_widget( 'btnClose'); $btnClose->connect_object( 'clicked', array( 'gtk', 'main_quit')); gtk::main(); ?> Exemplo 65. Basic glade file "hellowg.glade" <?xml version="1.0"?> <GTK-Interface> <project> <name>example-gladexml.constructor</name> <program_name>example-gladexml.constructor</program_name> <directory></directory> <source_directory>src</source_directory> <pixmaps_directory>pixmaps</pixmaps_directory> <language>C</language> <gnome_support>False</gnome_support> <gettext_support>False</gettext_support> </project> <widget> <class>GtkWindow</class> <name>dlgHellow</name> <title>Hello World!</title> <type>GTK_WINDOW_TOPLEVEL</type> <position>GTK_WIN_POS_NONE</position> <modal>False</modal> <allow_shrink>False</allow_shrink> <allow_grow>True</allow_grow> <auto_shrink>False</auto_shrink> <widget> <class>GtkVBox</class> <name>vbox1</name> <homogeneous>False</homogeneous> <spacing>0</spacing> <widget> <class>GtkLabel</class> <name>lblHello</name> <label>Hello world! This is the example program for the GladeXML class</label> <justify>GTK_JUSTIFY_CENTER</justify>

<wrap>False</wrap> <xalign>0.5</xalign> <yalign>0.5</yalign> <xpad>0</xpad> <ypad>0</ypad> <child> <padding>0</padding> <expand>True</expand> <fill>True</fill> </child> </widget> <widget> <class>GtkButton</class> <name>btnClose</name> <can_focus>True</can_focus> <signal> <name>clicked</name> <handler>test</handler> <last_modification_time>Sun, 29 Aug 2004 10:33:10 GMT</last_modificatio n_time> </signal> <label>Close this window</label> <relief>GTK_RELIEF_NORMAL</relief> <child> <padding>0</padding> <expand>False</expand> <fill>False</fill> </child> </widget> </widget> </widget> </GTK-Interface> When defining more than one window in the glade file, all windows are shown when loading it. You can set the "Visible" property in glade to avoid this. A small explanation of the code above: The glade code was automatically created with glade. The instantiation of the glade requires the filename as first parameter, and we use dirname( __FILE__) . '/hellow.glade' to make sure the glade file is loaded from the same location where the php script is located. If you would pass the filename without the parameter to the glade constructor, the glade file wouldn't be found if the program is run in a working directory which is not the directory of the php script. To let the application exit tidily, we connect the "destroy" signal of the window as normal; but before we get the widget via the get_widget() function. GladeXML::get_widget GtkWidget get_widget(string name);

Returns the widget with the given name, so that it can be accessed as if it were constructed directly. In the example, you would just have to pass "btnClose" to get the close button. The function returns NULL if the widget does not exist. The counterpart to this function is get_widget_name(). GladeXML::get_widget_by_long_name GtkWidget get_widget_by_long_name(string path); Returns the widget specified by the given path, so that it can be accessed normally. Other than with get_widget() you don't pass the name but the full path with all parent widget names, separated by periods. In the example you get the close button with "dlgHellow.vbox1.btnClose". The function returns NULL if the widget does not exist. The counterpart to this function is get_widget_long_name(). GladeXML::signal_connect void signal_connect(string handler, mixed callback, [mixed user_param]); Connects all signals with the given handler to a callback function. In glade, you can "connect" signals to "handlers". These handlers can be named like functions but not necessarily have to be: When using this signal_connect() function you can connect the handler "clicker" to a function called "test". When using signal_autoconnect() this is not possible as glade connects only handlers to functions of the same name as the handler. Try to extend the example with the following (after glade instantiation and before gtk_main): function tester() { echo 'test' . "\r\n"; } $glade->signal_connect( 'test', 'tester'); If you click the close button now, you will see an "test" output line in the shell prompt. If you want to connect to a function of an object, you should use the following construct: $glade->signal_connect( 'test', array( $obj, 'function')); which would cause the 'function' function of the $obj object to be used as the callback for the test handler. Instead of an object you can use a normal string; this means the static function of this class

is called: $glade->signal_connect( 'test', array( 'gtk', 'main_quit')); This would be the same as a call of gtk::main_quit(). You can pass any type and number of additional parameters to the callback function. Note that the first parameter will be the calling widget. GladeXML::signal_connect_object void signal_connect_object(string handler, mixed callback, [mixed user_param]); Connects all signals with the given handler to a callback function. Other than signal_connect() the calling widget will not be passed as the first parameter (just omitted). GladeXML::signal_autoconnect void signal_autoconnect([array handlers]); Connects all signal handlers defined in the glade file to functions with the same name as the signal handler. In the example, the "clicked" signal of the close button would be connected to a function called "test" if it exists in the source. Try to extend the example with the following (after glade instantiation and before gtk_main): function test() { echo 'test' . "\r\n"; } $glade->signal_autoconnect(); If you click the close button now, you will see an "test" output line in the shell prompt. The first parameter passed to the callback will be the calling widget. The handlers parameter can be used to define a whole signal-callback structure and connect them with one call. The array itself contains key-value pairs with the keys being the handlers defined in the glade file (see signal_connect() for an explanation of handlers). The values itself have also to be arrays. This subarrays contain (mostly one) a number of callbacks. Exemplo 66. Using the autoconnect parameter $glade->signal_autoconnect( array( 'test' => array( 'test'), 'moved' => array( 'moved') )

); Although the subarray needs to be an array, it is not possible to connect a handler to several callbacks. GladeXML::signal_autoconnect_object void signal_autoconnect_object([array handlers]); Connects all signal handlers defined in the glade file to functions with the same name as the signal handler. Other than signal_autoconnect() the calling widget will not be passed as the first parameter (just omitted). For an explanation of the handlers parameter see signal_autoconnect() . GladeXML::relative_file string relative_file(string filename); Creates an absolute filename from a relative one. The new filename will be absolute to the directory of the .glade file. If the filename was absolute, it stays untouched. Example: The .glade file is located at /data/php/gtk/test.glade and you pass "window.xpm" to this function, the result will be /data/php/gtk/window.xpm. Misc Glade Functions Prefix the functions with "libglade::". get_widget_name() Returns the name of a widget from a glade file. get_widget_long_name() Returns the long name of a widget from a glade file. get_widget_tree() Returns the glade object to a widget. xml_new_from_memory() Creates a glade object from a string instead of a file. get_widget_name string get_widget_name(GtkWidget widget); Returns the name of a widget which has been loaded from a glade file. If the widget has been created the "normal" way and not with glade, NULL is returned.

In the example you could use a var_dump( libglade::get_widget_name( $btnClose)); which would return string(8) "btnClose". get_widget_long_name string get_widget_long_name(GtkWidget widget); Returns the long name of a widget which has been loaded from a glade file. If the widget has been created the "normal" way and not with glade, NULL is returned. In the example you could use a var_dump( libglade::get_widget_long_name( $btnClose)); which would return string(24) "dlgHellow.vbox1.btnClose". get_widget_tree GladeXML get_widget_tree(GtkWidget widget); Returns the glade object which created the given widget. xml_new_from_memory GladeXML xml_new_from_memory(string buffer, int size, string root, string domain); Creates a glade object from a string instead of a file. This can be used to e.g. dynamically load glade user interface definitions from a remote server without having to store them in a file. The function behaves exactly like the GladeXML constructor, except the fact that you pass a string (and the string length) to the function. Note that - other than the constructor - all parameters are required. Classes do Scintilla A Classe Scintilla ndice GtkScintilla GtkScintilla is an advanced text edition component with code completion, sintax highlight and others. GtkScintilla GtkScintilla is an advanced text edition component with code completion, sintax highlight and others.

Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkBin `-- GtkFrame `-- GtkScintilla Direct subclasses None. Descrio GtkScintilla is an advanced widget for code edition. It's a component with lots of resources that make it a great choice to write code editors. GtkScintilla provides advanced features like code completion, sintax highlight, caret lines, line numbers, besides lots of text controls, giving strong powers to the programmer. GtkScintilla inherits from GtkFrame, so you can embbed GtkScintilla object inside another containers like GtkWindow, GtkVBox, GtkHBox, GtkFrame and others. Construtor GtkScintilla (void); -- Creates the GtkScintilla text area. Mtodos find_text() Finds a portion of text in GtkScintilla. add_text() Add the string at the end of text area. insert_text() Inserts text in the text area of GtkScintilla. clear_all() Clear all text area. clear_document_style() get_length() Gets the length of the text inside the text area. get_current_pos() Gets the current position of cursor. It means the character position

inside the text. get_char_at() Return the character that is located at the specific position. get_anchor() get_style_at() redo() Redo is like "redo" action of every text editor. Redo does again some task undone by "Undo" operation. set_undo_collection() select_all() Select all text inside the text area. set_save_point() marker_line_from_handle() marker_delete_handle() get_undo_collection() get_view_ws() set_view_ws() position_from_point() goto_line() This method set the cursor position to the specific line. goto_pos() This method set the cursor position to the specific character position. set_anchor() get_cur_line() Returns an array containing the current line string and the current

column. get_end_styled() convert_eols() get_eol_mode() Return the current End of Line Mode. See set_eol_mode() . set_eol_mode() Define the End of Line Mode. start_styling() set_styling() get_buffered_draw() set_buffered_draw() set_tab_width() Set the Tab Width. get_tab_width() Gets the Tab Width. set_code_page() set_use_palette() marker_define() Define a specific symbol for a marker number. marker_set_fore() Set the Fore color of a marker, for markers table, see marker_define() marker_set_back() Set the Background color of a marker, for markers table, see marker_define() marker_add() Add a Marker symbol in front of the line, for markers table, see marker_define() marker_delete()

Deletes a Marker symbol from the line, for markers table, see marker_define() marker_delete_all() Removes all line markers of a specific type, for markers table, see marker_define() marker_get() marker_next() marker_previous() set_margin_type_n() get_margin_type_n() set_margin_width_n() get_margin_width_n() set_margin_mask_n() get_margin_mask_n() set_margin_sensitive_n() get_margin_sensitive_n() style_clear_all() style_set_fore() Set the fore color of some style. style_set_back() Set the background color of some style. style_set_bold() Define some style to be formated as bold. style_set_italic() Define some style to be formated as italic.

style_set_size() Define the size of some style style_set_font() Set the font of some style. style_set_eol_filled() style_reset_default() style_set_underline() Define some style to be formated as underlined. style_set_case() Turn OFF/ON the Case Sensitive of some Style. style_set_character_set() set_sel_fore() Set the fore color of the selection. set_sel_back() Set the back color of the selection. set_caret_fore() get_caret_fore() clear_all_cmd_keys() set_styling_ex() style_set_visible() Define if some style will be visible or not. get_caret_period() set_caret_period() set_word_chars() begin_undo_action() Define when start to store the actions of the user for "Undo

Action". end_undo_action() Define when finish to store the actions of the user for "Undo Action". indic_set_style() indic_get_style() indic_set_fore() indic_get_fore() set_style_bits() get_style_bits() set_line_state() get_line_state() get_max_line_state() set_caret_line_visible() Define if the selected line must have the background in another color. get_caret_line_visible() Return if caret lines are visible or not. get_caret_line_back() Get the background color of Caret Lines. set_caret_line_back() Changes the background color of the Caret Lines. autoc_show() Show the auto-complation list. autoc_cancel() autoc_active()

autoc_pos_start() autoc_complete() autoc_stops() autoc_set_separator() autoc_get_separator() autoc_select() autoc_set_cancel_at_start() autoc_get_cancel_at_start() autoc_set_fill_ups() autoc_set_choose_single() autoc_get_choose_single() autoc_set_ignore_case() autoc_get_ignore_case() user_list_show() autoc_set_auto_hide() autoc_get_auto_hide() set_indent() Set indentation size. get_indent() Get Indentation Size.

set_use_tabs() Set if the [TAB] key must use tabs or spaces. get_use_tabs() Get if the [TAB] key is using tabs or spaces. set_line_indentation() Set the line indentation of some line. get_line_indentation() Get the Line indentation of some line. get_line_indent_position() get_column() Returns the column number of the character position. set_h_scroll_bar() get_h_scroll_bar() set_indentation_guides() Set wheather the indentation guides are visible or not. get_indentation_guides() Get wheather the indentation guides are visible or not. set_highlight_guide() get_highlight_guide() get_line_end_position() get_code_page() get_use_palette() get_read_only() set_current_pos() set_selection_start() Set the start of the selection (character position).

get_selection_start() Get the begin of the selection (character position). set_selection_end() Set the end of the selection (character position). get_selection_end() Get the end of the selection (character position). set_print_magnification() get_print_magnification() set_print_colour_mode() get_print_colour_mode() get_first_visible_line() get_line() Get the content of some line. get_line_count() Get the quantity of lines of the text area. set_margin_left() get_margin_left() set_margin_right() get_margin_right() get_modify() set_sel() get_sel_text() Get the selected text. hide_selection()

point_x_from_position() point_y_from_position() line_from_position() Get the line number from character position. position_from_line() Get the character position from the line number. line_scroll() scroll_caret() replace_sel() set_read_only() Define if the text area may be edited or not. null() can_redo() Can Redo returns wheather "Redo" Operation may be done or not. can_paste() Can Paste returns wheather "Paste" Operation may be done or not. can_undo() Can Undo returns wheather "Undo" Operation may be done or not. empty_undo_buffer() Empty the action list for "Undo" Action. undo() Undo makes the last action undone. cut() Cut the selected text and transfer it to the memory. copy() Copy the selected text and transfer it to the memory. paste() Paste the selected text from the memory to the text area. clear()

set_text() Set all the content of Scintilla text area edition with the specified string. get_text() Return all the content of Scintilla text area edition as a string. get_text_length() Return the length of the text inside scintilla object. get_direct_function() get_direct_pointer() set_overtype() get_overtype() set_caret_width() get_caret_width() set_target_start() get_target_start() set_target_end() get_target_end() replace_target() replace_target_re() search_in_target() set_search_flags() get_search_flags()

call_tip_show() Show the sintax hint about one function call_tip_cancel() call_tip_active() call_tip_pos_start() call_tip_set_hlt() call_tip_set_back() visible_from_doc_line() doc_line_from_visible() set_fold_level() Define the fold level for some line. Fold level means the level of braces {} in the code. get_fold_level() Returns the fold level for some line. See set_fold_level() get_last_child() get_fold_parent() show_lines() Show the specified lines. hide_lines() Hide the specified lines. get_line_visible() set_fold_expanded() get_fold_expanded()

toggle_fold() ensure_visible() set_fold_flags() set_tab_indents() get_tab_indents() set_backspace_unindents() get_backspace_unindents() line_down() Places the cursor one line down. line_down_extend() Selects one line down. line_up() Places the cursor one line up. line_up_extend() Selects one line up. char_left() Places the cursor one character to the left. char_left_extend() Selects the character at the left side. char_right() Places the cursor one character to the right. char_right_extend() Selects the character at the right side. word_left() Places the cursor one word to the left. word_left_extend() Selects the word at the left side. word_right() Places the cursor one word to the right.

word_right_extend() Selects the word at the right side. home() Places the cursor at the begin of the line. home_extend() Selects the text untill the home of the line. line_end() Places the cursor at the end of the line. line_end_extend() Selects the text untill the end of the line. document_start() document_start_extend() document_end() document_end_extend() page_up() Goes one page up. page_up_extend() Selects the text of one page up. page_down() Goes one page down. page_down_extend() Selects the text of one page down. edit_toggle_overtype() cancel() delete_back() tab() back_tab()

new_line() form_feed() v_c_home() v_c_home_extend() zoom_in() zoom_out() del_word_left() Delete word of the left side of the cursor. del_word_right() Delete word of the right side of the cursor. line_cut() Cuts the current line's content to the memory. line_delete() Deletes the current line. line_transpose() lower_case() upper_case() line_scroll_down() line_scroll_up() move_caret_inside_view() line_length() Return the length of some line. brace_match() Get the character position of the complement of "{", "[", "("

brace_highlight() Set positions inside the text to be showed in brace mode. brace_bad_light() get_view_eol() Get wheather the end of line marks are visible or not. set_view_eol() Define wheather the end of line marks are visible or not. get_doc_pointer() set_doc_pointer() set_mod_event_mask() get_edge_column() Returns the column number that is used as the edge of text area. set_edge_column() Changes the column number that is used as the edge of the text area. get_edge_mode() Returns the edge mode. See set_edge_mode() set_edge_mode() Changes the edge mode. get_edge_colour() Gets the background color of text out of the edge. set_edge_colour() Changes the background color of text out of the edge. search_anchor() search_next() search_prev() set_caret_policy() lines_on_screen()

use_pop_up() selection_is_rectangle() set_zoom() get_zoom() create_document() add_ref_document() release_document() get_mod_event_mask() set_focus() get_focus() set_status() get_status() set_mouse_down_captures() get_mouse_down_captures() set_cursor() get_cursor() word_part_left() word_part_left_extend()

word_part_right() word_part_right_extend() set_visible_policy() del_line_left() del_line_right() grab_focus() start_record() stop_record() set_lexer() Define what kind of lexer language will be used to highlight the code. get_lexer() Return what kind of lexer language is used to highlight the code. See set_lexer() . colourise() set_property() set_keywords() Define the keywords list for some keywords set. set_lexer_language() Sinais "style_needed" "char_added" This signal is emitted when a character is added. "save_point_reached"

"save_point_left" "modify_attempt_ro" "key" "double_click" "update_ui" update_ui signal is emitted when the screen needs to be refreshed. "modified" modified signal is emitted when the user changes the text inside GtkScintilla text area, by adding or deleting some character. "macro_record" "margin_click" margin_click signal is emitted when the users clicks on the margin of GtkScintilla object. "need_shown" "painted" "user_list_selection" "uri_dropped" GtkScintilla Construtor GtkScintilla (void); Creates the GtkScintilla text area. $scintilla = new GtkScintilla; GtkScintilla::find_text int find_text(int FLAGS, string search, int start, int end); find_text() Finds a portion of text in GtkScintilla. $flags = SCINTILLA_FIND_DOWN + SCINTILLA_FIND_WHOLE_WORDS + SCINTILLA_FIND_MATCH_CASE + SCINTILLA_FIND_WHOLE_WORDS +

SCINTILLA_FIND_WORD_START + SCINTILLA_FIND_REGEXP; $what = 'text to find'; // start and end positions... $start = 0; $end = $scintilla->get_length(); $result = $scintilla->find_text($flags, $what, $start, $end); GtkScintilla::add_text voidadd_text(stringtext); add_text() add the string at the end of text area. $scintilla->add_text("line with break \n"); GtkScintilla::insert_text void insert_text(int pos, string text); Inserts text in the text area of GtkScintilla. // inserting text at the begin of GtkScintilla $scintilla->insert_text(-1, 'inserting text...'); GtkScintilla::clear_all void clear_all(void); Clear all text area. // clear all text area... $scintilla->clear_all(); GtkScintilla::clear_document_style void clear_document_style(void); GtkScintilla::get_length int get_length(void); Gets the length of the text inside the text area. // get the text's lenght echo $scintilla->get_lenght(); GtkScintilla::get_current_pos int get_current_pos(void); Gets the current position of cursor. It means the character position inside the text. // echo the current cursor position. echo $scintilla->get_current_pos();

GtkScintilla::get_char_at int get_char_at(int pos); Return the character that is located at the specific position. // echo the current character at the cursor position. $position = $scintilla->get_current_pos(); $character = $scintilla->get_char_at($position); GtkScintilla::get_anchor int get_anchor(void); GtkScintilla::get_style_at int get_style_at(int pos); GtkScintilla::redo void redo(void); Redo is like "redo" action of every text editor. Redo does again some task undone by "Undo" operation. You can design a "Edit" menu with many options like that linked with one callback like this one: // redo $scintilla->redo(); GtkScintilla::set_undo_collection void set_undo_collection(int collect_undo); GtkScintilla::select_all void select_all(void); Select all text inside the text area. // select all the text $scintilla->select_all(); GtkScintilla::set_save_point void set_save_point(void); GtkScintilla::marker_line_from_handle int marker_line_from_handle(int handle); GtkScintilla::marker_delete_handle void marker_delete_handle(int handle); GtkScintilla::get_undo_collection int get_undo_collection(void);

GtkScintilla::get_view_ws int get_view_ws(void); GtkScintilla::set_view_ws void set_view_ws(int view_ws); GtkScintilla::position_from_point int position_from_point(int x, int y); GtkScintilla::goto_line void goto_line(int line); This method set the cursor position to the specific line. // go to line 20... $scintilla->goto_line(20); GtkScintilla::goto_pos void goto_pos(int pos); This method set the cursor position to the specific character position. // go to 3 positions ahead... $scintilla->goto_pos($this->get_current_pos() + 3); GtkScintilla::set_anchor void set_anchor(int pos_anchor); GtkScintilla::get_cur_line arrayget_cur_line(void); Returns an array containing the current line string and the current column. The position "0" of array contain the entire line. The position "1" of array contain the current column. $line = $scintilla->get_cur_line(); var_dump($line); /* array(2) { [0]=> string(6) "sdfsdf" [1]=> int(3) } */ GtkScintilla::get_end_styled

int get_end_styled(void); GtkScintilla::convert_eols void convert_eols(int eol_mode); GtkScintilla::get_eol_mode int get_eol_mode(void); Return the current End of Line Mode. See set_eol_mode() . echo $scintilla->get_eol_mode(); GtkScintilla::set_eol_mode void set_eol_mode(int eol_mode); Define the End of Line Mode. This protocol dates back to the days of teletypewriters. CR stands for "carriage return" - the CR control character returned the print head ("carriage") to column 0 without advancing the paper. LF stands for "linefeed" - the LF control character advanced the paper one line without moving the print head. So if you wanted to return the print head to column zero (ready to print the next line) and advance the paper (so it prints on fresh paper), you need both CR and LF. // GtkScintillaEolMode define( "SCINTILLA_EOL_CRLF" , 0 ); define( "SCINTILLA_EOL_CR" , 1 ); define( "SCINTILLA_EOL_LF" , 2 ); # CRLF = Carriage return + line feed # CR = Carriage return # LF = Line feed # Win32 uses CR+LF, Linux uses LF. $scintilla->set_eol_mode(SCINTILLA_EOL_CRLF); GtkScintilla::start_styling void start_styling(int pos, int mask); GtkScintilla::set_styling void set_styling(int length, int style); GtkScintilla::get_buffered_draw int get_buffered_draw(void); GtkScintilla::set_buffered_draw void set_buffered_draw(int buffered);

GtkScintilla::set_tab_width void set_tab_width(int tab_width); Set the Tab Width. $scintilla->set_tab_width(4); GtkScintilla::get_tab_width int get_tab_width(void); Gets the Tab Width. echo $scintilla->get_tab_width(); GtkScintilla::set_code_page void set_code_page(int code_page); GtkScintilla::set_use_palette void set_use_palette(int use_palette); GtkScintilla::marker_define void marker_define(int marker_number, int marker_symbol); Define a specific symbol for a marker number. # markers table of symbols # 0 = little blob # 1 = big blob # 2 = triangle # 3 = recangle (shaped) # 4 - arrow # 5 = empty! # 6 = triangle down # 7 = minus sign # 8 = small dot # 9 = arrow right #10 = arrow right // defining marker 1... $scintilla->marker_define(1,0); // defining marker 2... $scintilla->marker_define(2,2); GtkScintilla::marker_set_fore void marker_set_fore(int marker_number, int fore); Set the Fore color of a marker, for markers table, see marker_define() // defining fore color of marker 1... $scintilla->marker_set_fore(1, hexdec('FF0000'));

// defining fore color of marker 2... $scintilla->marker_set_fore(1, hexdec('00FF00')); GtkScintilla::marker_set_back void marker_set_back(int marker_number, int back); Set the Background color of a marker, for markers table, see marker_define() // defining background color of marker 1... $scintilla->marker_set_back(1, hexdec('0000FF')); // defining background color of marker 2... $scintilla->marker_set_back(2, hexdec('0000FF')); GtkScintilla::marker_add void marker_add(int line, int marker_number); Add a Marker symbol in front of the line, for markers table, see marker_define() // add the marker 1 at line 4... $scintilla->marker_add(4, 1); GtkScintilla::marker_delete void marker_delete(int line, int marker_number); Deletes a Marker symbol from the line, for markers table, see marker_define() // removes the marker 1 from line 4... $scintilla->marker_delete(4, 1); GtkScintilla::marker_delete_all void marker_delete_all(int marker_number); Removes all line markers of a specific type, for markers table, see marker_define() // adding marker 1 at line 4... $scintilla->marker_add(4, 1); // adding marker 1 at line 6... $scintilla->marker_add(6, 1); // adding marker 1 at line 8... $scintilla->marker_add(8, 1); // adding marker 2 at line 5... $scintilla->marker_add(5, 2); // removes all markers "1"... $scintilla->marker_delete_all(1);

GtkScintilla::marker_get int marker_get(int line); GtkScintilla::marker_next int marker_next(int line_start, int marker_mask); GtkScintilla::marker_previous int marker_previous(int line_start, int marker_mask); GtkScintilla::set_margin_type_n void set_margin_type_n(int margin, int margin_type); GtkScintilla::get_margin_type_n int get_margin_type_n(int margin); GtkScintilla::set_margin_width_n void set_margin_width_n(int margin, int pixel_width); GtkScintilla::get_margin_width_n int get_margin_width_n(int margin); GtkScintilla::set_margin_mask_n void set_margin_mask_n(int margin, int mask); GtkScintilla::get_margin_mask_n int get_margin_mask_n(int margin); GtkScintilla::set_margin_sensitive_n void set_margin_sensitive_n(int margin, int sensitive); GtkScintilla::get_margin_sensitive_n int get_margin_sensitive_n(int margin); GtkScintilla::style_clear_all void style_clear_all(void); GtkScintilla::style_set_fore void style_set_fore(int style, int fore); Set the fore color of some style.

// GtkScintillaStyle define( "SCINTILLA_STYLE_DEFAULT", 32 ); $scintilla->style_set_fore(SCINTILLA_STYLE_DEFAULT, 0); GtkScintilla::style_set_back void style_set_back(int style, int back); Set the background color of some style. // GtkScintillaStyle define( "SCINTILLA_STYLE_DEFAULT", 32 ); $scintilla->style_set_back(SCINTILLA_STYLE_DEFAULT, hexdec('0000FF')); GtkScintilla::style_set_bold void style_set_bold(int style, int bold); Define some style to be formated as bold. $scintilla->style_set_bold(SCINTILLA_STYLE_DEFAULT, 1); GtkScintilla::style_set_italic void style_set_italic(int style, int italic); Define some style to be formated as italic. $scintilla->style_set_italic(SCINTILLA_STYLE_DEFAULT, 1); GtkScintilla::style_set_size void style_set_size(int style, int size_points); Define the size of some style $scintilla->style_set_size(SCINTILLA_STYLE_DEFAULT, 20); GtkScintilla::style_set_font void style_set_font(int style, string font_name); Set the font of some style. // GtkScintillaStyle define( "SCINTILLA_STYLE_DEFAULT", 32 ); $scintilla->style_set_font(SCINTILLA_STYLE_DEFAULT, '-*-luxisans-medium-r-norma l-*-18-*-*-*-*-*-*'); GtkScintilla::style_set_eol_filled void style_set_eol_filled(int style, int filled); GtkScintilla::style_reset_default void style_reset_default(void); GtkScintilla::style_set_underline

void style_set_underline(int style, int underline); Define some style to be formated as underlined. $scintilla->style_set_underline(SCINTILLA_STYLE_DEFAULT, 1); GtkScintilla::style_set_case void style_set_case(int style, int case_force); Turn OFF/ON the Case Sensitive of some Style. // TURN ON $scintilla->style_set_case(SCINTILLA_STYLE_DEFAULT, 0); // TURN OFF $scintilla->style_set_case(SCINTILLA_STYLE_DEFAULT, 1); GtkScintilla::style_set_character_set void style_set_character_set(int style, int character_set); GtkScintilla::set_sel_fore void set_sel_fore(int use_setting, int fore); Set the fore color of the selection. $scintilla->set_sel_fore(true, hexdec('FF0000')); GtkScintilla::set_sel_back void set_sel_back(int use_setting, int back); Set the back color of the selection. $scintilla->set_sel_back(true, 11250603); GtkScintilla::set_caret_fore void set_caret_fore(int fore); GtkScintilla::get_caret_fore int get_caret_fore(void); GtkScintilla::clear_all_cmd_keys void clear_all_cmd_keys(void); GtkScintilla::set_styling_ex void set_styling_ex(int length, string styles); GtkScintilla::style_set_visible void style_set_visible(int style, int visible); Define if some style will be visible or not.

// defining the style as invisible... $scintilla->set_sel_visible(SCINTILLA_STYLE_DEFAULT, 0); GtkScintilla::get_caret_period int get_caret_period(void); GtkScintilla::set_caret_period void set_caret_period(int period_milliseconds); GtkScintilla::set_word_chars void set_word_chars(string characters); GtkScintilla::begin_undo_action void begin_undo_action(void); Define when start to store the actions of the user for "Undo Action". $scintilla->begin_undo_action(); GtkScintilla::end_undo_action void end_undo_action(void); Define when finish to store the actions of the user for "Undo Action". $scintilla->end_undo_action(); GtkScintilla::indic_set_style void indic_set_style(int indic, int style); GtkScintilla::indic_get_style int indic_get_style(int indic); GtkScintilla::indic_set_fore void indic_set_fore(int indic, int fore); GtkScintilla::indic_get_fore int indic_get_fore(int indic); GtkScintilla::set_style_bits void set_style_bits(int bits); GtkScintilla::get_style_bits int get_style_bits(void); GtkScintilla::set_line_state

void set_line_state(int line, int state); GtkScintilla::get_line_state int get_line_state(int line); GtkScintilla::get_max_line_state int get_max_line_state(void); GtkScintilla::set_caret_line_visible void set_caret_line_visible(int show); Define if the selected line must have the background in another color. $scintilla->set_caret_line_visible(1); GtkScintilla::get_caret_line_visible int get_caret_line_visible(void); Return if caret lines are visible or not. echo $scintilla->get_caret_line_visible(); GtkScintilla::get_caret_line_back int get_caret_line_back(void); Get the background color of Caret Lines. echo $scintilla->get_caret_line_back(); GtkScintilla::set_caret_line_back void set_caret_line_back(int back); Changes the background color of the Caret Lines. $scintilla->set_caret_line_back(9999204548); GtkScintilla::autoc_show void autoc_show(int len_entered, string item_list); Show the auto-complation list. $l = trim(implode("",array_unique(array("aaa ", "bbb ")))); $word='a'; GtkScintilla::autoc_show(strlen($word), $l); GtkScintilla::autoc_cancel void autoc_cancel(void); GtkScintilla::autoc_active

int autoc_active(void); GtkScintilla::autoc_pos_start int autoc_pos_start(void); GtkScintilla::autoc_complete void autoc_complete(void); GtkScintilla::autoc_stops void autoc_stops(string character_set); GtkScintilla::autoc_set_separator void autoc_set_separator(int separator_character); GtkScintilla::autoc_get_separator int autoc_get_separator(void); GtkScintilla::autoc_select void autoc_select(string text); GtkScintilla::autoc_set_cancel_at_start void autoc_set_cancel_at_start(int cancel); GtkScintilla::autoc_get_cancel_at_start int autoc_get_cancel_at_start(void); GtkScintilla::autoc_set_fill_ups void autoc_set_fill_ups(string character_set); GtkScintilla::autoc_set_choose_single void autoc_set_choose_single(int choose_single); GtkScintilla::autoc_get_choose_single int autoc_get_choose_single(void); GtkScintilla::autoc_set_ignore_case void autoc_set_ignore_case(int ignore_case); GtkScintilla::autoc_get_ignore_case int autoc_get_ignore_case(void);

GtkScintilla::user_list_show void user_list_show(int list_type, string item_list); GtkScintilla::autoc_set_auto_hide void autoc_set_auto_hide(int auto_hide); GtkScintilla::autoc_get_auto_hide int autoc_get_auto_hide(void); GtkScintilla::set_indent void set_indent(int indent_size); Set indentation size. $scintilla->set_indent(4); GtkScintilla::get_indent int get_indent(void); Get Indentation Size. GtkScintilla::set_use_tabs void set_use_tabs(int use_tabs); Set if the [TAB] key must use tabs or spaces. GtkScintilla::get_use_tabs int get_use_tabs(void); Get if the [TAB] key is using tabs or spaces. GtkScintilla::set_line_indentation void set_line_indentation(int line, int indent_size); Set the line indentation of some line. $cur_line = $scintilla->get_cur_line(); $scintilla->set_line_indentation($cur_line, 8); GtkScintilla::get_line_indentation int get_line_indentation(int line); Get the Line indentation of some line. echo $scintilla->get_line_indentation($cur_line); GtkScintilla::get_line_indent_position

int get_line_indent_position(int line); GtkScintilla::get_column int get_column(int pos); Returns the column number of the character position. // get the column number of position 40... echo $scintilla->get_column(40); GtkScintilla::set_h_scroll_bar void set_h_scroll_bar(int show); GtkScintilla::get_h_scroll_bar int get_h_scroll_bar(void); GtkScintilla::set_indentation_guides void set_indentation_guides(int show); Set wheather the indentation guides are visible or not. GtkScintilla::get_indentation_guides int get_indentation_guides(void); Get wheather the indentation guides are visible or not. GtkScintilla::set_highlight_guide void set_highlight_guide(int column); GtkScintilla::get_highlight_guide int get_highlight_guide(void); GtkScintilla::get_line_end_position int get_line_end_position(int line); GtkScintilla::get_code_page int get_code_page(void); GtkScintilla::get_use_palette int get_use_palette(void); GtkScintilla::get_read_only int get_read_only(void);

GtkScintilla::set_current_pos void set_current_pos(int pos); GtkScintilla::set_selection_start void set_selection_start(int pos); Set the start of the selection (character position). $scintilla->set_selection_start(100); GtkScintilla::get_selection_start int get_selection_start(void); Get the begin of the selection (character position). GtkScintilla::set_selection_end void set_selection_end(int pos); Set the end of the selection (character position). $scintilla->set_selection_end(200); GtkScintilla::get_selection_end int get_selection_end(void); Get the end of the selection (character position). GtkScintilla::set_print_magnification void set_print_magnification(int magnification); GtkScintilla::get_print_magnification int get_print_magnification(void); GtkScintilla::set_print_colour_mode void set_print_colour_mode(int mode); GtkScintilla::get_print_colour_mode int get_print_colour_mode(void); GtkScintilla::get_first_visible_line int get_first_visible_line(void); GtkScintilla::get_line string get_line(int line);

Get the content of some line. GtkScintilla::get_line_count int get_line_count(void); Get the quantity of lines of the text area. echo $scintilla->get_line_count(); GtkScintilla::set_margin_left void set_margin_left(int pixel_width); GtkScintilla::get_margin_left int get_margin_left(void); GtkScintilla::set_margin_right void set_margin_right(int pixel_width); GtkScintilla::get_margin_right int get_margin_right(void); GtkScintilla::get_modify int get_modify(void); GtkScintilla::set_sel void set_sel(int start, int end); GtkScintilla::get_sel_text string get_sel_text(void); echo $scintilla->get_sel_text(); GtkScintilla::hide_selection void hide_selection(int normal); GtkScintilla::point_x_from_position int point_x_from_position(int pos); GtkScintilla::point_y_from_position int point_y_from_position(int pos); GtkScintilla::line_from_position int line_from_position(int pos);

Get the line number from character position. $cur_line = $scintilla->line_from_position($scintilla->get_current_pos()); GtkScintilla::position_from_line int position_from_line(int line); Get the character position from the line number. $pos = $scintilla->position_from_line(10); GtkScintilla::line_scroll void line_scroll(int columns, int lines); GtkScintilla::scroll_caret void scroll_caret(void); GtkScintilla::replace_sel void replace_sel(string text); GtkScintilla::set_read_only void set_read_only(int read_only); Define if the text area may be edited or not. // avoiding the user to edit... $scintilla->set_read_only(1); GtkScintilla::null void null(void); GtkScintilla::can_redo int can_redo(void); Can Redo returns wheather "Redo" Operation may be done or not. if ($scintilla->can_redo()) { // there are something to be "redone"... } GtkScintilla::can_paste int can_paste(void); Can Paste returns wheather "Paste" Operation may be done or not. if ($scintilla->can_paste()) { // there are something to be "paste"... }

GtkScintilla::can_undo int can_undo(void); Can Undo returns wheather "Undo" Operation may be done or not. if ($scintilla->can_undo()) { // there are something to be "undone"... } GtkScintilla::empty_undo_buffer void empty_undo_buffer(void); Empty the action list for "Undo" Action. $scintilla->empty_undo_buffer(); GtkScintilla::undo void undo(void); Undo makes the last action undone. $scintilla->undo(); GtkScintilla::cut void cut(void); Cut the selected text and transfer it to the memory. $scintilla->cut(); GtkScintilla::copy void copy(void); Copy the selected text and transfer it to the memory. $scintilla->copy(); GtkScintilla::paste void paste(void); Paste the selected text from the memory to the text area. $scintilla->paste(); GtkScintilla::clear void clear(void); GtkScintilla::set_text void set_text(string text); Set all the content of Scintilla text area edition with the specified

string. $scintilla->set_text('my text'); GtkScintilla::get_text stringget_text(void); Return all the content of Scintilla text area edition as a string. echo $scintilla->get_text(); GtkScintilla::get_text_length int get_text_length(void); Return the length of the text inside scintilla object. echo $scintilla->get_text_length(); GtkScintilla::get_direct_function int get_direct_function(void); GtkScintilla::get_direct_pointer int get_direct_pointer(void); GtkScintilla::set_overtype void set_overtype(int overtype); GtkScintilla::get_overtype int get_overtype(void); GtkScintilla::set_caret_width void set_caret_width(int pixel_width); GtkScintilla::get_caret_width int get_caret_width(void); GtkScintilla::set_target_start void set_target_start(int pos); GtkScintilla::get_target_start int get_target_start(void); GtkScintilla::set_target_end void set_target_end(int pos); GtkScintilla::get_target_end

int get_target_end(void); GtkScintilla::replace_target XXX replace_target(XXX); GtkScintilla::replace_target_re XXX replace_target_re(XXX); GtkScintilla::search_in_target XXX search_in_target(XXX); GtkScintilla::set_search_flags void set_search_flags(int flags); GtkScintilla::get_search_flags int get_search_flags(void); GtkScintilla::call_tip_show void call_tip_show(int pos, string definition); Show the sintax hint about one function $scintilla->call_tip_show(10, 'function myfunction ( string name, int position )'); GtkScintilla::call_tip_cancel void call_tip_cancel(void); GtkScintilla::call_tip_active int call_tip_active(void); GtkScintilla::call_tip_pos_start int call_tip_pos_start(void); GtkScintilla::call_tip_set_hlt void call_tip_set_hlt(int start, int end); GtkScintilla::call_tip_set_back void call_tip_set_back(int back); GtkScintilla::visible_from_doc_line int visible_from_doc_line(int line);

GtkScintilla::doc_line_from_visible int doc_line_from_visible(int line_display); GtkScintilla::set_fold_level void set_fold_level(int line, int level); Define the fold level for some line. Fold level means the level of braces {} in the code. // defining the fold level for line 10... $scintilla->set_fold_level(10, SCINTILLA_FOLDLEVELBASE + 1); GtkScintilla::get_fold_level int get_fold_level(int line); Returns the fold level for some line. See set_fold_level() // getting the fold level of line 10... echo $scintilla->get_fold_level(10); GtkScintilla::get_last_child int get_last_child(int line, int level); GtkScintilla::get_fold_parent int get_fold_parent(int line); GtkScintilla::show_lines void show_lines(int line_start, int line_end); Show the specified lines. // show all the lines... $scintilla->show_lines(0,$scintilla->get_line_count()); GtkScintilla::hide_lines void hide_lines(int line_start, int line_end); Hide the specified lines. // hide all the lines... $scintilla->hide_lines(0,$scintilla->get_line_count()); GtkScintilla::get_line_visible int get_line_visible(int line); GtkScintilla::set_fold_expanded void set_fold_expanded(int line, int expanded);

GtkScintilla::get_fold_expanded int get_fold_expanded(int line); GtkScintilla::toggle_fold void toggle_fold(int line); GtkScintilla::ensure_visible void ensure_visible(int line); GtkScintilla::set_fold_flags void set_fold_flags(int flags); GtkScintilla::set_tab_indents void set_tab_indents(int tab_indents); GtkScintilla::get_tab_indents int get_tab_indents(void); GtkScintilla::set_backspace_unindents void set_backspace_unindents(int bs_unindents); GtkScintilla::get_backspace_unindents int get_backspace_unindents(void); GtkScintilla::line_down void line_down(void); Places the cursor one line down. $scintilla->line_down(); GtkScintilla::line_down_extend void line_down_extend(void); Selects one line down. $scintilla->line_down_extend(); GtkScintilla::line_up void line_up(void); Places the cursor one line up. $scintilla->line_up(); GtkScintilla::line_up_extend

void line_up_extend(void); Selects one line up. $scintilla->line_up_extend(); GtkScintilla::char_left void char_left(void); Places the cursor one character to the left. $scintilla->char_left() GtkScintilla::char_left_extend void char_left_extend(void); Selects the character at the left side. $scintilla->char_left_extend(); GtkScintilla::char_right void char_right(void); Places the cursor one character to the right. $scintilla->char_right(); GtkScintilla::char_right_extend void char_right_extend(void); Selects the character at the right side. $scintilla->char_right_extend(); GtkScintilla::word_left void word_left(void); Places the cursor one word to the left. $scintilla->word_left(); GtkScintilla::word_left_extend void word_left_extend(void); Selects the word at the left side. $scintilla->word_left_extend(); GtkScintilla::word_right void word_right(void); Places the cursor one word to the right. $scintilla->word_right();

GtkScintilla::word_right_extend void word_right_extend(void); Selects the word at the right side. $scintilla->word_right_extend(); GtkScintilla::home void home(void); Places the cursor at the begin of the line. $scintilla->home(); GtkScintilla::home_extend void home_extend(void); Selects the text untill the home of the line. $scintilla->home_extend(); GtkScintilla::line_end void line_end(void); Places the cursor at the end of the line. $scintilla->line_end(); GtkScintilla::line_end_extend void line_end_extend(void); Selects the text untill the end of the line. $scintilla->line_end_extend(); GtkScintilla::document_start void document_start(void); GtkScintilla::document_start_extend void document_start_extend(void); GtkScintilla::document_end void document_end(void); GtkScintilla::document_end_extend void document_end_extend(void); GtkScintilla::page_up

void page_up(void); Goes one page up. $scintilla->page_up(); GtkScintilla::page_up_extend void page_up_extend(void); Selects the text of one page up. $scintilla->page_up_extend(); GtkScintilla::page_down void page_down(void); Goes one page down. $scintilla->page_down(); GtkScintilla::page_down_extend void page_down_extend(void); Selects the text of one page down. $scintilla->page_down_extend(); GtkScintilla::edit_toggle_overtype void edit_toggle_overtype(void); GtkScintilla::cancel void cancel(void); GtkScintilla::delete_back void delete_back(void); GtkScintilla::tab void tab(void); GtkScintilla::back_tab void back_tab(void); GtkScintilla::new_line void new_line(void); GtkScintilla::form_feed void form_feed(void);

GtkScintilla::v_c_home void v_c_home(void); GtkScintilla::v_c_home_extend void v_c_home_extend(void); GtkScintilla::zoom_in void zoom_in(void); GtkScintilla::zoom_out void zoom_out(void); GtkScintilla::del_word_left void del_word_left(void); Delete word of the left side of the cursor. $scintilla->del_word_left(); GtkScintilla::del_word_right void del_word_right(void); Delete word of the right side of the cursor. $scintilla->del_word_right(); GtkScintilla::line_cut void line_cut(void); Cuts the current line's content to the memory. $scintilla->line_cut(); GtkScintilla::line_delete void line_delete(void); Deletes the current line. $scintilla->line_delete(); GtkScintilla::line_transpose void line_transpose(void); GtkScintilla::lower_case void lower_case(void); GtkScintilla::upper_case

void upper_case(void); GtkScintilla::line_scroll_down void line_scroll_down(void); GtkScintilla::line_scroll_up void line_scroll_up(void); GtkScintilla::move_caret_inside_view void move_caret_inside_view(void); GtkScintilla::line_length int line_length(int line); Return the length of some line. // the length of line 5... echo $scintilla->line_length(5); GtkScintilla::brace_match int brace_match(int position); Get the character position of the complement of "{", "[", "(" $brace_pos = $scintilla->get_current_pos(); $char = $scintilla->get_char_at($brace_pos); if (($char == '{') or ($char == '}')) // or... $other_pos = $scintilla->brace_match($brace_pos); GtkScintilla::brace_highlight void brace_highlight(int pos1, int pos2); Set positions inside the text to be showed in brace mode. Brace colors and fonts indentify characters like "{", "(" and "[" $brace_pos = $scintilla->get_current_pos(); $char = $scintilla->get_char_at($brace_pos); if (($char == '{') or ($char == '}')) // or... $other_pos = $scintilla->brace_match($brace_pos); $scintilla->brace_highlight($brace_pos, $other_pos); GtkScintilla::brace_bad_light void brace_bad_light(int pos); GtkScintilla::get_view_eol int get_view_eol(void); Get wheather the end of line marks are visible or not.

echo $scintilla->get_view_eol(); GtkScintilla::set_view_eol void set_view_eol(int visible); Define wheather the end of line marks are visible or not. // view end of lines... $scintilla->set_view_eol(1); GtkScintilla::get_doc_pointer int get_doc_pointer(void); GtkScintilla::set_doc_pointer void set_doc_pointer(int pointer); GtkScintilla::set_mod_event_mask void set_mod_event_mask(int mask); GtkScintilla::get_edge_column int get_edge_column(void); Returns the column number that is used as the edge of text area. GtkScintilla::set_edge_column void set_edge_column(int column); Changes the column number that is used as the edge of the text area. GtkScintilla::get_edge_mode int get_edge_mode(void); Returns the edge mode. See set_edge_mode() GtkScintilla::set_edge_mode void set_edge_mode(int mode); Changes the edge mode. // GtkScintillaEdgeMode @define( "SCINTILLA_EDGE_NONE" , 0 ); @define( "SCINTILLA_EDGE_LINE" , 1 ); @define( "SCINTILLA_EDGE_BACKGROUND" , 2 ); // changing the edge mode... $scintilla->set_edge_mode(SCINTILLA_EDGE_NONE); GtkScintilla::get_edge_colour

int get_edge_colour(void); Gets the background color of text out of the edge. echo $scintilla->get_edge_colour(); GtkScintilla::set_edge_colour void set_edge_colour(int edge_colour); Changes the background color of text out of the edge. $scintilla->set_edge_colour(hexdec('FF0000')); GtkScintilla::search_anchor void search_anchor(void); GtkScintilla::search_next int search_next(int flags, string text); GtkScintilla::search_prev int search_prev(int flags, string text); GtkScintilla::set_caret_policy void set_caret_policy(int caret_policy, int caret_slop); GtkScintilla::lines_on_screen int lines_on_screen(void); GtkScintilla::use_pop_up void use_pop_up(int allow_pop_up); GtkScintilla::selection_is_rectangle int selection_is_rectangle(void); GtkScintilla::set_zoom void set_zoom(int zoom); GtkScintilla::get_zoom int get_zoom(void); GtkScintilla::create_document int create_document(void); GtkScintilla::add_ref_document

void add_ref_document(int doc); GtkScintilla::release_document void release_document(int doc); GtkScintilla::get_mod_event_mask int get_mod_event_mask(void); GtkScintilla::set_focus void set_focus(int focus); GtkScintilla::get_focus int get_focus(void); GtkScintilla::set_status void set_status(int status_code); GtkScintilla::get_status int get_status(void); GtkScintilla::set_mouse_down_captures void set_mouse_down_captures(int captures); GtkScintilla::get_mouse_down_captures int get_mouse_down_captures(void); GtkScintilla::set_cursor void set_cursor(int cursor_type); GtkScintilla::get_cursor int get_cursor(void); GtkScintilla::word_part_left void word_part_left(void); GtkScintilla::word_part_left_extend void word_part_left_extend(void); GtkScintilla::word_part_right void word_part_right(void);

GtkScintilla::word_part_right_extend void word_part_right_extend(void); GtkScintilla::set_visible_policy void set_visible_policy(int visible_policy, int visible_slop); GtkScintilla::del_line_left void del_line_left(void); GtkScintilla::del_line_right void del_line_right(void); GtkScintilla::grab_focus void grab_focus(void); GtkScintilla::start_record void start_record(void); GtkScintilla::stop_record void stop_record(void); GtkScintilla::set_lexer void set_lexer(int lexer); Define what kind of lexer language will be used to highlight the code. // GtkScintillaLexer @define( "SCINTILLA_LEXER_CONTAINER" , 0 ); @define( "SCINTILLA_LEXER_NULL" , 1 ); @define( "SCINTILLA_LEXER_PYTHON" , 2 ); @define( "SCINTILLA_LEXER_CPP" , 3 ); @define( "SCINTILLA_LEXER_HTML" , 4 ); @define( "SCINTILLA_LEXER_XML" , 5 ); @define( "SCINTILLA_LEXER_PERL" , 6 ); @define( "SCINTILLA_LEXER_SQL" , 7 ); @define( "SCINTILLA_LEXER_VB" , 8 ); @define( "SCINTILLA_LEXER_PROPERTIES" , 9 ); @define( "SCINTILLA_LEXER_ERRORLIST" , 10 ); @define( "SCINTILLA_LEXER_MAKEFILE" , 11 ); @define( "SCINTILLA_LEXER_BATCH" , 12 ); @define( "SCINTILLA_LEXER_XCODE" , 13 ); @define( "SCINTILLA_LEXER_LATEX" , 14 ); @define( "SCINTILLA_LEXER_LUA" , 15 ); @define( "SCINTILLA_LEXER_DIFF" , 16 ); @define( "SCINTILLA_LEXER_CONF" , 17 ); @define( "SCINTILLA_LEXER_PASCAL" , 18 );

@define( "SCINTILLA_LEXER_AVE" , 19 ); @define( "SCINTILLA_LEXER_ADA" , 20 ); $scintilla->set_lexer(SCINTILLA_LEXER_HTML); GtkScintilla::get_lexer int get_lexer(void); Return what kind of lexer language is used to highlight the code. See set_lexer() . echo $scintilla->get_lexer(); GtkScintilla::colourise void colourise(int start, int end); GtkScintilla::set_property void set_property(string key, string value); GtkScintilla::set_keywords void set_keywords(int keyword_set, string key_words); Define the keywords list for some keywords set. $scintilla->set_keywords(0, 'doctype a abbr abbr accept accept-charset accesske y acronym action address align alink alt applet archive area axis b background base basefont bdo bgcolor big blockquote body border br button caption cellpadd ing cellspacing center char charoff charset checkbox checked cite cite class cl assid clear code codebase codetype col colgroup color cols colspan compact cont ent coords data datafld dataformatas datapagesize datasrc datetime dd declare d efer del dfn dir dir disabled div dl dt em enctype event face fieldset file fon t for foreach form frame frame frameborder frameset h1 h2 h3 h4 h5 h6 head head ers height hidden hr href hreflang hspace html http-equiv i id iframe image img input ins isindex ismap kbd label label lang language leftmargin legend li lin k link longdesc map marginheight marginwidth maxlength media menu meta method m ultiple name noframes nohref noresize noscript noshade nowrap object object ol onblur onchange onclick ondblclick onfocus onkeydown onkeypress onkeyup onload onmousedown onmousemove onmouseout onmouseover onmouseup onreset onselect onsub mit onunload optgroup option p param password pre profile prompt public q radio readonly rel reset rev rows rowspan rules s samp scheme scope script select se lected shape size small span span src standby start strike strong style style s ub submit summary sup tabindex table target tbody td text text textarea tfoot t h thead title title topmargin tr tt type u ul usemap valign value valuetype var version vlink vspace width xml xmlns'); $scintilla->set_keywords(1, 'abstract boolean break byte case catch char class const continue debugger default delete do double else enum export extends final finally float for foreach function goto if implements import in instanceof int interface long native new package private protected public return short static super switch synchronized this throw throws transient try typeof var void vola tile while with'); $scintilla->set_keywords(2, 'None and assert break class continue def del elif else except exec finally for from global if import in is lambda not or pass pri

nt raise return try while function include include_once require require_once'); GtkScintilla::set_lexer_language void set_lexer_language(string language); style_needed Funo Callback void callback(GtkScintilla widget, int position); char_added This signal is emitted when a character is added. Funo Callback void callback(GtkScintilla widget, int character); save_point_reached Funo Callback void callback(GtkScintilla widget); save_point_left Funo Callback void callback(GtkScintilla widget); modify_attempt_ro Funo Callback void callback(GtkScintilla widget); key Funo Callback void callback(GtkScintilla widget, int character, int modifiers); double_click Funo Callback void callback(GtkScintilla widget); update_ui update_ui signal is emitted when the screen needs to be refreshed.

Funo Callback void callback(GtkScintilla widget); modified modified signal is emitted when the user changes the text inside GtkScintilla text area, by adding or deleting some character. Funo Callback void callback(GtkScintilla widget); macro_record Funo Callback void callback(GtkScintilla widget, int message, int wparam, int lparam); margin_click margin_click signal is emitted when the users clicks on the margin of GtkScintilla object. Funo Callback void callback(GtkScintilla widget, int modifiers, int position, int margin); need_shown Funo Callback void callback(GtkScintilla widget, int position, int lenght); painted Funo Callback void callback(GtkScintilla widget); user_list_selection Funo Callback void callback(GtkScintilla widget, int type, char text); uri_dropped Funo Callback void callback(GtkScintilla widget);

Classes do Sqpane A Classe Sqpane ndice GtkSQPane GtkSQPane Hierarquia do Objeto GtkObject `-- GtkWidget `-- GtkContainer `-- GtkSQPane Direct subclasses None. Descrio Construtor GtkSQPane (void); -Mtodos set_position() set_handle_size()

compute_position() GtkSQPane Construtor GtkSQPane (void); GtkSQPane::set_position void set_position(int x, int y); GtkSQPane::set_handle_size void set_handle_size(int size); GtkSQPane::compute_position

void compute_position(int width, int height); Apndice _________________________________________________________________ ndice Agradecimentos equipe do PHP-GTK Agradecimentos equipe da Documentao do PHP-GTK GNU Free Documentation License Nomes simblicos para as chaves no PHP-GTK Apndice A. Agradecimentos equipe do PHP-GTK Autores do PHP-GTK Andrei Zmievski : Trabalho principal Contribuidores do PHP-GTK Frank Kromann : Compilao Win32 e distribuies binrias, algum trabalho no gerador de cdigo Markus Fischer : Alan Knowles : Apndice B. Agradecimentos equipe da Documentao do PHP-GTK Autores do Manual do PHP-GTK James Moore : Esboo do Manual e criador do framework, guia do usurio, tutoriais, documentao das classes e editor original (en) Steph Fox : Reestruturao e internacionalizao, guia do usurio, documentao das classes, atual editor (en) Contribuidores do Manual do PHP-GTK Andrei Zmievski : Documentao das Classes Simon Wheeler : Documentao das Classes Pablo Dall'Oglio : Traduo do Manual para Portugus Brasileiro Thomas Gonzalez Miranda : Traduo do Manual para Portugus Brasileiro Apndice C. GNU Free Documentation License Version 1.1, March 2000 Copyright Copyright (C) 2000 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 1. PREAMBLE The purpose of this License is to make a manual, textbook, or other written document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.

This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. 2. APPLICABILITY AND DEFINITIONS This License applies to any manual or other work that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (For example, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, whose contents can be viewed and edited directly and straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup has been designed to thwart or discourage subsequent modification by readers is not Transparent. A copy that is not "Transparent" is called "Opaque". Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML designed for human modification.

Opaque formats include PostScript, PDF, proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML produced by some word processors for output purposes only. The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. 3. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. 4. COPYING IN QUANTITY If you publish printed copies of the Document numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a publicly-accessible computer-network location containing a complete Transparent copy of the Document, free of added material, which the general network-using public has access to download anonymously at no charge using public-standard network protocols. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or

retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. 5. MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has less than five). C. State on the Title page the name of the publisher of the Modified Version, as the publisher. D. Preserve all the copyright notices of the Document. E. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. H. Include an unaltered copy of this License. I. Preserve the section entitled "History", and its title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. K. In any section entitled "Acknowledgements" or "Dedications", preserve the section's title, and preserve in the section all the

substance and tone of each of the contributor acknowledgements and/or dedications given therein. L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. M. Delete any section entitled "Endorsements". Such a section may not be included in the Modified Version. N. Do not retitle any existing section as "Endorsements" or to conflict in title with any Invariant Section. If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. 6. COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections entitled "History" in the various original documents, forming one section entitled "History"; likewise combine any sections entitled "Acknowledgements", and any sections entitled "Dedications". You

must delete all sections entitled "Endorsements." 7. COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. 8. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, does not as a whole count as a Modified Version of the Document, provided no compilation copyright is claimed for the compilation. Such a compilation is called an "aggregate", and this License does not apply to the other self-contained works thus compiled with the Document, on account of their being thus compiled, if they are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one quarter of the entire aggregate, the Document's Cover Texts may be placed on covers that surround only the Document within the aggregate. Otherwise they must appear on covers around the whole aggregate. 9. TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License provided that you also include the original English version of this License. In case of a disagreement between the translation and the original English version of this License, the original English version will prevail. 10. TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 11. FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See

http://www.gnu.org/copyleft/. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. Apndice D. Nomes simblicos para as chaves no PHP-GTK GDK_KEY_VoidSymbol GDK_KEY_BackSpace GDK_KEY_Tab GDK_KEY_Linefeed GDK_KEY_Clear GDK_KEY_Return GDK_KEY_Pause GDK_KEY_Scroll_Lock GDK_KEY_Sys_Req GDK_KEY_Escape GDK_KEY_Delete GDK_KEY_Multi_key GDK_KEY_SingleCandidate GDK_KEY_MultipleCandidate GDK_KEY_PreviousCandidate GDK_KEY_Kanji GDK_KEY_Muhenkan GDK_KEY_Henkan_Mode GDK_KEY_Henkan GDK_KEY_Romaji GDK_KEY_Hiragana GDK_KEY_Katakana GDK_KEY_Hiragana_Katakana GDK_KEY_Zenkaku GDK_KEY_Hankaku GDK_KEY_Zenkaku_Hankaku GDK_KEY_Touroku GDK_KEY_Massyo GDK_KEY_Kana_Lock GDK_KEY_Kana_Shift GDK_KEY_Eisu_Shift GDK_KEY_Eisu_toggle GDK_KEY_Zen_Koho GDK_KEY_Mae_Koho GDK_KEY_Home GDK_KEY_Left GDK_KEY_Up GDK_KEY_Right GDK_KEY_Down GDK_KEY_Prior GDK_KEY_Page_Up

GDK_KEY_Next GDK_KEY_Page_Down GDK_KEY_End GDK_KEY_Begin GDK_KEY_Select GDK_KEY_Print GDK_KEY_Execute GDK_KEY_Insert GDK_KEY_Undo GDK_KEY_Redo GDK_KEY_Menu GDK_KEY_Find GDK_KEY_Cancel GDK_KEY_Help GDK_KEY_Break GDK_KEY_Mode_switch GDK_KEY_script_switch GDK_KEY_Num_Lock GDK_KEY_KP_Space GDK_KEY_KP_Tab GDK_KEY_KP_Enter GDK_KEY_KP_F1 GDK_KEY_KP_F2 GDK_KEY_KP_F3 GDK_KEY_KP_F4 GDK_KEY_KP_Home GDK_KEY_KP_Left GDK_KEY_KP_Up GDK_KEY_KP_Right GDK_KEY_KP_Down GDK_KEY_KP_Prior GDK_KEY_KP_Page_Up GDK_KEY_KP_Next GDK_KEY_KP_Page_Down GDK_KEY_KP_End GDK_KEY_KP_Begin GDK_KEY_KP_Insert GDK_KEY_KP_Delete GDK_KEY_KP_Equal GDK_KEY_KP_Multiply GDK_KEY_KP_Add GDK_KEY_KP_Separator GDK_KEY_KP_Subtract GDK_KEY_KP_Decimal GDK_KEY_KP_Divide GDK_KEY_KP_0 GDK_KEY_KP_1 GDK_KEY_KP_2 GDK_KEY_KP_3 GDK_KEY_KP_4 GDK_KEY_KP_5 GDK_KEY_KP_6 GDK_KEY_KP_7 GDK_KEY_KP_8

GDK_KEY_KP_9 GDK_KEY_F1 GDK_KEY_F2 GDK_KEY_F3 GDK_KEY_F4 GDK_KEY_F5 GDK_KEY_F6 GDK_KEY_F7 GDK_KEY_F8 GDK_KEY_F9 GDK_KEY_F10 GDK_KEY_F11 GDK_KEY_L1 GDK_KEY_F12 GDK_KEY_L2 GDK_KEY_F13 GDK_KEY_L3 GDK_KEY_F14 GDK_KEY_L4 GDK_KEY_F15 GDK_KEY_L5 GDK_KEY_F16 GDK_KEY_L6 GDK_KEY_F17 GDK_KEY_L7 GDK_KEY_F18 GDK_KEY_L8 GDK_KEY_F19 GDK_KEY_L9 GDK_KEY_F20 GDK_KEY_L10 GDK_KEY_F21 GDK_KEY_R1 GDK_KEY_F22 GDK_KEY_R2 GDK_KEY_F23 GDK_KEY_R3 GDK_KEY_F24 GDK_KEY_R4 GDK_KEY_F25 GDK_KEY_R5 GDK_KEY_F26 GDK_KEY_R6 GDK_KEY_F27 GDK_KEY_R7 GDK_KEY_F28 GDK_KEY_R8 GDK_KEY_F29 GDK_KEY_R9 GDK_KEY_F30 GDK_KEY_R10 GDK_KEY_F31 GDK_KEY_R11 GDK_KEY_F32

GDK_KEY_R12 GDK_KEY_F33 GDK_KEY_R13 GDK_KEY_F34 GDK_KEY_R14 GDK_KEY_F35 GDK_KEY_R15 GDK_KEY_Shift_L GDK_KEY_Shift_R GDK_KEY_Control_L GDK_KEY_Control_R GDK_KEY_Caps_Lock GDK_KEY_Shift_Lock GDK_KEY_Meta_L GDK_KEY_Meta_R GDK_KEY_Alt_L GDK_KEY_Alt_R GDK_KEY_Super_L GDK_KEY_Super_R GDK_KEY_Hyper_L GDK_KEY_Hyper_R GDK_KEY_ISO_Lock GDK_KEY_ISO_Level2_Latch GDK_KEY_ISO_Level3_Shift GDK_KEY_ISO_Level3_Latch GDK_KEY_ISO_Level3_Lock GDK_KEY_ISO_Group_Shift GDK_KEY_ISO_Group_Latch GDK_KEY_ISO_Group_Lock GDK_KEY_ISO_Next_Group GDK_KEY_ISO_Next_Group_Lock GDK_KEY_ISO_Prev_Group GDK_KEY_ISO_Prev_Group_Lock GDK_KEY_ISO_First_Group GDK_KEY_ISO_First_Group_Lock GDK_KEY_ISO_Last_Group GDK_KEY_ISO_Last_Group_Lock GDK_KEY_ISO_Left_Tab GDK_KEY_ISO_Move_Line_Up GDK_KEY_ISO_Move_Line_Down GDK_KEY_ISO_Partial_Line_Up GDK_KEY_ISO_Partial_Line_Down GDK_KEY_ISO_Partial_Space_Left GDK_KEY_ISO_Partial_Space_Right GDK_KEY_ISO_Set_Margin_Left GDK_KEY_ISO_Set_Margin_Right GDK_KEY_ISO_Release_Margin_Left GDK_KEY_ISO_Release_Margin_Right GDK_KEY_ISO_Release_Both_Margins GDK_KEY_ISO_Fast_Cursor_Left GDK_KEY_ISO_Fast_Cursor_Right GDK_KEY_ISO_Fast_Cursor_Up GDK_KEY_ISO_Fast_Cursor_Down GDK_KEY_ISO_Continuous_Underline

GDK_KEY_ISO_Discontinuous_Underline GDK_KEY_ISO_Emphasize GDK_KEY_ISO_Center_Object GDK_KEY_ISO_Enter GDK_KEY_dead_grave GDK_KEY_dead_acute GDK_KEY_dead_circumflex GDK_KEY_dead_tilde GDK_KEY_dead_macron GDK_KEY_dead_breve GDK_KEY_dead_abovedot GDK_KEY_dead_diaeresis GDK_KEY_dead_abovering GDK_KEY_dead_doubleacute GDK_KEY_dead_caron GDK_KEY_dead_cedilla GDK_KEY_dead_ogonek GDK_KEY_dead_iota GDK_KEY_dead_voiced_sound GDK_KEY_dead_semivoiced_sound GDK_KEY_dead_belowdot GDK_KEY_First_Virtual_Screen GDK_KEY_Prev_Virtual_Screen GDK_KEY_Next_Virtual_Screen GDK_KEY_Last_Virtual_Screen GDK_KEY_Terminate_Server GDK_KEY_AccessX_Enable GDK_KEY_AccessX_Feedback_Enable GDK_KEY_RepeatKeys_Enable GDK_KEY_SlowKeys_Enable GDK_KEY_BounceKeys_Enable GDK_KEY_StickyKeys_Enable GDK_KEY_MouseKeys_Enable GDK_KEY_MouseKeys_Accel_Enable GDK_KEY_Overlay1_Enable GDK_KEY_Overlay2_Enable GDK_KEY_AudibleBell_Enable GDK_KEY_Pointer_Left GDK_KEY_Pointer_Right GDK_KEY_Pointer_Up GDK_KEY_Pointer_Down GDK_KEY_Pointer_UpLeft GDK_KEY_Pointer_UpRight GDK_KEY_Pointer_DownLeft GDK_KEY_Pointer_DownRight GDK_KEY_Pointer_Button_Dflt GDK_KEY_Pointer_Button1 GDK_KEY_Pointer_Button2 GDK_KEY_Pointer_Button3 GDK_KEY_Pointer_Button4 GDK_KEY_Pointer_Button5 GDK_KEY_Pointer_DblClick_Dflt GDK_KEY_Pointer_DblClick1 GDK_KEY_Pointer_DblClick2

GDK_KEY_Pointer_DblClick3 GDK_KEY_Pointer_DblClick4 GDK_KEY_Pointer_DblClick5 GDK_KEY_Pointer_Drag_Dflt GDK_KEY_Pointer_Drag1 GDK_KEY_Pointer_Drag2 GDK_KEY_Pointer_Drag3 GDK_KEY_Pointer_Drag4 GDK_KEY_Pointer_Drag5 GDK_KEY_Pointer_EnableKeys GDK_KEY_Pointer_Accelerate GDK_KEY_Pointer_DfltBtnNext GDK_KEY_Pointer_DfltBtnPrev GDK_KEY_3270_Duplicate GDK_KEY_3270_FieldMark GDK_KEY_3270_Right2 GDK_KEY_3270_Left2 GDK_KEY_3270_BackTab GDK_KEY_3270_EraseEOF GDK_KEY_3270_EraseInput GDK_KEY_3270_Reset GDK_KEY_3270_Quit GDK_KEY_3270_PA1 GDK_KEY_3270_PA2 GDK_KEY_3270_PA3 GDK_KEY_3270_Test GDK_KEY_3270_Attn GDK_KEY_3270_CursorBlink GDK_KEY_3270_AltCursor GDK_KEY_3270_KeyClick GDK_KEY_3270_Jump GDK_KEY_3270_Ident GDK_KEY_3270_Rule GDK_KEY_3270_Copy GDK_KEY_3270_Play GDK_KEY_3270_Setup GDK_KEY_3270_Record GDK_KEY_3270_ChangeScreen GDK_KEY_3270_DeleteWord GDK_KEY_3270_ExSelect GDK_KEY_3270_CursorSelect GDK_KEY_3270_PrintScreen GDK_KEY_3270_Enter GDK_KEY_space GDK_KEY_exclam GDK_KEY_quotedbl GDK_KEY_numbersign GDK_KEY_dollar GDK_KEY_percent GDK_KEY_ampersand GDK_KEY_apostrophe GDK_KEY_quoteright GDK_KEY_parenleft GDK_KEY_parenright

GDK_KEY_asterisk GDK_KEY_plus GDK_KEY_comma GDK_KEY_minus GDK_KEY_period GDK_KEY_slash GDK_KEY_0 GDK_KEY_1 GDK_KEY_2 GDK_KEY_3 GDK_KEY_4 GDK_KEY_5 GDK_KEY_6 GDK_KEY_7 GDK_KEY_8 GDK_KEY_9 GDK_KEY_colon GDK_KEY_semicolon GDK_KEY_less GDK_KEY_equal GDK_KEY_greater GDK_KEY_question GDK_KEY_at GDK_KEY_A GDK_KEY_B GDK_KEY_C GDK_KEY_D GDK_KEY_E GDK_KEY_F GDK_KEY_G GDK_KEY_H GDK_KEY_I GDK_KEY_J GDK_KEY_K GDK_KEY_L GDK_KEY_M GDK_KEY_N GDK_KEY_O GDK_KEY_P GDK_KEY_Q GDK_KEY_R GDK_KEY_S GDK_KEY_T GDK_KEY_U GDK_KEY_V GDK_KEY_W GDK_KEY_X GDK_KEY_Y GDK_KEY_Z GDK_KEY_bracketleft GDK_KEY_backslash GDK_KEY_bracketright GDK_KEY_asciicircum GDK_KEY_underscore

GDK_KEY_grave GDK_KEY_quoteleft GDK_KEY__a GDK_KEY__b GDK_KEY__c GDK_KEY__d GDK_KEY__e GDK_KEY__f GDK_KEY__g GDK_KEY__h GDK_KEY__i GDK_KEY__j GDK_KEY__k GDK_KEY__l GDK_KEY__m GDK_KEY__n GDK_KEY__o GDK_KEY__p GDK_KEY__q GDK_KEY__r GDK_KEY__s GDK_KEY__t GDK_KEY__u GDK_KEY__v GDK_KEY__w GDK_KEY__x GDK_KEY__y GDK_KEY__z GDK_KEY_braceleft GDK_KEY_bar GDK_KEY_braceright GDK_KEY_asciitilde GDK_KEY_nobreakspace GDK_KEY_exclamdown GDK_KEY_cent GDK_KEY_sterling GDK_KEY_currency GDK_KEY_yen GDK_KEY_brokenbar GDK_KEY_section GDK_KEY_diaeresis GDK_KEY_copyright GDK_KEY_ordfeminine GDK_KEY_guillemotleft GDK_KEY_notsign GDK_KEY_hyphen GDK_KEY_registered GDK_KEY_macron GDK_KEY_degree GDK_KEY_plusminus GDK_KEY_twosuperior GDK_KEY_threesuperior GDK_KEY_acute GDK_KEY_mu

GDK_KEY_paragraph GDK_KEY_periodcentered GDK_KEY_cedilla GDK_KEY_onesuperior GDK_KEY_masculine GDK_KEY_guillemotright GDK_KEY_onequarter GDK_KEY_onehalf GDK_KEY_threequarters GDK_KEY_questiondown GDK_KEY_Agrave GDK_KEY_Aacute GDK_KEY_Acircumflex GDK_KEY_Atilde GDK_KEY_Adiaeresis GDK_KEY_Aring GDK_KEY_AE GDK_KEY_Ccedilla GDK_KEY_Egrave GDK_KEY_Eacute GDK_KEY_Ecircumflex GDK_KEY_Ediaeresis GDK_KEY_Igrave GDK_KEY_Iacute GDK_KEY_Icircumflex GDK_KEY_Idiaeresis GDK_KEY_ETH GDK_KEY__Eth GDK_KEY_Ntilde GDK_KEY_Ograve GDK_KEY_Oacute GDK_KEY_Ocircumflex GDK_KEY_Otilde GDK_KEY_Odiaeresis GDK_KEY_multiply GDK_KEY_Ooblique GDK_KEY_Ugrave GDK_KEY_Uacute GDK_KEY_Ucircumflex GDK_KEY_Udiaeresis GDK_KEY_Yacute GDK_KEY_THORN GDK_KEY__Thorn GDK_KEY_ssharp GDK_KEY__agrave GDK_KEY__aacute GDK_KEY__acircumflex GDK_KEY__atilde GDK_KEY__adiaeresis GDK_KEY__aring GDK_KEY__ae GDK_KEY__ccedilla GDK_KEY__egrave GDK_KEY__eacute

GDK_KEY__ecircumflex GDK_KEY__ediaeresis GDK_KEY__igrave GDK_KEY__iacute GDK_KEY__icircumflex GDK_KEY__idiaeresis GDK_KEY___eth GDK_KEY__ntilde GDK_KEY__ograve GDK_KEY__oacute GDK_KEY__ocircumflex GDK_KEY__otilde GDK_KEY__odiaeresis GDK_KEY_division GDK_KEY_oslash GDK_KEY__ugrave GDK_KEY__uacute GDK_KEY__ucircumflex GDK_KEY__udiaeresis GDK_KEY__yacute GDK_KEY___thorn GDK_KEY_ydiaeresis GDK_KEY_Aogonek GDK_KEY_breve GDK_KEY_Lstroke GDK_KEY_Lcaron GDK_KEY_Sacute GDK_KEY_Scaron GDK_KEY_Scedilla GDK_KEY_Tcaron GDK_KEY_Zacute GDK_KEY_Zcaron GDK_KEY_Zabovedot GDK_KEY__aogonek GDK_KEY_ogonek GDK_KEY__lstroke GDK_KEY__lcaron GDK_KEY__sacute GDK_KEY_caron GDK_KEY__scaron GDK_KEY__scedilla GDK_KEY__tcaron GDK_KEY__zacute GDK_KEY_doubleacute GDK_KEY__zcaron GDK_KEY__zabovedot GDK_KEY_Racute GDK_KEY_Abreve GDK_KEY_Lacute GDK_KEY_Cacute GDK_KEY_Ccaron GDK_KEY_Eogonek GDK_KEY_Ecaron GDK_KEY_Dcaron

GDK_KEY_Dstroke GDK_KEY_Nacute GDK_KEY_Ncaron GDK_KEY_Odoubleacute GDK_KEY_Rcaron GDK_KEY_Uring GDK_KEY_Udoubleacute GDK_KEY_Tcedilla GDK_KEY__racute GDK_KEY__abreve GDK_KEY__lacute GDK_KEY__cacute GDK_KEY__ccaron GDK_KEY__eogonek GDK_KEY__ecaron GDK_KEY__dcaron GDK_KEY__dstroke GDK_KEY__nacute GDK_KEY__ncaron GDK_KEY__odoubleacute GDK_KEY__udoubleacute GDK_KEY__rcaron GDK_KEY__uring GDK_KEY__tcedilla GDK_KEY_abovedot GDK_KEY_Hstroke GDK_KEY_Hcircumflex GDK_KEY_Iabovedot GDK_KEY_Gbreve GDK_KEY_Jcircumflex GDK_KEY__hstroke GDK_KEY__hcircumflex GDK_KEY_idotless GDK_KEY__gbreve GDK_KEY__jcircumflex GDK_KEY_Cabovedot GDK_KEY_Ccircumflex GDK_KEY_Gabovedot GDK_KEY_Gcircumflex GDK_KEY_Ubreve GDK_KEY_Scircumflex GDK_KEY__cabovedot GDK_KEY__ccircumflex GDK_KEY__gabovedot GDK_KEY__gcircumflex GDK_KEY__ubreve GDK_KEY__scircumflex GDK_KEY_kra GDK_KEY_kappa GDK_KEY_Rcedilla GDK_KEY_Itilde GDK_KEY_Lcedilla GDK_KEY_Emacron GDK_KEY_Gcedilla

GDK_KEY_Tslash GDK_KEY__rcedilla GDK_KEY__itilde GDK_KEY__lcedilla GDK_KEY__emacron GDK_KEY__gcedilla GDK_KEY__tslash GDK_KEY_ENG GDK_KEY__eng GDK_KEY_Amacron GDK_KEY_Iogonek GDK_KEY_Eabovedot GDK_KEY_Imacron GDK_KEY_Ncedilla GDK_KEY_Omacron GDK_KEY_Kcedilla GDK_KEY_Uogonek GDK_KEY_Utilde GDK_KEY_Umacron GDK_KEY__amacron GDK_KEY__iogonek GDK_KEY__eabovedot GDK_KEY__imacron GDK_KEY__ncedilla GDK_KEY__omacron GDK_KEY__kcedilla GDK_KEY__uogonek GDK_KEY__utilde GDK_KEY__umacron GDK_KEY_overline GDK_KEY_kana_fullstop GDK_KEY_kana_openingbracket GDK_KEY_kana_closingbracket GDK_KEY_kana_comma GDK_KEY_kana_conjunctive GDK_KEY_kana_middledot GDK_KEY_kana_WO GDK_KEY_kana_a GDK_KEY_kana_i GDK_KEY_kana_u GDK_KEY_kana_e GDK_KEY_kana_o GDK_KEY_kana_ya GDK_KEY_kana_yu GDK_KEY_kana_yo GDK_KEY_kana_tsu GDK_KEY_kana_tu GDK_KEY_prolongedsound GDK_KEY__kana_A GDK_KEY__kana_I GDK_KEY__kana_U GDK_KEY__kana_E GDK_KEY__kana_O GDK_KEY_kana_KA

GDK_KEY_kana_KI GDK_KEY_kana_KU GDK_KEY_kana_KE GDK_KEY_kana_KO GDK_KEY_kana_SA GDK_KEY_kana_SHI GDK_KEY_kana_SU GDK_KEY_kana_SE GDK_KEY_kana_SO GDK_KEY_kana_TA GDK_KEY_kana_CHI GDK_KEY_kana_TI GDK_KEY__kana_TSU GDK_KEY__kana_TU GDK_KEY_kana_TE GDK_KEY_kana_TO GDK_KEY_kana_NA GDK_KEY_kana_NI GDK_KEY_kana_NU GDK_KEY_kana_NE GDK_KEY_kana_NO GDK_KEY_kana_HA GDK_KEY_kana_HI GDK_KEY_kana_FU GDK_KEY_kana_HU GDK_KEY_kana_HE GDK_KEY_kana_HO GDK_KEY_kana_MA GDK_KEY_kana_MI GDK_KEY_kana_MU GDK_KEY_kana_ME GDK_KEY_kana_MO GDK_KEY__kana_YA GDK_KEY__kana_YU GDK_KEY__kana_YO GDK_KEY_kana_RA GDK_KEY_kana_RI GDK_KEY_kana_RU GDK_KEY_kana_RE GDK_KEY_kana_RO GDK_KEY_kana_WA GDK_KEY_kana_N GDK_KEY_voicedsound GDK_KEY_semivoicedsound GDK_KEY_kana_switch GDK_KEY_Arabic_comma GDK_KEY_Arabic_semicolon GDK_KEY_Arabic_question_mark GDK_KEY_Arabic_hamza GDK_KEY_Arabic_maddaonalef GDK_KEY_Arabic_hamzaonalef GDK_KEY_Arabic_hamzaonwaw GDK_KEY_Arabic_hamzaunderalef GDK_KEY_Arabic_hamzaonyeh

GDK_KEY_Arabic_alef GDK_KEY_Arabic_beh GDK_KEY_Arabic_tehmarbuta GDK_KEY_Arabic_teh GDK_KEY_Arabic_theh GDK_KEY_Arabic_jeem GDK_KEY_Arabic_hah GDK_KEY_Arabic_khah GDK_KEY_Arabic_dal GDK_KEY_Arabic_thal GDK_KEY_Arabic_ra GDK_KEY_Arabic_zain GDK_KEY_Arabic_seen GDK_KEY_Arabic_sheen GDK_KEY_Arabic_sad GDK_KEY_Arabic_dad GDK_KEY_Arabic_tah GDK_KEY_Arabic_zah GDK_KEY_Arabic_ain GDK_KEY_Arabic_ghain GDK_KEY_Arabic_tatweel GDK_KEY_Arabic_feh GDK_KEY_Arabic_qaf GDK_KEY_Arabic_kaf GDK_KEY_Arabic_lam GDK_KEY_Arabic_meem GDK_KEY_Arabic_noon GDK_KEY_Arabic_ha GDK_KEY_Arabic_heh GDK_KEY_Arabic_waw GDK_KEY_Arabic_alefmaksura GDK_KEY_Arabic_yeh GDK_KEY_Arabic_fathatan GDK_KEY_Arabic_dammatan GDK_KEY_Arabic_kasratan GDK_KEY_Arabic_fatha GDK_KEY_Arabic_damma GDK_KEY_Arabic_kasra GDK_KEY_Arabic_shadda GDK_KEY_Arabic_sukun GDK_KEY_Arabic_switch GDK_KEY_Serbian_dje GDK_KEY_Macedonia_gje GDK_KEY_Cyrillic_io GDK_KEY_Ukrainian_ie GDK_KEY_Ukranian_je GDK_KEY_Macedonia_dse GDK_KEY_Ukrainian_i GDK_KEY_Ukranian_i GDK_KEY_Ukrainian_yi GDK_KEY_Ukranian_yi GDK_KEY_Cyrillic_je GDK_KEY_Serbian_je GDK_KEY_Cyrillic_lje

GDK_KEY_Serbian_lje GDK_KEY_Cyrillic_nje GDK_KEY_Serbian_nje GDK_KEY_Serbian_tshe GDK_KEY_Macedonia_kje GDK_KEY_Byelorussian_shortu GDK_KEY_Cyrillic_dzhe GDK_KEY_Serbian_dze GDK_KEY_numerosign GDK_KEY__Serbian_DJE GDK_KEY__Macedonia_GJE GDK_KEY__Cyrillic_IO GDK_KEY__Ukrainian_IE GDK_KEY__Ukranian_JE GDK_KEY__Macedonia_DSE GDK_KEY__Ukrainian_I GDK_KEY__Ukranian_I GDK_KEY__Ukrainian_YI GDK_KEY__Ukranian_YI GDK_KEY__Cyrillic_JE GDK_KEY__Serbian_JE GDK_KEY__Cyrillic_LJE GDK_KEY__Serbian_LJE GDK_KEY__Cyrillic_NJE GDK_KEY__Serbian_NJE GDK_KEY__Serbian_TSHE GDK_KEY__Macedonia_KJE GDK_KEY__Byelorussian_SHORTU GDK_KEY__Cyrillic_DZHE GDK_KEY__Serbian_DZE GDK_KEY_Cyrillic_yu GDK_KEY_Cyrillic_a GDK_KEY_Cyrillic_be GDK_KEY_Cyrillic_tse GDK_KEY_Cyrillic_de GDK_KEY_Cyrillic_ie GDK_KEY_Cyrillic_ef GDK_KEY_Cyrillic_ghe GDK_KEY_Cyrillic_ha GDK_KEY_Cyrillic_i GDK_KEY_Cyrillic_shorti GDK_KEY_Cyrillic_ka GDK_KEY_Cyrillic_el GDK_KEY_Cyrillic_em GDK_KEY_Cyrillic_en GDK_KEY_Cyrillic_o GDK_KEY_Cyrillic_pe GDK_KEY_Cyrillic_ya GDK_KEY_Cyrillic_er GDK_KEY_Cyrillic_es GDK_KEY_Cyrillic_te GDK_KEY_Cyrillic_u GDK_KEY_Cyrillic_zhe GDK_KEY_Cyrillic_ve

GDK_KEY_Cyrillic_softsign GDK_KEY_Cyrillic_yeru GDK_KEY_Cyrillic_ze GDK_KEY_Cyrillic_sha GDK_KEY_Cyrillic_e GDK_KEY_Cyrillic_shcha GDK_KEY_Cyrillic_che GDK_KEY_Cyrillic_hardsign GDK_KEY__Cyrillic_YU GDK_KEY__Cyrillic_A GDK_KEY__Cyrillic_BE GDK_KEY__Cyrillic_TSE GDK_KEY__Cyrillic_DE GDK_KEY__Cyrillic_IE GDK_KEY__Cyrillic_EF GDK_KEY__Cyrillic_GHE GDK_KEY__Cyrillic_HA GDK_KEY__Cyrillic_I GDK_KEY__Cyrillic_SHORTI GDK_KEY__Cyrillic_KA GDK_KEY__Cyrillic_EL GDK_KEY__Cyrillic_EM GDK_KEY__Cyrillic_EN GDK_KEY__Cyrillic_O GDK_KEY__Cyrillic_PE GDK_KEY__Cyrillic_YA GDK_KEY__Cyrillic_ER GDK_KEY__Cyrillic_ES GDK_KEY__Cyrillic_TE GDK_KEY__Cyrillic_U GDK_KEY__Cyrillic_ZHE GDK_KEY__Cyrillic_VE GDK_KEY__Cyrillic_SOFTSIGN GDK_KEY__Cyrillic_YERU GDK_KEY__Cyrillic_ZE GDK_KEY__Cyrillic_SHA GDK_KEY__Cyrillic_E GDK_KEY__Cyrillic_SHCHA GDK_KEY__Cyrillic_CHE GDK_KEY__Cyrillic_HARDSIGN GDK_KEY_Greek_ALPHAaccent GDK_KEY_Greek_EPSILONaccent GDK_KEY_Greek_ETAaccent GDK_KEY_Greek_IOTAaccent GDK_KEY_Greek_IOTAdiaeresis GDK_KEY_Greek_OMICRONaccent GDK_KEY_Greek_UPSILONaccent GDK_KEY_Greek_UPSILONdieresis GDK_KEY_Greek_OMEGAaccent GDK_KEY_Greek_accentdieresis GDK_KEY_Greek_horizbar GDK_KEY__Greek_alphaaccent GDK_KEY__Greek_epsilonaccent GDK_KEY__Greek_etaaccent

GDK_KEY__Greek_iotaaccent GDK_KEY_Greek_iotadieresis GDK_KEY_Greek_iotaaccentdieresis GDK_KEY__Greek_omicronaccent GDK_KEY__Greek_upsilonaccent GDK_KEY__Greek_upsilondieresis GDK_KEY_Greek_upsilonaccentdieresis GDK_KEY__Greek_omegaaccent GDK_KEY_Greek_ALPHA GDK_KEY_Greek_BETA GDK_KEY_Greek_GAMMA GDK_KEY_Greek_DELTA GDK_KEY_Greek_EPSILON GDK_KEY_Greek_ZETA GDK_KEY_Greek_ETA GDK_KEY_Greek_THETA GDK_KEY_Greek_IOTA GDK_KEY_Greek_KAPPA GDK_KEY_Greek_LAMDA GDK_KEY_Greek_LAMBDA GDK_KEY_Greek_MU GDK_KEY_Greek_NU GDK_KEY_Greek_XI GDK_KEY_Greek_OMICRON GDK_KEY_Greek_PI GDK_KEY_Greek_RHO GDK_KEY_Greek_SIGMA GDK_KEY_Greek_TAU GDK_KEY_Greek_UPSILON GDK_KEY_Greek_PHI GDK_KEY_Greek_CHI GDK_KEY_Greek_PSI GDK_KEY_Greek_OMEGA GDK_KEY__Greek_alpha GDK_KEY__Greek_beta GDK_KEY__Greek_gamma GDK_KEY__Greek_delta GDK_KEY__Greek_epsilon GDK_KEY__Greek_zeta GDK_KEY__Greek_eta GDK_KEY__Greek_theta GDK_KEY__Greek_iota GDK_KEY__Greek_kappa GDK_KEY__Greek_lamda GDK_KEY__Greek_lambda GDK_KEY__Greek_mu GDK_KEY__Greek_nu GDK_KEY__Greek_xi GDK_KEY__Greek_omicron GDK_KEY__Greek_pi GDK_KEY__Greek_rho GDK_KEY__Greek_sigma GDK_KEY_Greek_finalsmallsigma GDK_KEY__Greek_tau

GDK_KEY__Greek_upsilon GDK_KEY__Greek_phi GDK_KEY__Greek_chi GDK_KEY__Greek_psi GDK_KEY__Greek_omega GDK_KEY_Greek_switch GDK_KEY_leftradical GDK_KEY_topleftradical GDK_KEY_horizconnector GDK_KEY_topintegral GDK_KEY_botintegral GDK_KEY_vertconnector GDK_KEY_topleftsqbracket GDK_KEY_botleftsqbracket GDK_KEY_toprightsqbracket GDK_KEY_botrightsqbracket GDK_KEY_topleftparens GDK_KEY_botleftparens GDK_KEY_toprightparens GDK_KEY_botrightparens GDK_KEY_leftmiddlecurlybrace GDK_KEY_rightmiddlecurlybrace GDK_KEY_topleftsummation GDK_KEY_botleftsummation GDK_KEY_topvertsummationconnector GDK_KEY_botvertsummationconnector GDK_KEY_toprightsummation GDK_KEY_botrightsummation GDK_KEY_rightmiddlesummation GDK_KEY_lessthanequal GDK_KEY_notequal GDK_KEY_greaterthanequal GDK_KEY_integral GDK_KEY_therefore GDK_KEY_variation GDK_KEY_infinity GDK_KEY_nabla GDK_KEY_approximate GDK_KEY_similarequal GDK_KEY_ifonlyif GDK_KEY_implies GDK_KEY_identical GDK_KEY_radical GDK_KEY_includedin GDK_KEY_includes GDK_KEY_intersection GDK_KEY_union GDK_KEY_logicaland GDK_KEY_logicalor GDK_KEY_partialderivative GDK_KEY_function GDK_KEY_leftarrow GDK_KEY_uparrow GDK_KEY_rightarrow

GDK_KEY_downarrow GDK_KEY_blank GDK_KEY_soliddiamond GDK_KEY_checkerboard GDK_KEY_ht GDK_KEY_ff GDK_KEY_cr GDK_KEY_lf GDK_KEY_nl GDK_KEY_vt GDK_KEY_lowrightcorner GDK_KEY_uprightcorner GDK_KEY_upleftcorner GDK_KEY_lowleftcorner GDK_KEY_crossinglines GDK_KEY_horizlinescan1 GDK_KEY_horizlinescan3 GDK_KEY_horizlinescan5 GDK_KEY_horizlinescan7 GDK_KEY_horizlinescan9 GDK_KEY_leftt GDK_KEY_rightt GDK_KEY_bott GDK_KEY_topt GDK_KEY_vertbar GDK_KEY_emspace GDK_KEY_enspace GDK_KEY_em3space GDK_KEY_em4space GDK_KEY_digitspace GDK_KEY_punctspace GDK_KEY_thinspace GDK_KEY_hairspace GDK_KEY_emdash GDK_KEY_endash GDK_KEY_signifblank GDK_KEY_ellipsis GDK_KEY_doubbaselinedot GDK_KEY_onethird GDK_KEY_twothirds GDK_KEY_onefifth GDK_KEY_twofifths GDK_KEY_threefifths GDK_KEY_fourfifths GDK_KEY_onesixth GDK_KEY_fivesixths GDK_KEY_careof GDK_KEY_figdash GDK_KEY_leftanglebracket GDK_KEY_decimalpoint GDK_KEY_rightanglebracket GDK_KEY_marker GDK_KEY_oneeighth GDK_KEY_threeeighths

GDK_KEY_fiveeighths GDK_KEY_seveneighths GDK_KEY_trademark GDK_KEY_signaturemark GDK_KEY_trademarkincircle GDK_KEY_leftopentriangle GDK_KEY_rightopentriangle GDK_KEY_emopencircle GDK_KEY_emopenrectangle GDK_KEY_leftsinglequotemark GDK_KEY_rightsinglequotemark GDK_KEY_leftdoublequotemark GDK_KEY_rightdoublequotemark GDK_KEY_prescription GDK_KEY_minutes GDK_KEY_seconds GDK_KEY_latincross GDK_KEY_hexagram GDK_KEY_filledrectbullet GDK_KEY_filledlefttribullet GDK_KEY_filledrighttribullet GDK_KEY_emfilledcircle GDK_KEY_emfilledrect GDK_KEY_enopencircbullet GDK_KEY_enopensquarebullet GDK_KEY_openrectbullet GDK_KEY_opentribulletup GDK_KEY_opentribulletdown GDK_KEY_openstar GDK_KEY_enfilledcircbullet GDK_KEY_enfilledsqbullet GDK_KEY_filledtribulletup GDK_KEY_filledtribulletdown GDK_KEY_leftpointer GDK_KEY_rightpointer GDK_KEY_club GDK_KEY_diamond GDK_KEY_heart GDK_KEY_maltesecross GDK_KEY_dagger GDK_KEY_doubledagger GDK_KEY_checkmark GDK_KEY_ballotcross GDK_KEY_musicalsharp GDK_KEY_musicalflat GDK_KEY_malesymbol GDK_KEY_femalesymbol GDK_KEY_telephone GDK_KEY_telephonerecorder GDK_KEY_phonographcopyright GDK_KEY_caret GDK_KEY_singlelowquotemark GDK_KEY_doublelowquotemark GDK_KEY_cursor

GDK_KEY_leftcaret GDK_KEY_rightcaret GDK_KEY_downcaret GDK_KEY_upcaret GDK_KEY_overbar GDK_KEY_downtack GDK_KEY_upshoe GDK_KEY_downstile GDK_KEY_underbar GDK_KEY_jot GDK_KEY_quad GDK_KEY_uptack GDK_KEY_circle GDK_KEY_upstile GDK_KEY_downshoe GDK_KEY_rightshoe GDK_KEY_leftshoe GDK_KEY_lefttack GDK_KEY_righttack GDK_KEY_hebrew_doublelowline GDK_KEY_hebrew_aleph GDK_KEY_hebrew_bet GDK_KEY_hebrew_beth GDK_KEY_hebrew_gimel GDK_KEY_hebrew_gimmel GDK_KEY_hebrew_dalet GDK_KEY_hebrew_daleth GDK_KEY_hebrew_he GDK_KEY_hebrew_waw GDK_KEY_hebrew_zain GDK_KEY_hebrew_zayin GDK_KEY_hebrew_chet GDK_KEY_hebrew_het GDK_KEY_hebrew_tet GDK_KEY_hebrew_teth GDK_KEY_hebrew_yod GDK_KEY_hebrew_finalkaph GDK_KEY_hebrew_kaph GDK_KEY_hebrew_lamed GDK_KEY_hebrew_finalmem GDK_KEY_hebrew_mem GDK_KEY_hebrew_finalnun GDK_KEY_hebrew_nun GDK_KEY_hebrew_samech GDK_KEY_hebrew_samekh GDK_KEY_hebrew_ayin GDK_KEY_hebrew_finalpe GDK_KEY_hebrew_pe GDK_KEY_hebrew_finalzade GDK_KEY_hebrew_finalzadi GDK_KEY_hebrew_zade GDK_KEY_hebrew_zadi GDK_KEY_hebrew_qoph GDK_KEY_hebrew_kuf

GDK_KEY_hebrew_resh GDK_KEY_hebrew_shin GDK_KEY_hebrew_taw GDK_KEY_hebrew_taf GDK_KEY_Hebrew_switch GDK_KEY_Thai_kokai GDK_KEY_Thai_khokhai GDK_KEY_Thai_khokhuat GDK_KEY_Thai_khokhwai GDK_KEY_Thai_khokhon GDK_KEY_Thai_khorakhang GDK_KEY_Thai_ngongu GDK_KEY_Thai_chochan GDK_KEY_Thai_choching GDK_KEY_Thai_chochang GDK_KEY_Thai_soso GDK_KEY_Thai_chochoe GDK_KEY_Thai_yoying GDK_KEY_Thai_dochada GDK_KEY_Thai_topatak GDK_KEY_Thai_thothan GDK_KEY_Thai_thonangmontho GDK_KEY_Thai_thophuthao GDK_KEY_Thai_nonen GDK_KEY_Thai_dodek GDK_KEY_Thai_totao GDK_KEY_Thai_thothung GDK_KEY_Thai_thothahan GDK_KEY_Thai_thothong GDK_KEY_Thai_nonu GDK_KEY_Thai_bobaimai GDK_KEY_Thai_popla GDK_KEY_Thai_phophung GDK_KEY_Thai_fofa GDK_KEY_Thai_phophan GDK_KEY_Thai_fofan GDK_KEY_Thai_phosamphao GDK_KEY_Thai_moma GDK_KEY_Thai_yoyak GDK_KEY_Thai_rorua GDK_KEY_Thai_ru GDK_KEY_Thai_loling GDK_KEY_Thai_lu GDK_KEY_Thai_wowaen GDK_KEY_Thai_sosala GDK_KEY_Thai_sorusi GDK_KEY_Thai_sosua GDK_KEY_Thai_hohip GDK_KEY_Thai_lochula GDK_KEY_Thai_oang GDK_KEY_Thai_honokhuk GDK_KEY_Thai_paiyannoi GDK_KEY_Thai_saraa GDK_KEY_Thai_maihanakat

GDK_KEY_Thai_saraaa GDK_KEY_Thai_saraam GDK_KEY_Thai_sarai GDK_KEY_Thai_saraii GDK_KEY_Thai_saraue GDK_KEY_Thai_sarauee GDK_KEY_Thai_sarau GDK_KEY_Thai_sarauu GDK_KEY_Thai_phinthu GDK_KEY_Thai_maihanakat_maitho GDK_KEY_Thai_baht GDK_KEY_Thai_sarae GDK_KEY_Thai_saraae GDK_KEY_Thai_sarao GDK_KEY_Thai_saraaimaimuan GDK_KEY_Thai_saraaimaimalai GDK_KEY_Thai_lakkhangyao GDK_KEY_Thai_maiyamok GDK_KEY_Thai_maitaikhu GDK_KEY_Thai_maiek GDK_KEY_Thai_maitho GDK_KEY_Thai_maitri GDK_KEY_Thai_maichattawa GDK_KEY_Thai_thanthakhat GDK_KEY_Thai_nikhahit GDK_KEY_Thai_leksun GDK_KEY_Thai_leknung GDK_KEY_Thai_leksong GDK_KEY_Thai_leksam GDK_KEY_Thai_leksi GDK_KEY_Thai_lekha GDK_KEY_Thai_lekhok GDK_KEY_Thai_lekchet GDK_KEY_Thai_lekpaet GDK_KEY_Thai_lekkao GDK_KEY_Hangul GDK_KEY_Hangul_Start GDK_KEY_Hangul_End GDK_KEY_Hangul_Hanja GDK_KEY_Hangul_Jamo GDK_KEY_Hangul_Romaja GDK_KEY_Hangul_Codeinput GDK_KEY_Hangul_Jeonja GDK_KEY_Hangul_Banja GDK_KEY_Hangul_PreHanja GDK_KEY_Hangul_PostHanja GDK_KEY_Hangul_SingleCandidate GDK_KEY_Hangul_MultipleCandidate GDK_KEY_Hangul_PreviousCandidate GDK_KEY_Hangul_Special GDK_KEY_Hangul_switch GDK_KEY_Hangul_Kiyeog GDK_KEY_Hangul_SsangKiyeog GDK_KEY_Hangul_KiyeogSios

GDK_KEY_Hangul_Nieun GDK_KEY_Hangul_NieunJieuj GDK_KEY_Hangul_NieunHieuh GDK_KEY_Hangul_Dikeud GDK_KEY_Hangul_SsangDikeud GDK_KEY_Hangul_Rieul GDK_KEY_Hangul_RieulKiyeog GDK_KEY_Hangul_RieulMieum GDK_KEY_Hangul_RieulPieub GDK_KEY_Hangul_RieulSios GDK_KEY_Hangul_RieulTieut GDK_KEY_Hangul_RieulPhieuf GDK_KEY_Hangul_RieulHieuh GDK_KEY_Hangul_Mieum GDK_KEY_Hangul_Pieub GDK_KEY_Hangul_SsangPieub GDK_KEY_Hangul_PieubSios GDK_KEY_Hangul_Sios GDK_KEY_Hangul_SsangSios GDK_KEY_Hangul_Ieung GDK_KEY_Hangul_Jieuj GDK_KEY_Hangul_SsangJieuj GDK_KEY_Hangul_Cieuc GDK_KEY_Hangul_Khieuq GDK_KEY_Hangul_Tieut GDK_KEY_Hangul_Phieuf GDK_KEY_Hangul_Hieuh GDK_KEY_Hangul_A GDK_KEY_Hangul_AE GDK_KEY_Hangul_YA GDK_KEY_Hangul_YAE GDK_KEY_Hangul_EO GDK_KEY_Hangul_E GDK_KEY_Hangul_YEO GDK_KEY_Hangul_YE GDK_KEY_Hangul_O GDK_KEY_Hangul_WA GDK_KEY_Hangul_WAE GDK_KEY_Hangul_OE GDK_KEY_Hangul_YO GDK_KEY_Hangul_U GDK_KEY_Hangul_WEO GDK_KEY_Hangul_WE GDK_KEY_Hangul_WI GDK_KEY_Hangul_YU GDK_KEY_Hangul_EU GDK_KEY_Hangul_YI GDK_KEY_Hangul_I GDK_KEY_Hangul_J_Kiyeog GDK_KEY_Hangul_J_SsangKiyeog GDK_KEY_Hangul_J_KiyeogSios GDK_KEY_Hangul_J_Nieun GDK_KEY_Hangul_J_NieunJieuj GDK_KEY_Hangul_J_NieunHieuh

GDK_KEY_Hangul_J_Dikeud GDK_KEY_Hangul_J_Rieul GDK_KEY_Hangul_J_RieulKiyeog GDK_KEY_Hangul_J_RieulMieum GDK_KEY_Hangul_J_RieulPieub GDK_KEY_Hangul_J_RieulSios GDK_KEY_Hangul_J_RieulTieut GDK_KEY_Hangul_J_RieulPhieuf GDK_KEY_Hangul_J_RieulHieuh GDK_KEY_Hangul_J_Mieum GDK_KEY_Hangul_J_Pieub GDK_KEY_Hangul_J_PieubSios GDK_KEY_Hangul_J_Sios GDK_KEY_Hangul_J_SsangSios GDK_KEY_Hangul_J_Ieung GDK_KEY_Hangul_J_Jieuj GDK_KEY_Hangul_J_Cieuc GDK_KEY_Hangul_J_Khieuq GDK_KEY_Hangul_J_Tieut GDK_KEY_Hangul_J_Phieuf GDK_KEY_Hangul_J_Hieuh GDK_KEY_Hangul_RieulYeorinHieuh GDK_KEY_Hangul_SunkyeongeumMieum GDK_KEY_Hangul_SunkyeongeumPieub GDK_KEY_Hangul_PanSios GDK_KEY_Hangul_KkogjiDalrinIeung GDK_KEY_Hangul_SunkyeongeumPhieuf GDK_KEY_Hangul_YeorinHieuh GDK_KEY_Hangul_AraeA GDK_KEY_Hangul_AraeAE GDK_KEY_Hangul_J_PanSios GDK_KEY_Hangul_J_KkogjiDalrinIeung GDK_KEY_Hangul_J_YeorinHieuh GDK_KEY_Korean_Won