0
Problem creating a checkbox uicontrol

the following code creates an array of checkboxes, labels and edit boxes in a frame inside a figure. The frame handle is stored in the structure field lsqfrm.fh. Tthe checkboxes are not grouped. If I comment out the code to create the checkbox the rest of the code runs ok. I have tried supplying the frame handle as the first parameter to the uicontrol as well as specifyning it explicitly as the parent as shown. When I use the handle as the first entry I get the error message "uicontrol: Wrong type for input argument #1: String expected". If I use the form shown below the error message is "uicontrol: Wrong type for input argument #1: A 'Figure' or a 'Frame uicontrol' handle expected." I have paused the code before creating the checkbox and checked the validity of the frame handle and its parent figure handle. Anyone have any ideas?

for i=1:size(paramarray,2)
    //checkbox
    uicontrol("parent",lsqfrm.fh...
        ,"Style","checkbutton"...
        ,"position",[lsqfrm.labx,lsqfrm.guih1,lsqfrm.bw,lsqfrm.bh]...
        ,"Callback_Type",2...
        ,"Callback","SelectParam("+string(i)+")"...
        ,"Max",1,"Min",0,"Value",0,...
        ,"BackgroundColor",[0.3,0.3,0.3]...
        ,"ForegroundColor",[1,1,1]...
        ,"Tag",tagarray(i)+"_chk"...
        ,"TooltipString","Check to include "+paramarray(i)+" in the LSQ fit");
    //checkbox label


Scilab 09-09-21, 5:17 p.m. DaveC49
0

I can create checkboxes elsewhere in a different part of my code. The only difference here is that the code is in a function and within a for loop in that function. Has me confused. Scilab6.1.1 on Linux Mint 20.

10-09-21, 6:15 a.m. DaveC49

Finally solved the problem . Seems to be associated with breaking the code out onto separate lines using "..." to indicate a new line. This worked OK for most other controls but not the checkbox. Will check it out further and put a bug report in when I can make it consistent.


11-09-21, 6:55 a.m. DaveC49

Login to add comment


0
You actually need just one callback for the checkboxes. Since you are creating your GUI "programmatically" (that is not with GUIDE) you can modify your code as follows: change the code for the creation of the axes as follows
handles.axes=axes('Units', 'Pixels','tag','axes_tag','Position',[25 25 N-200 M-50]);
that is define the property tag, you will use it in the checkbox callaback; the tag of a uicontrol might be used with the function findobj to access to that uicontrol change the defionition of the checkbox as follows
   handles.check{ii}=uicontrol('style','checkbox','string', ...
      ['Display_file_' num2str(ii)],'tag',['c_b_' num2str(ii)], ...
      'position',[N-150 M/2-ii*20 100 25],'callback','plot_sel_cb(handles.axes)');
15-09-21, 2:31 p.m. Armijo559

Thanks Will give it a try.


16-09-21, 2:40 a.m. DaveC49

Login to add comment


0
Our credit repair services work to fix past credit mistakes and verify credit report accuracy. Talk to a credit repair expert today! dark web sites
Oops! Looks like spam! Waiting for moderator approval.
16-01-22, 7:17 p.m. dirahot469

Login to add comment
Oops! Looks like spam! Waiting for moderator approval


0
outlook 365 Microsoft’s Clutter feature helps you filter priority and relevant emails by remembering your preferences. Microsoft’s Clutter examines your mail choice pattern, keeps track of skipped, most favorite mails, and organizes them in a folder in Outlook. Clutter is your choice if you want to enable or disable this feature after logging into Outlook 365 .
Oops! Looks like spam! Waiting for moderator approval.
19-01-22, 2:54 p.m. kodevi4853

Login to add comment
Oops! Looks like spam! Waiting for moderator approval


0
Microsoft’s Clutter feature helps you filter priority and relevant emails by remembering your preferences. Microsoft’s Clutter examines your mail choice pattern, keeps track of skipped, most favorite mails, and organizes them in a folder in Outlook. Clutter is your choice if you want to enable or disable this feature after logging into Outlook 365 . outlook 365
Oops! Looks like spam! Waiting for moderator approval.
19-01-22, 3:36 p.m. kodevi4853

Login to add comment
Oops! Looks like spam! Waiting for moderator approval


0
You can watch movies online in two way. By buying in to premium administrations like Netflix, Amazon prime, Hotstar, and so on Likewise, there is another alternative to watch films and TV Shows by utilizing free streaming sites like Pelisplus, PelisPedia, pelis28, and so on There are benefits and weaknesses for both the ways. For instance, assuming you like to buy in for Netflix, Amazon Prime, and so forth, you need to pay membership charges yearly or month to month. pelis24
Oops! Looks like spam! Waiting for moderator approval.
19-01-22, 9:36 p.m. kodevi4853

Login to add comment
Oops! Looks like spam! Waiting for moderator approval


0
The (Solution Manual for Probability and Statistics for Engineering and the Sciences 9th Edition by Devore) will help you master the concepts of the ... maternal child nursing care 6th edition
Oops! Looks like spam! Waiting for moderator approval.
20-01-22, 1:02 p.m. kodevi4853

Login to add comment
Oops! Looks like spam! Waiting for moderator approval


0
Black slim fit turtleneck pullover ADA is a perfect day to night garment. It’s made of premium soft Italian merino wool and features soft texture, sleek silhouette, turtleneck, extra long sleeves with finger holes. Its minimalist design, luxury merino knit fabric, and elegant straight shape gives you a real french chic and looks great with jeans, pants, or skirt for an edgy look. turtleneck damen
24-01-22, 10:31 p.m. gahejis791


0
Wallpapers. Find and download the pixel-perfect high-resolution wallpaper for your Phone, Desktop, Windows, Mac, Ios or Android device. Sketch Of Girls
Oops! Looks like spam! Waiting for moderator approval.
27-01-22, 12:35 p.m. kodevi4853

Login to add comment
Oops! Looks like spam! Waiting for moderator approval


Log-in to answer to this question.