Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   GUI TextLists? (https://forums.graalonline.com/forums/showthread.php?t=85688)

Struggler 05-23-2009 02:44 AM

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?

Stryke 05-23-2009 03:11 AM

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.

fowlplay4 05-23-2009 03:45 AM

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.

cbk1994 05-23-2009 06:50 AM

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.


All times are GMT +2. The time now is 07:47 AM.

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