76 "realize", |
76 "realize", |
77 G_CALLBACK(ui_textarea_realize_event), |
77 G_CALLBACK(ui_textarea_realize_event), |
78 NULL); |
78 NULL); |
79 |
79 |
80 UiTextArea *uitext = malloc(sizeof(UiTextArea)); |
80 UiTextArea *uitext = malloc(sizeof(UiTextArea)); |
|
81 uitext->obj = obj; |
81 uitext->ctx = obj->ctx; |
82 uitext->ctx = obj->ctx; |
82 uitext->var = var; |
83 uitext->var = var; |
83 uitext->last_selection_state = 0; |
84 uitext->last_selection_state = 0; |
|
85 uitext->onchange = args.onchange; |
|
86 uitext->onchangedata = args.onchangedata; |
84 |
87 |
85 g_signal_connect( |
88 g_signal_connect( |
86 text_area, |
89 text_area, |
87 "destroy", |
90 "destroy", |
88 G_CALLBACK(ui_textarea_destroy), |
91 G_CALLBACK(ui_textarea_destroy), |
264 |
267 |
265 |
268 |
266 |
269 |
267 void ui_textbuf_changed(GtkTextBuffer *textbuffer, UiTextArea *textarea) { |
270 void ui_textbuf_changed(GtkTextBuffer *textbuffer, UiTextArea *textarea) { |
268 UiText *value = textarea->var->value; |
271 UiText *value = textarea->var->value; |
|
272 |
|
273 UiEvent e; |
|
274 e.obj = textarea->obj; |
|
275 e.window = e.obj->window; |
|
276 e.document = textarea->ctx->document; |
|
277 e.eventdata = value; |
|
278 e.intval = 0; |
|
279 |
|
280 if(textarea->onchange) { |
|
281 textarea->onchange(&e, textarea->onchangedata); |
|
282 } |
|
283 |
269 if(value->observers) { |
284 if(value->observers) { |
270 UiEvent e; |
|
271 e.obj = textarea->ctx->obj; |
|
272 e.window = e.obj->window; |
|
273 e.document = textarea->ctx->document; |
|
274 e.eventdata = value; |
|
275 e.intval = 0; |
|
276 ui_notify_evt(value->observers, &e); |
285 ui_notify_evt(value->observers, &e); |
277 } |
286 } |
278 } |
287 } |
279 |
288 |
280 // undo manager functions |
289 // undo manager functions |