PHP-GTK
Tuesday, July 22, 2014 
download | documentation | applications | faq | changelog | resources 


search for in the  


previousGtkComboBox
GtkComboBox Constructornext

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

GtkComboBox Constructor

Creates a new GtkComboBox associated with the optional GtkTreeModel specified by model. If model is not specified the combo box will not have an associated tree model.

Example 49. Creating a GtkLabel

<?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 = new GtkComboBox();
 
// Create a model.
$listStore = new GtkListStore(Gtk::TYPE_STRING);
 
// Add some values.
$listStore->append(array('New Jersey'));
$listStore->append(array('New Mexico'));
$listStore->append(array('New York'));
 
// Set the model for the combo.
$combo->set_model($listStore);
 
// Create a cell renderer.
$cellRenderer = new GtkCellRendererText();
 
// Pack the cell renderer into the combo.
$combo->pack_start($cellRenderer);
 
// Tell the combo where to get the text value of the cell renderer.
$combo->set_attributes($cellRenderer, 'text', 0);
 
// Add the combobox to the window.
$window->add($combo);
 
// Show the window and its contents.
$window->show_all();
 
// Start the main loop.
Gtk::main();
?>


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


previousGtkComboBox
GtkComboBox Constructornext

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:50:56 2013 CEST