gui items like check boxes etc


Author Message
tenij000
Senior Member

Joined: 30/05/2025
Location: Netherlands
Posts: 106
Posted: 12:32am 24 Jun 2025      

those check boxes or switch other gui items i have to do that option somthing but says it is perament does that mean can only set 1 time the amount of switches check boxes etc

phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 3216
Posted: 02:07am 24 Jun 2025      

Most permanent options can be changed by first removing them with:-

OPTION xxx DISABLE

Then entering the revised option.

There are a few that can changed by just entering the revised option.

The Advanced Graphics PDF doesn't say which method so just try it.

Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3362
Posted: 03:31am 24 Jun 2025      

  tenij000 said  those check boxes or switch other gui items i have to do that option somthing but says it is perament does that mean can only set 1 time the amount of switches check boxes etc

In short, YES.

You only define a GUI control once (preferably at the start of the program) and then it appears on the screen and will be managed by MMBasic.  The user can then touch it to turn it off/on, etc and you can read its control property in your program to determine what the user has done.

You can also remove the GUI control but it is best left there for the duration of your program.  You can also hide and restore GUI controls.  Read the Advanced Graphics PDF as it has a detailed description of how to use this feature.

Geoff

TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6529
Posted: 05:18am 24 Jun 2025      

I think he is referring to
OPTION GUI CONTROLS nnn

You can change to number of controls but not within a program.
Changing the number of GUI controls causes memory to be reallocated.

A good start is to set the number of controls to 39 which reserves 2k bytes.
Setting 40 will double the allocated memory.

Jim

phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 3216
Posted: 05:35am 24 Jun 2025      

  Quote  You can change to number of controls but not within a program.
Changing the number of GUI controls causes memory to be reallocated.

A good start is to set the number of controls to 39 which reserves 2k bytes.
Setting 40 will double the allocated memory.
That would be useful in the Advanced Graphics PDF.

  Advanced Graphics PDF said  Options, Commands and Functions
Detailed Listing
Options
Permanent? <- appears to suggest some ambiguity at the time of writing
OPTION GUI CONTROLS NbrOfGUIControls
 Specifies the maximum number of GUI controls that can be defined.
Each control uses 52 bytes and the total memory used must be rounded up
to the next 2048 byte multiple. For example, specifying 70 controls will
use 4KB of RAM.
By default the number of GUI controls is set to zero so this option must
be used before any GUI controls are defined.

Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3362
Posted: 06:57pm 24 Jun 2025      

On Page 1 of the manual the option is described quite clearly:
  Quote  To use the GUI controls the memory required for the GUI controls must be allocated first by using the command OPTION GUI CONTROLS.  Typically you would use the command like this:  
OPTION GUI CONTROLS 75
This will set the maximum number of controls that you can define to 75.  This option is permanent (i.e. it will be remembered on power down).  By default the maximum number of controls is set to zero and in this case the GUI features will not be available and no memory will be used.


Geoff

tenij000
Senior Member

Joined: 30/05/2025
Location: Netherlands
Posts: 106
Posted: 08:44pm 24 Jun 2025      

OPTION GUI CONTROLS 39
GUI TEXTBOX 13, 20, 30, 150, 30, RGB(255,255,255), RGB(0,0,0)
CtrlVal(13) ="hello"


is also a way to disable 1 if needid

GUI TEXTBOX 13 <<<<

then change it for example into somthing else like checkbox

TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6529
Posted: 09:54pm 24 Jun 2025      

Please read the Advanced Graphics Functions.pdf
You have
GUI HIDE
GUI SHOW
GUI DISABLE
GUI ENABLE
GUI DELETE

Unless you are running short of memory, there is no need to DELETE