PHP-GTK
Friday, August 29, 2014 
download | documentation | applications | faq | changelog | resources 


search for in the  


previousGtkTextBuffer
GtkTextBuffer::add_selection_clipboardnext

Last updated: Sun, 12 May 2013
view this page in English

GtkTextBuffer Constructor

GtkTextBuffer ([GtkTextTagTable tag_table = null]);

Returns a new GtkTextBuffer object. You can also get a new buffer by first instantiating a new GtkTextView and then calling get_buffer() .

Example 120. Instantiating a new buffer directly.

<?php
// Create a new window.
$window = new GtkWindow();
// Properly handle closing of the window.
$window->connect_simple('destroy', array('Gtk', 'main_quit'));
 
// Create a new buffer and a new view to show the buffer.
$textBuffer = new GtkTextBuffer();
$textView   = new GtkTextView();
 
// Add some text to the buffer.
$textBuffer->set_text('Hello World!');
 
// Add the buffer to the view and make sure no one edits the text.
$textView->set_buffer($textBuffer);
$textView->set_editable(false);
 
// Add the view to the window, show everything, and start the main loop.
$window->add($textView);
$window->show_all();
Gtk::main();
?>

Example 121. Getting a new buffer from a view.

<?php
// Create a new window.
$window = new GtkWindow();
// Properly handle closing of the window.
$window->connect_simple('destroy', array('gtk', 'main_quit'));
 
// Create a new view.
$textView = new GtkTextView();
 
// Get the buffer from the view.
$textBuffer = $textView->get_buffer();
 
// Add some text to the buffer.
$textBuffer->set_text('Hello World!');
 
// Make sure no one edits the text.
$textView->set_editable(false);
 
// Add the view to the window, show everything, and start the main loop.
$window->add($textView);
$window->show_all();
Gtk::main();
?>

See also:get_buffer()


User Contributed Notes
gtk.gtktextbuffer.constructor.php
add a note about notes
There are no user contributed notes for this page.


previousGtkTextBuffer
GtkTextBuffer::add_selection_clipboardnext

Last updated: Sun, 12 May 2013
view this page in English


credits 

PHP  Copyright © 2001-2014 The PHP Group
 All rights reserved.
Last updated: Sun May 12 20:51:00 2013 CEST