240 |
240 |
241 void ui_textarea_realize_event(GtkWidget *widget, gpointer data) { |
241 void ui_textarea_realize_event(GtkWidget *widget, gpointer data) { |
242 gtk_widget_grab_focus(widget); |
242 gtk_widget_grab_focus(widget); |
243 } |
243 } |
244 |
244 |
|
245 void ui_text_set(UiText *text, char *str) { |
|
246 if(text->set) { |
|
247 text->set(text, str); |
|
248 } else { |
|
249 if(text->value) { |
|
250 g_free(text->value); |
|
251 } |
|
252 text->value = g_strdup(str); |
|
253 } |
|
254 } |
|
255 |
|
256 char* ui_text_get(UiText *text) { |
|
257 if(text->get) { |
|
258 return text->get(text); |
|
259 } else { |
|
260 return text->value; |
|
261 } |
|
262 } |
|
263 |
245 |
264 |
246 // undo manager functions |
265 // undo manager functions |
247 |
266 |
248 void ui_textbuf_insert( |
267 void ui_textbuf_insert( |
249 GtkTextBuffer *textbuffer, |
268 GtkTextBuffer *textbuffer, |