Mefisto_PL Posted February 13, 2013 Posted February 13, 2013 Hello everyone ! I have a question. How to get item name ( for gridlist ) from xml file and text ( gui - edit ) when I click on item. Help me please, I search it everywhere, but I don't understand it . For example: <items> <item name="Page1" text="Test"/> <item name="Page2" text="Test1"/> </items>
Castillo Posted February 13, 2013 Posted February 13, 2013 Do you mean when you click on "pages" grid list, it'll show the "text" in a edit?
Castillo Posted February 13, 2013 Posted February 13, 2013 I would suggest loading all the content of the XML into a lua table, then you can easily get it.
Castillo Posted February 13, 2013 Posted February 13, 2013 To get all the content of the XML use: xmlNodeGetChildren Then use the page name as index for the table, and use the text as value, e.g: -- Global: pages = { } --Inside function: pages [ page ] = text
Mefisto_PL Posted February 13, 2013 Author Posted February 13, 2013 Idk it is working and what I must do now.. pages = { ["Page"] = true, } function asdf ( ) for page, text in pairs ( pages ) do local row = guiGridListAddRow ( gridlist ) guiGridListSetItemText ( gridList, row, 1, page, false, false ) end end ) ///EDIT But I want to create this with xml file :C
Castillo Posted February 13, 2013 Posted February 13, 2013 Well, do you have any idea on how XML works at all?
Mefisto_PL Posted February 13, 2013 Author Posted February 13, 2013 How I think it works or how I think I must use it?
Castillo Posted February 13, 2013 Posted February 13, 2013 Let's say, do you have any idea on how to get the content of a XML file using Lua functions?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now