Jump to content
Fórum Script Brasil
  • 0

PHP GTK


Tenko

Question

Alguém poderia me ajudar?

Etou com um problema no desenvolvimento de uma Lib para GTK, sou novo nessa area.

Estou tentando executar um arquivo que gera uma janela com um botão e quando clico no botão aparece essa mensagem

Warning: Unable to invoke signal callback 'GTKFechaJanela' specified in /var/www/titan/teste/Sistem_GTK/Classes_GTK/GTKForm.php on line 59 in /var/www/titan/teste/Sistem_GTK/main.php on line 14

Alguém sabe o que pode ser?

Dividi o programa da seguinte forma

- main.php [ onde tenho um require para as classes que estou criando ]

main.php

<?php
    require_once "Classes_GTK/GTKForm.php";

    $oJanela         = new GtkWindow;
    $oJanela        -> set_title( "Rodrigo" );
    $oJanela        -> set_default_size( 800, 600 );
    
    // Formulários
    $oBotao            = GTKForm::Botao( "Fechar Janela", "CLICK", "GTKFechaJanela" );
    $oJanela         -> add( $oBotao );
    $oJanela         -> show_all();
    
    Gtk::main();
?>
E essa é o GTKForm
<?php

    require_once "GTKAcoes.php";
        
    class GTKForm extends GTKAcoes
    {
        /**
         * Construtor da classe Formulário
         *
         * @return GTKForm
         */

        public function GTKForm()
        {
        }
        
        public function Botao( $sTexto, $sEvento, $sAcao )
        {
            $oClasse             = get_class_methods( new GTKAcoes() );
            $iNumero_Metodos     = count( $oClasse );
            $fAchou             = false;
            
            $sTexto                = trim( $sTexto  );
            $sEvento            = trim( $sEvento );
            $sAcao                = trim( $sAcao      );
                        
            if( ! empty( $sAcao ) )
            {
                for ( $i = 0; $i < $iNumero_Metodos; $i++ )
                {
                    if( $sAcao == $oClasse[ $i ] ) 
                    {
                        $fAchou = true;
                        break;
                    }
                }
                
                if( ! $fAchou )
                {
                    GTKCaixaAlerta::GtkErro( "Função atribuida não encontrada." );
                }
                else
                {
                    if( ! empty( $sEvento ) )
                    {
                        $sEvento = strtoupper( $sEvento );
                        
                        switch ( $sEvento )
                        {
                            case "CLICK"    : $sEvento = "clicked"; break;
                            case "PRESS"    : $sEvento = "pressed"; break;
                            case "RELEASE"    : $sEvento = "relesed"; break;
                            case "ENTER"    : $sEvento = "enter" ; break;
                            case "LEAVE"    : $sEvento = "leave" ; break;
                            default            : $sEvento = "clicked"; break;
                        }
                        
                        $oBotao = new GtkButton( $sTexto );
                        $oBotao -> connect_simple( $sEvento, $sAcao );
                        
                        return $oBotao;
                    }
                    else
                    {
                        GTKCaixaAlerta::GtkErro( "Você atribuiu uma função mas não atribuiu o tipo de EVENTO.\nEVENTOS PERMITIDOS\n[ click, press, release, enter ou leave ]" );
                        
                        $oBotao = new GtkButton( $sTexto );
                        $oBotao -> connect_simple( 'clicked', '' );
                        
                        return $oBotao;                        
                    }
                }
            }
            else
            {
                $oBotao = new GtkButton( $sTexto );
                $oBotao -> connect_simple( 'clicked', 'GTKNaoAtribuido' );
                
                return $oBotao;
            }
        }
        
        public function Label( $sTexto )
        {
        }
        
        public function CaixaTexto()
        {
        }        
        
        public function Combo()
        {
        }
        
        public function CheckBox()
        {
        }
        
        public function Radio()
        {
        }
        
        public function Escala()
        {
        }
        
        public function Separador()
        {
        }
        
        public function Calendario()
        {
        }
        
        public function BarraProgresso()
        {
        }
    }
?>

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152k
    • Total Posts
      651.5k
×
×
  • Create New...