1 |
/* -*- c++ -*- |
/* -*- c++ -*- |
2 |
* Copyright (C) 2006-2017 Andreas Persson |
* Copyright (C) 2006-2019 Andreas Persson |
3 |
* |
* |
4 |
* This program is free software; you can redistribute it and/or |
* This program is free software; you can redistribute it and/or |
5 |
* modify it under the terms of the GNU General Public License as |
* modify it under the terms of the GNU General Public License as |
253 |
template<typename T> |
template<typename T> |
254 |
void ChoiceEntry<T>::set_choices(const char** texts, const T* values) |
void ChoiceEntry<T>::set_choices(const char** texts, const T* values) |
255 |
{ |
{ |
|
combobox.remove_all(); |
|
|
for (int i = 0 ; texts[i] ; i++) { |
|
256 |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 24) || GTKMM_MAJOR_VERSION < 2 |
#if (GTKMM_MAJOR_VERSION == 2 && GTKMM_MINOR_VERSION < 24) || GTKMM_MAJOR_VERSION < 2 |
257 |
|
combobox.clear_items(); |
258 |
|
for (int i = 0 ; texts[i] ; i++) { |
259 |
combobox.append_text(texts[i]); |
combobox.append_text(texts[i]); |
260 |
|
} |
261 |
#else |
#else |
262 |
|
combobox.remove_all(); |
263 |
|
for (int i = 0 ; texts[i] ; i++) { |
264 |
combobox.append(texts[i]); |
combobox.append(texts[i]); |
|
#endif |
|
265 |
} |
} |
266 |
|
#endif |
267 |
this->values = values; |
this->values = values; |
268 |
} |
} |
269 |
|
|