PHP-GTK: Criando Aplicações Gráficas com PHP Adianti Framework para PHP PHP Programando com Orientação a Objetos Criando Relatórios com PHP

[PHP-GTK] Colocar o cursor em uma input?

Pablo Dall'Oglio pablo em dalloglio.net
Sexta Dezembro 21 13:27:53 BRST 2007


Oi Josy,

Você colocou "$ths" no lugar de "$this" ;-)

abraço
Pablo

Em Sex, 2007-12-21 às 11:39 -0300, Josy R. L. escreveu:
> Oi Pablo, tentei da maneira q vc disse e permanece dando o mesmo
> erro..Call to a member function set_focus() on a object
>  
>  
> function recebe_resposta()
>    {
>     if ($this->socket) 
>    {
>     $resposta = fgets($this->socket, 37)."\n";
>     echo $resposta;
>     $this->textbuffer->set_text("$resposta"); 
>     $this->input_nome->set_text('');
>     $ths->window->set_focus($this->input_nome);
>    } 
>    else 
>     echo "Socket fora do ar!!";
>    }
>  
> -- 
> ___________________________________
> 
>                      Josy R.L.
>     EJ Target - Systems & Support
>        http://www.ejtarget.com.br
> ___________________________________ 
> 
>  
> Em 21/12/07, Pablo Dall'Oglio <pablo at dalloglio.net> escreveu: 
>         Oi Josy,
>         
>         tenta:
>         $ths->window->set_focus($this->input_nome);
>         
>         um abraço
>         Pablo
>         
>         Em Qui, 2007-12-20 às 16:44 -0300, Josy R. L. escreveu:
>         > É o q eu queria era das focus na input novamente, mas tentei
>         dessa
>         > forma q vc falou pq a janela é $window mesmo, mas nao deu
>         certo: da
>         > erro: Call to a member function set_focus() on a object 
>         > function MyClass()
>         >    {
>         >       $server = $this->server = '127.0.0.1';
>         >       $port   = $this->port   = '81';
>         >
>         >      $window = $this->window = new GtkWindow(); 
>         >      $window->set_title('..: CLIENT SOCKET :..');
>         >      $window->set_default_size(436,337);
>         >      $fixed = $this->fixed = new GtkFixed();
>         >
>         >      //CENTRALIZA JANELA
>         >      $window->set_position(GTK::WIN_POS_CENTER);
>         >
>         >      $this->conecta($this->server, $this->port); //CHAMA
>         CONEXÃO VIA
>         > SOCKETS
>         >      $pixbuf = GdkPixbuf::new_from_file('C:\php-gtk2\novo
>         \images 
>         > \logo_pequeno.jpg');
>         >            $imagem = new GtkImage;
>         >            $imagem->set_from_pixbuf($pixbuf);
>         >      $nome_cliente = $this->nome_cliente = new
>         GtkLabel('Cliente:'); 
>         >      $input_nome = $this->input_nome = new GtkEntry();
>         >      $buttom = $this->buttom = new
>         GtkToggleButton('Pesquisar');
>         >      $buttom->connect("clicked",array($this, "pesquisa")); 
>         >      $adj5 = new GtkAdjustment(0, 0, 100, 1, 0, 0);
>         >      $progress = $this->progress = new
>         GtkProgressBar( $adj5 );
>         >      $caixa = $this->caixa = new GTKTextView;
>         >      $textbuffer = $this->textbuffer = new GtkTextBuffer; 
>         >      $this->caixa->set_buffer($this->textbuffer);
>         >      $this->textbuffer->set_text('');
>         >
>         >            $input_nome->set_size_request(185,25);
>         >      $buttom->set_size_request(75,25); 
>         >      $progress->set_size_request(170,25);
>         >      $caixa ->set_size_request(400,90);
>         >
>         >      $fixed->put($imagem,14,11);
>         >      $fixed->put($nome_cliente,168,97);
>         >      $fixed->put($input_nome,221,91); 
>         >      $fixed->put($buttom,177,137);
>         >      $fixed->put($progress,125,180);
>         >      $fixed->put($caixa,18,230);
>         >
>         >      $window->add($fixed);
>         >      $window->show_all(); 
>         >    }
>         >
>         > function recebe_resposta()
>         >    {
>         >     if ($this->socket)
>         >    {
>         >     $resposta = fgets($this->socket, 37)."\n";
>         >     echo $resposta;
>         >     $this->textbuffer->set_text("$resposta"); 
>         >     $this->input_nome->set_text('');
>         >     $fixed->set_focus($this->input_nome);
>         >    }
>         >    else
>         >     echo "Socket fora do ar!!";
>         >    }
>         >
>         > -- 
>         > ___________________________________
>         >
>         >                      Josy R.L.
>         >     EJ Target - Systems & Support
>         >        http://www.ejtarget.com.br
>         > ___________________________________
>         >
>         >
>         > Em 20/12/07, Pablo Dall'Oglio <pablo at dalloglio.net>
>         escreveu:
>         >         Não sei se entendi direito, mas não seria: 
>         >
>         >         $window->set_focus($input);
>         >
>         >         onde $window é a janela e $input é o campo de
>         input ?
>         >
>         >         um abraço
>         >         Pablo
>         >
>         >
>         >         Em Qui, 2007-12-20 às 15:02 -0300, Josy R. L.
>         escreveu: 
>         >         >
>         >         > Tentei usando insert_at_cursor mas nao deu certo,
>         quero que
>         >         o cursor
>         >         > do mouse volte para a input depois da pesquisa..
>         >         > function MyClass() 
>         >         >    {
>         >         > $input_nome = $this->input_nome = new GtkEntry();
>         >         > $caixa = $this->caixa = new GTKTextView;
>         >         > $textbuffer = $this->textbuffer = new
>         GtkTextBuffer; 
>         >         > $this->caixa->set_buffer($this->textbuffer);
>         >         > ...
>         >         > }
>         >         >
>         >         > function recebe_resposta()
>         >         >    {
>         >         >     if ($this->socket)
>         >         >    {
>         >         >     $resposta = fgets($this->socket, 37)."\n";
>         >         >     echo $resposta;
>         >         >     $this->textbuffer->set_text("$resposta"); 
>         >         >     $this->input_nome->set_text('');
>         >         >     $this->textbuffer->insert_at_cursor(" "); <--
>         erro
>         >         >    }
>         >         >    else 
>         >         >     echo "Socket fora do ar!!";
>         >         >    }
>         >         >
>         >         > Não sei como localizar o cursor de novo na input??
>         >         >
>         >         > -- 
>         >         > ___________________________________
>         >         >
>         >         >                      Josy R.L.
>         >         >     EJ Target - Systems & Support
>         >         >        http://www.ejtarget.com.br
>         >         > ___________________________________
>         >         > _______________________________________________
>         >         > Lista mailing list
>         >         > Lista at php-gtk.com.br
>         >         >
>         http://lists.php-gtk.com.br/cgi-bin/mailman/listinfo/lista
>         >         --
>         >         um abraço! 
>         >         Pablo Dall'Oglio
>         >
>         >
>         >         _______________________________________________
>         >         Lista mailing list
>         >         Lista at php-gtk.com.br
>         >
>         http://lists.php-gtk.com.br/cgi-bin/mailman/listinfo/lista
>         >
>         >
>         >
>         >
>         > _______________________________________________ 
>         > Lista mailing list
>         > Lista at php-gtk.com.br
>         > http://lists.php-gtk.com.br/cgi-bin/mailman/listinfo/lista
>         --
>         um abraço!
>         Pablo Dall'Oglio
>         
>         
>         _______________________________________________
>         Lista mailing list
>         Lista at php-gtk.com.br
>         http://lists.php-gtk.com.br/cgi-bin/mailman/listinfo/lista
>         
> 
> 
> 
> _______________________________________________
> Lista mailing list
> Lista at php-gtk.com.br
> http://lists.php-gtk.com.br/cgi-bin/mailman/listinfo/lista
-- 
um abraço!
Pablo Dall'Oglio



More information about the Lista mailing list