[Scilab-users] Adding Scroll Bar to uicontrol GUI

lukeaarond lukeaarond at gmail.com
Sun Aug 4 20:32:51 CEST 2013


I have a GUI that I made with uicontrol that asks the user for a value and
then displays a list a number of popup menus corresponding to that value. 

i.e. 
"How many letters do you want?" 
user inputs: 4 
then the GUI displays: 
"Letter #1": A|B|C 
"Letter #2": A|B|C 
"Letter #3": A|B|C 
"Letter #4": A|B|C 

The GUI figure is initially displays a set size, therefore if the user
selects a number less than 13 the list is within the GUI window. If the user
selects a number greater than 13 the user has to adjust the GUI window to
see all popup menus. However, if the user puts in a number larger than their
screen (i.e. 50), the list goes off the screen and the user cannot access
those popup windows. How do I put a scroll bar on the side of my GUI so that
the user can keep the GUI window the same size and just scroll down to see
later popup windows? 

Thank you, 
Luke 

If you would like to see a sample sce code that displays this problem use
the following code: 

function [#Letters]=Button(#Letters_stored) 
    stri=get(#Letters_stored,"string"); 
    #Letters=eval(stri(get(#Letters_stored,"value"))); 
    guih=260; 
    for i=1:#Letters 
        uicontrol(h,"style","text","string",'Letter
#'+string(i),"position",[0,guih-i*20,90,20],"horizontalalignment","left"); 
       
Species_name_GUI(1)=uicontrol(h,"style","popupmenu","string","A|B|C|D|E|F|G","position",[90,guih-i*20,90,20],"horizontalalignment","left"); 
    end 
endfunction 

h=figure(1, "position", [0,0,500,320], "figure_name", "Comparison GUI"); 
uicontrol(h,"style","text","string","Number of
Letters","position",[0,280,100,20],"horizontalalignment","left"); 
#Letters_stored=uicontrol(h,"style","popupmenu","string","5|10|15|20|25|30|35|40|45|50","position",[120,280,40,20],"horizontalalignment","center"); 

P1 = uicontrol(h, 'position', [416 300 83 20], 'style',
'pushbutton','string', 'Submit', 'callback',
'[#Letters]=Button(#Letters_stored)', 'backgroundcolor', [1 1 0]); 



--
View this message in context: http://mailinglists.scilab.org/Adding-Scroll-Bar-to-uicontrol-GUI-tp4027162.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.



More information about the users mailing list