XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 10th, 2025, 6:35 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: getObject by id (tag)
PostPosted: September 5th, 2012, 7:47 am 
Offline

Joined: September 2nd, 2012, 2:37 am
Posts: 17
Need a help :)
Please, explain how to get Object by tag number, then set param for this object... or get by children number from widget...
Is't possible? or I must use switch - case and set dynamic number to the object name?


Top
 Profile  
 
PostPosted: September 6th, 2012, 12:04 am 
Offline
User avatar

Joined: June 10th, 2012, 5:57 am
Posts: 313
sorry for my poor English , i can't understand the question, do you want
Code:
var a = image1.tag
image1.tag=2


Top
 Profile  
 
PostPosted: September 6th, 2012, 2:59 am 
Offline

Joined: September 2nd, 2012, 2:37 am
Posts: 17
I want to get Image with specific tag, and set Src for this image.
for example: Image.attr(tag=i).Src = Value; Or widget.children[i].Src = Value;
or can I push all object's children to the array? I think not..

I found this solution is working for me:
Code:
switch(i)
     {
      case 1: image1.Src = images[i].ico+'.png'; break;
      case 2: image2.Src = images[i].ico+'.png'; break;
      case 3: image3.Src = images[i].ico+'.png'; break;
      case 4: image4.Src = images[i].ico+'.png'; break;
      case 5: image5.Src = images[i].ico+'.png'; break;
     }


Top
 Profile  
 
PostPosted: September 6th, 2012, 5:00 am 
Offline
User avatar

Joined: June 10th, 2012, 5:57 am
Posts: 313
Shezoid wrote:
I want to get Image with specific tag, and set Src for this image.
for example: Image.attr(tag=i).Src = Value; Or widget.children[i].Src = Value;
or can I push all object's children to the array? I think not..

I found this solution is working for me:
Code:
switch(i)
     {
      case 1: image1.Src = images[i].ico+'.png'; break;
      case 2: image2.Src = images[i].ico+'.png'; break;
      case 3: image3.Src = images[i].ico+'.png'; break;
      case 4: image4.Src = images[i].ico+'.png'; break;
      case 5: image5.Src = images[i].ico+'.png'; break;
     }


maybe it will help
Code:
eval("image"+i).Src= images[i].ico+'.png';


Top
 Profile  
 
PostPosted: September 6th, 2012, 5:38 am 
Offline

Joined: September 2nd, 2012, 2:37 am
Posts: 17
Very helpful, thank you :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group