1 /* gEDA - GPL Electronic Design Automation
2 * gschem - gEDA Schematic Capture
3 * Copyright (C) 1998-2010 Ales Hvezda
4 * Copyright (C) 1998-2020 gEDA Contributors (see ChangeLog for details)
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 /*! \file x_integerls.c
22 * \brief A GtkListStore for the integer combo box (gschem_integer_combo_box.c).
42 /*! \brief The columns in the GtkListStore
52 /*! \brief Create a list for routine values
54 * \return An empty list of routine values
59 return gtk_list_store_new (COLUMN_COUNT
, G_TYPE_STRING
);
64 /*! \brief Create a list for routine values
67 * \return A list of routine values
70 x_integerls_new_with_values (const char *value
[], int count
)
73 GtkListStore
*store
= x_integerls_new ();
76 for (index
=0; index
< count
; index
++) {
77 x_integerls_add_value (store
, value
[index
]);
86 /*! \brief Add a value to the list
88 * \param [in,out] store The GtkListStore
89 * \param [in] value The value to add to the list
92 x_integerls_add_value (GtkListStore
*store
, const char *value
)
96 g_return_if_fail (store
!= NULL
);
97 g_return_if_fail (value
!= NULL
);
99 gtk_list_store_append (store
, &iter
);
101 gtk_list_store_set (store
, &iter
,
109 /*! \brief Get the column index of the value
111 * \return The column index of the value
114 x_integerls_get_value_column ()