Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 17226 программистов и 1834 робота. Сейчас ищут 1668 программистов ...

Gtk2_IndexedComboBox_Model

Вернуться к: Gtk2_IndexedComboBox

Gtk2_IndexedComboBox_Model

Gtk2_IndexedComboBox_Model – Model class behind the scenes

The model class is the data storage for your key/value pairs. It contains two columns, both are of type Gtk::TYPE_STRING and can hold text and numbers. The first is used for the keys, the values are stored in the second column.

The class has several method that allow you to store data in the model: The classis set_array() takes an associative array of key/value pairs. Once set, you can use append_array() and prepend_array() to add new data after or before the current values. You also have the possibility to use insert_array() that takes the position as first, and the data array as second parameter.

Beside the *_array methods, you can add single key/value pairs by using append() and prepend() which take the key as first, and the value as second parameter. insert() wants an additional position number as first parameter, and key/value as second and third.

To delete data from the model, use remove_key(). After finishing your data manipulation, you can retrieve the full associative array of key/value pairs via get_array().

To obtain the key or value of a certain GtkTreeIter (that you got e.g. from the model by using get_iter()), use get_key() and get_text().



Вернуться к: Gtk2_IndexedComboBox

© 2024 «PHP.RU — Сообщество PHP-Программистов»
Главная | Форум | Реклама на сайте | Контакты VIP Сувениры
Разработка компании ODware