Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Having trouble with GuiTextListCtrl (https://forums.graalonline.com/forums/showthread.php?t=75724)

coreys 07-20-2007 07:17 PM

Having trouble with GuiTextListCtrl
 
I'm making a party menu for Thamhic, and inside it I want a list of all the players in the party. But I'm having a bit of trouble with the GuiTextListCtrl()
PHP Code:

new GuiScrollCtrl(PartyListScroll) {
  
725;
  
extent = {165150};
  
hScrollBar "alwaysOff";
  
vScrollBar "dynamic";
  new 
GuiTextListCtrl(PartyList) {
    
0;
    
width 145;
    
fitparentwidth true;
    
clearRows();
    
addrow(1"Test");
    
setSelectedRow(1);
  }


The Text list doesn't show at all...a bit frustrating.

HolySheepy 07-20-2007 07:33 PM

dunno but maybe you have to do
profile = GuiBlueTextListProfile;
and/or profile = GuiBlueScrollProfile;

coreys 07-20-2007 07:38 PM

Well, it would be the default profiles anyways, but I did try that earlier, with no luck.

HolySheepy 07-20-2007 07:54 PM

set height :P

coreys 07-20-2007 09:01 PM

Yeah, I tried that too, and it didn't work.

HolySheepy 07-20-2007 09:25 PM

well, dunno worked for me lol

xXziroXx 07-21-2007 02:10 AM

Try this example inside the scroll - does it work?

PHP Code:

   new GuiTextListCtrl("Test_List") {
     
profile GuiBlueTextListProfile;
     
0;
     
width 140;
     
fitparentwidth true;
     
     
clearrows();
     
addrow(0,"TextList");
     
addrow(1,"Second line");
     
setSelectedRow(1);
   } 


coreys 07-21-2007 02:25 AM

Nope...here's the entire code:
PHP Code:

//#CLIENTSIDE
public function showParty() {
  
PartyMain.destroy();
  new 
GuiWindowCtrl(PartyMain) {
    
GraalControl.width 1800;
    
extent = {180350};
    
alpha .5;
    
text "  Party";
    new 
GuiScrollCtrl(PartyListScroll) {
      
725;
      
extent = {165150};
      
hScrollBar "alwaysOff";
      
vScrollBar "dynamic";
      new 
GuiTextListCtrl("Test_List") {
        
profile GuiBlueTextListProfile;
        
0;
        
width 140;
        
fitparentwidth true;
     
        
clearrows();
        
addrow(0,"TextList");
        
addrow(1,"Second line");
        
setSelectedRow(1);
      }
    }
  }



xXziroXx 07-21-2007 02:44 AM

Something is "wrong" with your Scroll profile. I haven't really tried to find out what exactly, but if I add this to the ScrollCtrl it works.

PHP Code:

profile GuiBlueScrollProfile

So either do that, or try messing around with your current Scroll profile.

coreys 07-21-2007 03:17 AM

Didn't work. D: I had tried that already...

xXziroXx 07-21-2007 03:21 AM

Odd, as it worked when I was testing it. Try replacing your GuiScrollCtrl with this:

PHP Code:

 new GuiScrollCtrl("Test_ListScroll") {
   
profile GuiBlueScrollProfile;
   
10;
   
10;
   
width 160;
   
height 80;
   
hScrollBar "dynamic";
   
vScrollBar "dynamic";


Any luck?

coreys 07-21-2007 03:29 AM

Hmm, yes...wtf. o.o
Edit: It was the profile of the scroll o.0

xXziroXx 07-21-2007 03:45 AM

Like I said in my last post that you said wasn't working ^^

coreys 07-21-2007 04:55 AM

Yeah, but for some reason it didn't work before, but then it did after awhile. o.0

DustyPorViva 07-21-2007 05:02 AM

Quotations! :)
new GuiScrollCtrl("PartyListScroll") {...
new GuiTextListCtrl("PartyList") {...

coreys 07-21-2007 05:12 AM

Quotes are for pansies ;o

Well, they aren't needed, anyways.

xXziroXx 07-21-2007 05:33 AM

Quote:

Originally Posted by DustyPorViva (Post 1333041)
Quotations! :)
new GuiScrollCtrl("PartyListScroll") {...
new GuiTextListCtrl("PartyList") {...

Doesn't matter. In fact, I believe its recommended NOT to use them - I can't remember which is the prefferd way of doing it.

DustyPorViva 07-21-2007 05:53 AM

Did you even try it to see if it fixed the problem?
EDIT: tested it, quotations=fix.

Twinny 07-21-2007 07:09 AM

Profiles are objects: quotations shouldn't matter at all...

DustyPorViva 07-21-2007 07:11 AM

Well I put it into a WNPC and I had the problem he described. Wrapped the names in quotations and it fixed the problem.

Angel_Light 07-21-2007 07:26 AM

Quotations are only needed when you put a space in the name

eg.

needed
new GuiWindowCtrl( "My Window") {

not needed
new GuiWindowCtrl( My_Window) {

other than the space it doesn't matter at all if you have them or not

Inverness 07-21-2007 01:00 PM

Anytime you make an object in Graal the only parameter required for the constructor is the name of the object, the global reference to the object is made from the name which is a string.

And don't put spaces in variable names, jeeze thats horrible considering the lack of documentation of Graal, I think Stefan would be the only one who actually knows how those are handled if they work at all.

The only reason it even works without the quotes is because Graal creates a variable if there isn't one.

xXziroXx 07-21-2007 01:03 PM

Spaces in variables does work.


Bad example (doesnt work):
PHP Code:

this.I love scripting true

Good example(s):
PHP Code:

makevar("this.I love scripting") = true;
this.("I love scripting") = true



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

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