in app designer i need to create (programmiclly) between 12 and 30 check boxed upon app starting based upon a configuration function

2 visualizaciones (últimos 30 días)
I am trying to build a GUI app and need to programiclly create any number of check boxes based upon a configuration file that needs to be read in at the start.

Respuestas (1)

Nivedita
Nivedita el 6 de Sept. de 2023
Hi Gary,
I understand that you programmatically want to create any number of checkboxes by reading into a configuration file at the beginning of your script. You can follow these general steps to do so:
  1. Read the configuration file: Start by reading the configuration file at the start of your application. The file should contain the necessary information about the checkboxes you want to create, such as their labels or properties.
  2. Parse the configuration data: Parse the data from the configuration file and extract the relevant information for creating checkboxes. This could include checkbox labels, positions, default states, or any other properties you need.
  3. Create checkboxes dynamically: Use a loop to iterate over the parsed data and create checkboxes dynamically based on the information obtained. Within the loop, you can create checkboxes in App Designer using the “uicheckbox” component.
  4. Set checkbox properties: Customize the checkboxes by setting their properties based the parsed data. You can use the “set” function to modify properties like position, label, default state, callback function, etc.
  5. Handle checkbox events:If you want to perform specific actions when checkboxes are checked or unchecked, you can define those in callback function for each of them. These functions will be triggered whenever the checkbox state will change.
For more information about the properties of “uicheckbox” and how to create callback funtions, refer to the following links:
I hope this helps!
Regards,
Nivedita.

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by