Added a test to make sure uiEntryOnChanged() isn't triggered by uiEntrySetText().

This commit is contained in:
Pietro Gagliardi 2015-05-09 21:01:32 -04:00
parent 349d54b2f1
commit 9500f25b62
1 changed files with 6 additions and 0 deletions

View File

@ -24,6 +24,11 @@ TEXT(Button, uiButton, uiButtonText, uiButtonSetText)
TEXT(Checkbox, uiCheckbox, uiCheckboxText, uiCheckboxSetText) TEXT(Checkbox, uiCheckbox, uiCheckboxText, uiCheckboxSetText)
TEXT(Label, uiLabel, uiLabelText, uiLabelSetText) TEXT(Label, uiLabel, uiLabelText, uiLabelSetText)
static void onChanged(uiEntry *e, void *data)
{
printf("onChanged()\n");
}
static void toggleSpaced(uiCheckbox *c, void *data) static void toggleSpaced(uiCheckbox *c, void *data)
{ {
setSpaced(uiCheckboxChecked(spaced)); setSpaced(uiCheckboxChecked(spaced));
@ -64,6 +69,7 @@ void makePage1(uiWindow *w)
page1 = newVerticalBox(); page1 = newVerticalBox();
entry = uiNewEntry(); entry = uiNewEntry();
uiEntryOnChanged(entry, onChanged, NULL);
uiBoxAppend(page1, uiControl(entry), 0); uiBoxAppend(page1, uiControl(entry), 0);
spaced = uiNewCheckbox("Spaced"); spaced = uiNewCheckbox("Spaced");