Jump to content

CASTORGUI.GUISelect.addOptions


Ingo Chou
 Share

Recommended Posts

Hi,

 

I use CASTORGUI.GUISelect.addOptions() with this code:

 

        var sel = new CASTORGUI.GUISelect("testSel", { x: 5, y: 10, w: 200, h: 40 }, gui, { alert("click") }, false);
        for (var i = 0; i < 10; i++) {
            sel.addOptions("value", "text");  // ????  
        }
        mywin.add(sel);
 
But it seems not work.
 
However, it works without    sel.addOptions("value", "text");
 
How can I use this GUI control method?
 
Thanks for your help!
Link to comment
Share on other sites

You must add the elements after the Select Options element was added to the Window element.
I also made a small correction
 
This is how you do it:
// Creat selectvar sel = new CASTORGUI.GUISelect("testSel", { x: 5, y: 25, w: 200, h: 20 }, guisystem, function() { alert("click")}, false); // Creat Windowvar form = new CASTORGUI.GUIWindow("form", {x:(guisystem.getCanvasWidth().width / 2 - 100), y:200 , w:200, h:200}, guisystem); // add element Select on Windowform.add(sel); // add options an element Selectfor (var i = 0; i < 10; i++) {    sel.addOptions("value", "text");} // Window visibleform.setVisible(true); 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...