Example #1
2
 /**
  * Constructor Method
  */
 public function __construct()
 {
     parent::__construct();
     $lang_manager = new GtkSourceLanguagesManager();
     $lang = $lang_manager->get_language_from_mime_type('application/x-php');
     $this->buffer = new GtkSourceBuffer();
     $this->buffer->set_language($lang);
     $this->buffer->set_highlight(true);
     $this->buffer->set_check_brackets(TRUE);
     $this->set_buffer($this->buffer);
     $default_font = OS == 'WIN' ? 'Courier 10' : 'Monospace 10';
     $pango = new PangoFontDescription($default_font);
     $this->modify_font($pango);
     $this->set_auto_indent(TRUE);
     $this->set_insert_spaces_instead_of_tabs(TRUE);
     $this->set_tabs_width(4);
     $this->set_show_margin(FALSE);
     $this->set_show_line_numbers(true);
     $this->set_show_line_markers(true);
     $this->set_highlight_current_line(TRUE);
     $this->set_smart_home_end(TRUE);
 }
 /**
  * Cria o FFWEntry
  * 
  * @name __construct()
  * @return GtkEntry
  */
 public function __construct()
 {
     parent::__construct();
     // Cria o buffer do texto
     $this->__widgets['buffer'] = new GtkSourceBuffer();
     parent::set_buffer($this->__widgets['buffer']);
     $this->mime_lang = "application/x-php";
     $this->set_language($this->mime_lang);
     // Abilita o highlight
     $this->__widgets['buffer']->set_highlight(TRUE);
     // Connecta os eventos
     parent::connect("key-release-event", array($this, "__released_key"));
     parent::get_buffer()->connect("insert-text", array($this, "__inserted_text"));
     // Cria dialog do autocomplete
     $this->__widgets['autocomplete'] = new FFWSourceEditorAutocomplete(parent::get_parent_window());
 }