The new_text function is a convenience function that constructs a new text combo box, which is a GtkComboBox just displaying strings. If you use this function to create a text combo box, you should only manipulate its data source with the following convenience methods: append_text() , prepend_text() , insert_text() and remove_text()
Example 50. Creating a Text GtkComboBox
<?php // Create a new window. $window = new GtkWindow(); // Set the window up to close cleanly. $window->connect_simple('destroy', array('Gtk', 'main_quit')); // Create a text combobox. $combo = GtkComboBox::new_text(); // Add some values. $combo->append_text('New Jersey'); $combo->append_text('New Mexico'); $combo->append_text('New York'); // Add the combobox to the window. $window->add($combo); // Show the window and its contents. $window->show_all(); // Start the main loop. Gtk::main(); ?> |
This method must be called statically.