| Blockland Forums > Modification Help |
| Gui Scroll Controll |
| (1/3) > >> |
| jes00:
Could someone teach me the following about gui scroll controlls? * How to add to it * How to make a button do something depending on what is selected in the control |
| jes00:
Anyone? |
| jes00:
Please? |
| otto-san:
First, make a new GUI. Make a window. Right-click the window. Make a GuiScrollControl inside the window. Right-click the scroll control after scaling it to your liking. Create a new GuiTextListControl and name it. In your script, do this: --- Code: ---function yourGUI::onWake(%this) { %list = listName; %list.clear(); %list.addRow(0, "Row one."); %list.addRow(1, "Row two."); %list.addRow(2, "Row three."); //etc. } --- End code --- To get whatever row is selected: listName.getSelectedID() To get the text inside the row that is selected: listName.getValue() |
| jes00:
--- Quote from: otto-san on October 20, 2011, 04:15:28 PM ---First, make a new GUI. Make a window. Right-click the window. Make a GuiScrollControl inside the window. Right-click the scroll control after scaling it to your liking. Create a new GuiTextListControl and name it. In your script, do this: --- Code: ---function yourGUI::onWake(%this) { %list = listName; %list.clear(); %list.addRow(0, "Row one."); %list.addRow(1, "Row two."); %list.addRow(2, "Row three."); //etc. } --- End code --- To get whatever row is selected: listName.getSelectedID() To get the text inside the row that is selected: listName.getValue() --- End quote --- Thanks otto san! |
| Navigation |
| Message Index |
| Next page |