XWidgetSoft Forum
https://www.bbs.xwidget.com/

what does tag option do?
https://www.bbs.xwidget.com/viewtopic.php?f=8&t=4386
Page 1 of 1

Author:  hamid [ April 17th, 2014, 6:21 am ]
Post subject:  what does tag option do?

i found the [Tag] option and the [Tag String] option in all objects
but i didn't found what do they do yet

it can be found in these places:
1. for any object, in the attributes tab of inspector, in the [Others] section, there is a [Tag] Box and [Tag String] Box available
2. for MenuItems, in the attributes tab of inspector, in the [MenuItem Settings] section, there is a [Tag] Box available


so i wanted to know:
1. what do they do?
2. how to use them?

Author:  Jimking [ April 17th, 2014, 6:52 am ]
Post subject:  Re: what does tag option do?

I use it once! Give me time to remember and give you the widget's link.

Author:  Jimking [ April 17th, 2014, 7:00 am ]
Post subject:  Re: what does tag option do?

Found it! I used this here:
http://jimking.deviantart.com/art/HD-Pi ... -437503873

We use it when we want to combine a certain function to a group of images. Like in this case in my "Piano HD" widget that I wanted to combine the pressed buttons with certain sound. Check the script inside and you will understand better what I mean. An example is always better than words.

Author:  qiancang [ April 17th, 2014, 7:31 am ]
Post subject:  Re: what does tag option do?

tag and tagstring are usually used in script.
mostly, they are used with Sender, such as image1.src = Sender.tagstring + ".png"; or var n = Sender.tag.

Author:  hamid [ April 17th, 2014, 8:12 am ]
Post subject:  Re: what does tag option do?

thanks jimking and qiancang for your helps

Author:  digigamer [ April 17th, 2014, 10:52 pm ]
Post subject:  Re: what does tag option do?

A tag used to transfer a kind of payload with the content. It holds the memory address of an arbitary object and can be used to identify it, useful especially if you employ a common event handler, inspecting Sender.Tag or Sender.TagString gives you an idea of which object you're referring

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/