/** * @name __construct() * @return Demo */ public function __construct() { // Cria a janela $this->widgets['frmDemo'] = new GtkWindow(); $this->widgets['frmDemo']->set_size_request(400, 400); $this->widgets['frmDemo']->set_position(Gtk::WIN_POS_CENTER_ALWAYS); $this->widgets['frmDemo']->connect("destroy", array($this, "frmDemo_unload")); $fix = new GtkFixed(); // Cria o objeto webcam $this->widgets['webcam'] = Fabula::GtkWebCam(); $this->widgets['webcam']->set_size(320, 240); $this->widgets['webcam']->set_quality(65); $this->widgets['webcam']->set_device("/dev/video0"); // Inicia a captura $this->widgets['btnStartStop'] = new GtkButton("Iniciar"); $this->widgets['btnStartStop']->connect_simple("clicked", array($this, "btnStartStop_onclick")); $fix->put($this->widgets['btnStartStop'], 8, 265); // Salva a imagem $this->widgets['btnSave'] = new GtkButton("Salvar"); $this->widgets['btnSave']->connect_simple("clicked", array($this, "btnSave_onclick")); $fix->put($this->widgets['btnSave'], 8, 300); // Adiciona o frame da webcam $frame = new GtkFrame(); $frame->add($this->widgets['webcam']); $frame->set_size_request(331, 251); $fix->put($frame, 8, 8); // Inicia a aplicação $this->widgets['frmDemo']->add($fix); $this->frmDemo_onload(); }
/** * @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 botão 1 $this->widgets['btnDemo1'] = new GtkButton("Demo 1"); $fix->put($this->widgets['btnDemo1'], 8, 8); $this->widgets['btnDemo1']->connect_simple("clicked", array($this, "btnDemo1_onclick")); // Cria o botão 1 $this->widgets['btnDemo2'] = new GtkButton("Demo 2"); $fix->put($this->widgets['btnDemo2'], 80, 8); $this->widgets['btnDemo2']->connect_simple("clicked", array($this, "btnDemo2_onclick")); // Inicia a aplicação $this->widgets['frmDemo']->add($fix); $this->frmDemo_onload(); }
/** * @name __construct() * @return Demo */ public function __construct() { // Cria a janela $this->widgets['frmDemo'] = new GtkWindow(); $this->widgets['frmDemo']->set_size_request(180, 180); $this->widgets['frmDemo']->set_position(Gtk::WIN_POS_CENTER_ALWAYS); $this->widgets['frmDemo']->connect("destroy", array($this, "frmDemo_unload")); $fix = new GtkFixed(); // Calendar $fix->put(Fabula::GtkLabel("Calendario"), 8, 8); $this->widgets['txtCalendar'] = Fabula::GtkEntry(); $this->widgets['txtCalendar']->set_calendar(TRUE); $fix->put($this->widgets['txtCalendar'], 8, 24); // Mask $fix->put(Fabula::GtkLabel("Mascara"), 8, 52); $this->widgets['txtCalendar'] = Fabula::GtkEntry(); $this->widgets['txtCalendar']->set_mask("(99) 9999-9999"); $fix->put($this->widgets['txtCalendar'], 8, 68); // Inicia a aplicação $this->widgets['frmDemo']->add($fix); $this->frmDemo_onload(); }