Lines Matching refs:mt
144 void multitext_add_entry(struct multitext_widget *mt, const char *text)
146 mt->text = realloc(mt->text, (mt->max_text + 1) * sizeof(char *));
147 mt->text[mt->max_text] = strdup(text);
148 mt->max_text++;
151 void multitext_set_entry(struct multitext_widget *mt, unsigned int index)
153 if (index >= mt->max_text)
155 if (!mt->text || !mt->text[index])
158 mt->cur_text = index;
159 gtk_entry_set_text(GTK_ENTRY(mt->entry), mt->text[index]);
162 void multitext_update_entry(struct multitext_widget *mt, unsigned int index,
165 if (!mt->text)
168 if (mt->text[index])
169 free(mt->text[index]);
171 mt->text[index] = strdup(text);
172 if (mt->cur_text == index)
173 gtk_entry_set_text(GTK_ENTRY(mt->entry), mt->text[index]);
176 void multitext_free(struct multitext_widget *mt)
180 gtk_entry_set_text(GTK_ENTRY(mt->entry), "");
182 for (i = 0; i < mt->max_text; i++) {
183 if (mt->text[i])
184 free(mt->text[i]);
187 free(mt->text);
188 mt->cur_text = -1;
189 mt->max_text = 0;