Author Topic: Gui Scroll Controll  (Read 1176 times)

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
« Last Edit: October 21, 2011, 07:44:55 AM by jes00 »



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: [Select]
function yourGUI::onWake(%this)
{
%list = listName;
%list.clear();

%list.addRow(0, "Row one.");
%list.addRow(1, "Row two.");
%list.addRow(2, "Row three.");
//etc.
}

To get whatever row is selected:

listName.getSelectedID()

To get the text inside the row that is selected:

listName.getValue()

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: [Select]
function yourGUI::onWake(%this)
{
%list = listName;
%list.clear();

%list.addRow(0, "Row one.");
%list.addRow(1, "Row two.");
%list.addRow(2, "Row three.");
//etc.
}

To get whatever row is selected:

listName.getSelectedID()

To get the text inside the row that is selected:

listName.getValue()

Thanks otto san!

Also how can I toggle wether something is visible or not?

Also how can I toggle wether something is visible or not?
to bring up a GUI do

canvas.popDialog(yourgui);

to close it do

canvas.pushDialog(yourgui);

to bring up a GUI do

canvas.popDialog(yourgui);

to close it do

canvas.pushDialog(yourgui);
I know that but I have a GUI with two windows and I want one button to make the second window visible and another to make it invisible.

I know that but I have a GUI with two windows and I want one button to make the second window visible and another to make it invisible.
i think you can do control.setVisible(0); and control.setVisible(1);

but im not sure if that works on TGE

i think you can do control.setVisible(0); and control.setVisible(1);

but im not sure if that works on TGE
Didn't work, I know there is a way to do this because that's what the avatar GUI does.

i think you can do control.setVisible(0); and control.setVisible(1);

but im not sure if that works on TGE
That works, but both windows have to be defined in the same GUI. If they're in different GUIs, you use the canvas.pushDialog method.

That works, but both windows have to be defined in the same GUI. If they're in different GUIs, you use the canvas.pushDialog method.
They are both defined in the same GUI.