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

BUG: Folder names not relative using an if () {} construct
https://bbs.xwidget.com/viewtopic.php?f=8&t=6349
Page 1 of 1

Author:  yereverluvinuncleber [ June 4th, 2016, 6:58 am ]
Post subject:  BUG: Folder names not relative using an if () {} construct

Folder names for source images are relative when you assign an image to an object but NOT when using a comparison, so this sort of thing works - an assignment:

leftscale.src = "centigradescale.png"; //success - it can find this image as it uses the relative folder location.

However, when you use an if () {} construct to compare the same object variable you need to use the full path.

Example:
if(leftscale.src == "centigradescale.png"){

The above does not work as the full path is required.

print (leftscale.src); shows the following path in full :

D:\Program Files (x86)\XWidget\AppData\Widgets\Steampunk CPU GPU Thermometer Xwidget\centigradescale.png

So that this if construct is required as a comparator:

if(leftscale.src == "D:\Program Files (x86)\XWidget\AppData\Widgets\Steampunk CPU GPU Thermometer Xwidget\centigradescale.png"){

The above works but is counter intuitive as one usage allows relative comparisons but not the other. Both the assignment and comparator should be the same. This is an unwanted feature of Xwidgets (as it runs under Win10). On any other engine and in any other language this would be considered an obvious and serious BUG.

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