Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-29-2009, 01:48 AM
The_Kez The_Kez is offline
N-Pulse Asst. Manager
The_Kez's Avatar
Join Date: Dec 2007
Posts: 106
The_Kez is on a distinguished road
Send a message via MSN to The_Kez
Icons

I wouldn't ask such a simple question without looking it up in the wiki first but what I found in the wiki doesn't seem to be working; maybe it's something I'm doing wrong.

I'm trying to get icons to show in my GuiTextListEntry...for some reason though it's not showing.

Here is the initialization of the TextListCtrl and parent:

PHP Code:
    new GuiScrollCtrl("ETControl_TextList2_Scroll") {
      
profile GuiBlueScrollProfile;
      
height 158;
      
hscrollbar "alwaysOff";
      
vscrollbar "dynamic";
      
width 128;
      
212;
      
51;

      new 
GuiTextListCtrl("ETControl_TextList2") {
        
profile GuiBlueTextListProfile;
        
height 32;
        
horizsizing "width";
        
width 124;
        
seticonsize1515 );
        
thiso.catcheventthis.name"onRightMouseDown""onDropDownMenu" );
      }
    } 
seticonsize works, because I can see it offsetting the text to the correct amount. I'm assuming that 'icon' is the textlistentry attribute which is reading as the image of the icon? This is what I tried:

PHP Code:
    with ETControl_TextList2.addrow(0"Team Guilds") ) {
      
icon "block.png"//as a test image
    

Maybe someone will see where my issue is?
Reply With Quote
  #2  
Old 06-29-2009, 01:59 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
If I recall correctly, icon is actually a TDrawingPanel, so you will have to do something like
PHP Code:
icon.drawimage(00"image.png"); 
Reply With Quote
  #3  
Old 06-29-2009, 02:01 AM
The_Kez The_Kez is offline
N-Pulse Asst. Manager
The_Kez's Avatar
Join Date: Dec 2007
Posts: 106
The_Kez is on a distinguished road
Send a message via MSN to The_Kez
PHP Code:
ETControl_TextList2.addrow0"Team Guilds").icon.drawimage(00"block.png"); 
That worked, so I guess I'm sort of answering my own question, but I'm unsure as to why it works and I don't want to just take it on faith that it will work without understanding it.

Can anyone explain why it has to be done this way?
Reply With Quote
  #4  
Old 06-29-2009, 02:09 AM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
It has to do with objects.
__________________
Reply With Quote
  #5  
Old 06-29-2009, 02:16 AM
The_Kez The_Kez is offline
N-Pulse Asst. Manager
The_Kez's Avatar
Join Date: Dec 2007
Posts: 106
The_Kez is on a distinguished road
Send a message via MSN to The_Kez
Quote:
Originally Posted by Chompy View Post
It has to do with objects.
Haha thanks, it's all so clear now!
Reply With Quote
  #6  
Old 06-29-2009, 02:23 AM
Robin Robin is offline
The secret of NIMH
Robin's Avatar
Join Date: Apr 2005
Location: Wales, UK
Posts: 515
Robin will become famous soon enough
Send a message via AIM to Robin
ETControl_TextList2 <--- That's your TextList Control Object

.addrow( 0, "Team Guilds") <- You calling the command "addrow" which is returning a row object

.icon <-- You are getting the object "icon" from the previous row object

.drawimage(0, 0, "block.png"); <-- You are drawing an image, "block.png" at positon x: 0, y: 0 onto the "icon" object.
__________________

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 12:40 AM.


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