/**
  * @name __construct()
  * @return Demo
  */
 public function __construct()
 {
     // Cria a janela
     $this->widgets['frmDemo'] = new GtkWindow();
     $this->widgets['frmDemo']->set_size_request(200, 200);
     $this->widgets['frmDemo']->set_position(Gtk::WIN_POS_CENTER_ALWAYS);
     $this->widgets['frmDemo']->connect("destroy", array($this, "frmDemo_unload"));
     $fix = new GtkFixed();
     // Cria o dialogo
     $file = Fabula::GtkFileChooserDialog("Abrir", $this->widgets['frmDemo'], FALSE);
     $file->set_select_multiple(TRUE);
     // Inicia o dialogo
     $files = $file->run();
     // Mostra no terminal os arquivos selecionados
     var_dump($files);
     // Mostra no terminal o diretorio
     echo $file->get_filepath();
     // Demo da utilização auto e filtro
     // Cria os filtros
     $filters = array(array("name" => "Videos AVI", "mime_type" => "video/x-msvideo"), array("name" => "Videos 3GP", "pattern" => "*.3gp"), array("name" => "Todos Videos", "mime_type" => "video/*"));
     $file = Fabula::GtkFileChooserDialog("Abrir", $this->widgets['frmDemo'], TRUE, Gtk::FILE_CHOOSER_ACTION_OPEN, $filters);
     // Mostra no terminal os arquivos selecionados
     var_dump($file->get_filenames());
     // Mostra no terminal o diretorio
     echo $file->get_filepath();
     // Inicia a aplicação
     $this->widgets['frmDemo']->add($fix);
     $this->frmDemo_onload();
 }
Exemplo n.º 2
0
 /**
  * Métood click do btnOpen
  * 
  * @name btnOpen_click
  */
 public function btnOpen_click()
 {
     // Cria os filtros
     $filters = array(array("name" => "Videos AVI", "mime_type" => "video/x-msvideo"), array("name" => "Videos 3GP", "pattern" => "*.3gp"), array("name" => "Todos Videos", "mime_type" => "video/*"));
     // Busca o arquivo
     $files = Fabula::GtkFileChooserDialog("Abrir", $this->widgets['frmDemo'], TRUE, Gtk::FILE_CHOOSER_ACTION_OPEN, $filters);
     // Seta o nome do arquivo
     $file = $files->get_filenames();
     $this->widgets['vdoDemo']->set_filename($file[0]);
 }
Exemplo n.º 3
0
 /**
  * Método para salvar a imagem
  * 
  * @name btnSave_onclick()
  */
 public function btnSave_onclick()
 {
     $image = $this->widgets['webcam']->get_image();
     $result = Fabula::GtkFileChooserDialog("Abrir", $this->widgets['frmDemo'], TRUE, Gtk::FILE_CHOOSER_ACTION_SAVE);
     $path = $result->get_filenames();
     if ($path[0] !== FALSE) {
         copy($image, $path[0]);
     }
 }