Planetdance forum

Board index => Astrobasic => Topic started by: Jean on December 16, 2020, 12:11:52 PM

Title: new command: popup
Post by: Jean on December 16, 2020, 12:11:52 PM
from the help:

[popup]
Syntax: popup(int x, int y, char options[$], label onclick, char default);
Action: present a popupmenu. If default >= 0 that entry will be selected.

Example:
Code: [Select]
window(666, 666);
char s[99];
int n;
button(0,0, "Test", test);
run;

:test;
  popup(99, 99, "one|two|three", test1);
  return;

:test1;
  strset(s, "%d %d", n, menunumber);
  setcaption(s);
  n += 1;
  return;
Title: Re: new command: popup
Post by: ABer on December 16, 2020, 06:15:50 PM
That's cool Jean - thanks very much for this new function. Ed
Title: Re: new command: popup
Post by: Jean on December 16, 2020, 07:20:07 PM
Thanks, added a parameter for if you want one item radio-checked.
Eventually it could also have checkboxes for all items, it would then need an extra parameter for an array of chars 0/1.