Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-23-2009, 02:44 AM
Struggler Struggler is offline
Zone Repulser =D
Struggler's Avatar
Join Date: May 2006
Posts: 54
Struggler is an unknown quantity at this point
GUI TextLists?

How do I perform an action once one of the rows is selected? I know it has something to do with onSelect(), but dont know exactly what! Heres an example, say I had this:
PHP Code:
      new GuiTextListCtrl("MyGUI_TextList1") {
        
profile GuiBlueTextListProfile;
        
height 32;
        
horizsizing "width";
        
addrow(0,"Developement");
        
addrow(1,"Creators");
        
addrow(2,"Members");
        
addrow(3,"Schedule");
        
addrow(4,"Credits");
        
addrow(5,"Acknoledgements");
        
addrow(6,"Rights");
        
setselectedrow(0);
        
width 95;
      } 
What would the function be to perform an action for the "Development" tab being selected?
Reply With Quote
  #2  
Old 05-23-2009, 03:11 AM
Stryke Stryke is offline
Scripter
Join Date: Apr 2008
Posts: 157
Stryke is an unknown quantity at this point
PHP Code:
function MyGUI_TextList1.onSelect(idtxtind) {
  if (
txt == "Development") {
    echo(
"You have selected Development.");
  }

There's a whole page listing all the functions related to GUIs on the wiki, I suggest you check it out.
Reply With Quote
  #3  
Old 05-23-2009, 03:45 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Mainly this page, which is very useful for these kind of questions.
http://www.graal.net/index.php/Creat...ent/GuiControl

Perhaps Struggler should make one of those threads like Raelyn did.
__________________
Quote:
Reply With Quote
  #4  
Old 05-23-2009, 06:50 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
You can also do this

PHP Code:
temp.items = {"Development""Creators""Members""Schedule""Credits""Acknowledgments""Rights"};

for (
temp.item items) {
  
addRow(0item);

to shorten your list of addrow()'s.
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:04 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.