simplify gwin widgets demo code
This commit is contained in:
parent
6a0e79903d
commit
9e6b210425
1 changed files with 17 additions and 17 deletions
|
@ -317,14 +317,14 @@ static void createWidgets(void) {
|
||||||
*/
|
*/
|
||||||
static void setTab(GHandle tab) {
|
static void setTab(GHandle tab) {
|
||||||
/* Make sure everything is invisible first */
|
/* Make sure everything is invisible first */
|
||||||
gwinSetVisible(ghPgButtons, FALSE);
|
gwinHide(ghPgButtons);
|
||||||
gwinSetVisible(ghPgSliders, FALSE);
|
gwinHide(ghPgSliders);
|
||||||
gwinSetVisible(ghPgCheckboxes, FALSE);
|
gwinHide(ghPgCheckboxes);
|
||||||
gwinSetVisible(ghPgLabels, FALSE);
|
gwinHide(ghPgLabels);
|
||||||
gwinSetVisible(ghPgRadios, FALSE);
|
gwinHide(ghPgRadios);
|
||||||
gwinSetVisible(ghPgLists, FALSE);
|
gwinHide(ghPgLists);
|
||||||
gwinSetVisible(ghPgImages, FALSE);
|
gwinHide(ghPgImages);
|
||||||
gwinSetVisible(ghPgProgressbars, FALSE);
|
gwinHide(ghPgProgressbars);
|
||||||
|
|
||||||
// Stop the progress bar
|
// Stop the progress bar
|
||||||
gwinProgressbarStop(ghProgressbar1);
|
gwinProgressbarStop(ghProgressbar1);
|
||||||
|
@ -332,21 +332,21 @@ static void setTab(GHandle tab) {
|
||||||
|
|
||||||
/* Turn on widgets depending on the tab selected */
|
/* Turn on widgets depending on the tab selected */
|
||||||
if (tab == ghTabButtons) {
|
if (tab == ghTabButtons) {
|
||||||
gwinSetVisible(ghPgButtons, TRUE);
|
gwinShow(ghPgButtons);
|
||||||
} else if (tab == ghTabSliders) {
|
} else if (tab == ghTabSliders) {
|
||||||
gwinSetVisible(ghPgSliders, TRUE);
|
gwinShow(ghPgSliders);
|
||||||
} else if (tab == ghTabCheckboxes) {
|
} else if (tab == ghTabCheckboxes) {
|
||||||
gwinSetVisible(ghPgCheckboxes, TRUE);
|
gwinShow(ghPgCheckboxes);
|
||||||
} else if (tab == ghTabLabels) {
|
} else if (tab == ghTabLabels) {
|
||||||
gwinSetVisible(ghPgLabels, TRUE);
|
gwinShow(ghPgLabels);
|
||||||
} else if (tab == ghTabRadios) {
|
} else if (tab == ghTabRadios) {
|
||||||
gwinSetVisible(ghPgRadios, TRUE);
|
gwinShow(ghPgRadios);
|
||||||
} else if (tab == ghTabLists) {
|
} else if (tab == ghTabLists) {
|
||||||
gwinSetVisible(ghPgLists, TRUE);
|
gwinShow(ghPgLists);
|
||||||
} else if (tab == ghTabImages) {
|
} else if (tab == ghTabImages) {
|
||||||
gwinSetVisible(ghPgImages, TRUE);
|
gwinShow(ghPgImages);
|
||||||
} else if (tab == ghTabProgressbar) {
|
} else if (tab == ghTabProgressbar) {
|
||||||
gwinSetVisible(ghPgProgressbars, TRUE);
|
gwinShow(ghPgProgressbars);
|
||||||
|
|
||||||
// Start the progress bar
|
// Start the progress bar
|
||||||
gwinProgressbarStart(ghProgressbar1, 500);
|
gwinProgressbarStart(ghProgressbar1, 500);
|
||||||
|
@ -401,7 +401,7 @@ int main(void) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Make the console visible
|
// Make the console visible
|
||||||
gwinSetVisible(ghConsole, TRUE);
|
gwinShow(ghConsole);
|
||||||
gwinClear(ghConsole);
|
gwinClear(ghConsole);
|
||||||
|
|
||||||
// We want to listen for widget events
|
// We want to listen for widget events
|
||||||
|
|
Loading…
Add table
Reference in a new issue