diff options
| author | Pietro Gagliardi <[email protected]> | 2015-04-11 14:12:12 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-04-11 14:12:12 -0400 |
| commit | da0acba992a567e275fb8687c5f961a3e35dd5a8 (patch) | |
| tree | b4f03fbed182f7eb48a96a9572f0866041a399e2 /new/test.c | |
| parent | d14716c4d3ef3c710d889a46e1ff93d98bb5feef (diff) | |
Laid the foundation for control showing, hiding, enabling, and disabling.
Diffstat (limited to 'new/test.c')
| -rw-r--r-- | new/test.c | 54 |
1 files changed, 53 insertions, 1 deletions
@@ -67,7 +67,7 @@ static void setCheckboxText(uiControl *b, void *data) } uiWindow *w; -#define nStacks 5 +#define nStacks 7 uiControl *stacks[nStacks]; uiControl *spaced; @@ -110,6 +110,26 @@ static void showSpaced(uiControl *c, void *data) uiEntrySetText(e, msg); } +static void showControl(uiControl *c, void *data) +{ + uiControlShow((uiControl *) data); +} + +static void hideControl(uiControl *c, void *data) +{ + uiControlHide((uiControl *) data); +} + +static void enableControl(uiControl *c, void *data) +{ + uiControlEnable((uiControl *) data); +} + +static void disableControl(uiControl *c, void *data) +{ + uiControlDisable((uiControl *) data); +} + int main(int argc, char *argv[]) { uiInitOptions o; @@ -186,6 +206,38 @@ int main(int argc, char *argv[]) uiStackAdd(stacks[4], setButton, 0); uiStackAdd(stacks[0], stacks[4], 0); + stacks[5] = uiNewHorizontalStack(); + getButton = uiNewButton("Button"); + uiStackAdd(stacks[5], getButton, 1); + setButton = uiNewButton("Show"); + uiButtonOnClicked(setButton, showControl, getButton); + uiStackAdd(stacks[5], setButton, 0); + setButton = uiNewButton("Hide"); + uiButtonOnClicked(setButton, hideControl, getButton); + uiStackAdd(stacks[5], setButton, 0); + setButton = uiNewButton("Enable"); + uiButtonOnClicked(setButton, enableControl, getButton); + uiStackAdd(stacks[5], setButton, 0); + setButton = uiNewButton("Disable"); + uiButtonOnClicked(setButton, disableControl, getButton); + uiStackAdd(stacks[5], setButton, 0); + uiStackAdd(stacks[0], stacks[5], 0); + + stacks[6] = uiNewHorizontalStack(); + setButton = uiNewButton("Show Stack"); + uiButtonOnClicked(setButton, showControl, stacks[5]); + uiStackAdd(stacks[6], setButton, 1); + setButton = uiNewButton("Hide Stack"); + uiButtonOnClicked(setButton, hideControl, stacks[5]); + uiStackAdd(stacks[6], setButton, 1); + setButton = uiNewButton("Enable Stack"); + uiButtonOnClicked(setButton, enableControl, stacks[5]); + uiStackAdd(stacks[6], setButton, 1); + setButton = uiNewButton("Disable Stack"); + uiButtonOnClicked(setButton, disableControl, stacks[5]); + uiStackAdd(stacks[6], setButton, 1); + uiStackAdd(stacks[0], stacks[6], 0); + uiWindowShow(w); uiMain(); printf("after uiMain()\n"); |
