display a list of string

gugus

19-10-2011 18:18:13

Hi everyone,

I'm new to MyGUI, and i'm trying to figure out how to display a list of string with a vertical scroll.

I would like something like this:

string 1 s
string 2 c
.... r
..... o
..... l
string n l

what type of widget should I use?

Thanks,
gugus

Altren

19-10-2011 19:02:27

Use List widget :) .

gugus

20-10-2011 13:45:38

Thanks!

But i don't know how to make it work.
I tried this:
getWidget(mScrollerWidget, "Scroller");
mScrollerWidget->addItem("dserzt",MyGUI::UString("fedgdfg"));


and this:
getWidget(mScrollerWidget, "Scroller");
mScrollerWidget->addItem("dfg");


but nothing is displayed. what is wrong?

Thanks

Ps: here is the layout:
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Window" skin="MW_ConsoleWindow" position="0 0 400 400" layer="Windows" name="_Main">
<Property key="Widget_Caption" value="Journal"/>
<Property key="Window_MinMax" value="200 100 2000 2000"/>


<Widget type="List" skin="MW_VScroll" position="230 4 14 284" align="ALIGN_RIGHT ALIGN_VSTRETCH" name="Scroller" />

</Widget>
</MyGUI>

Altren

22-10-2011 11:06:11

Always check MyGUI.log first - I'm sure you have something like
Core | Error | Layer 'Windows' is not found
So use some existing layer.

gugus

23-10-2011 10:07:46

The layer already exist, so the error doesn't come from here.(I'm modifying someone else work)

Altren

24-10-2011 12:39:31

Also I noticed that you use very old layout format (at least alignments are older than MyGUI 3.0). What MyGUI version do you use?
Try to use some default layer (for example "Main") and create new layout in LayoutEditor.