Fixed multilne entry changed events on GTK+.

This commit is contained in:
Pietro Gagliardi 2016-05-22 23:14:33 -04:00
parent 60627e13a1
commit 0e5e37f98b
2 changed files with 7 additions and 2 deletions

View File

@ -24,6 +24,7 @@ This README is being written.<br>
* Added `uiUserBugCannotSetParentOnToplevel()`, which should be used by implementations of toplevel controls in their `SetParent()` implementations. This will also be the beginning of consolidating common user bug messages into a single place, though this will be one of the only few exported user bug functions.
* uiSpinbox and uiSlider now merely swap their min and max if min ≥ max. They will no longer panic and do nothing, respectively.
* Matrix scaling will no longer leave the matrix in an invalid state on OS X and GTK+.
* `uiMultilineEntrySetText()` and `uiMutlilineEntryAppend()` on GTK+ no longer fire `OnChanged()` events.
## Runtime Requirements

View File

@ -44,8 +44,10 @@ char *uiMultilineEntryText(uiMultilineEntry *e)
void uiMultilineEntrySetText(uiMultilineEntry *e, const char *text)
{
// TODO does this send a changed signal?
// we need to inhibit sending of ::changed because this WILL send a ::changed otherwise
g_signal_handler_block(e->textbuf, e->onChangedSignal);
gtk_text_buffer_set_text(e->textbuf, text, -1);
g_signal_handler_unblock(e->textbuf, e->onChangedSignal);
}
// TODO scroll to end?
@ -54,8 +56,10 @@ void uiMultilineEntryAppend(uiMultilineEntry *e, const char *text)
GtkTextIter end;
gtk_text_buffer_get_end_iter(e->textbuf, &end);
// TODO does this send a changed signal?
// we need to inhibit sending of ::changed because this WILL send a ::changed otherwise
g_signal_handler_block(e->textbuf, e->onChangedSignal);
gtk_text_buffer_insert(e->textbuf, &end, text, -1);
g_signal_handler_unblock(e->textbuf, e->onChangedSignal);
}
void uiMultilineEntryOnChanged(uiMultilineEntry *e, void (*f)(uiMultilineEntry *e, void *data), void *data)