in app designer i need to create (programmiclly) between 12 and 30 check boxed upon app starting based upon a configuration function
조회 수: 5 (최근 30일)
이전 댓글 표시
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.
댓글 수: 1
Kevin Holly
2022년 6월 21일
Where will these check boxes be located? Can they be placed within cells of an UITable?
답변 (1개)
Nivedita
2023년 9월 6일
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:
- 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.
- 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.
- 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.
- 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.
- 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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!