[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4668: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4670: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4671: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4672: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
XWidgetSoft Forum • View topic - BUG: colour selection in code not working

XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently April 16th, 2024, 10:42 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: June 28th, 2017, 5:21 am 
Offline
User avatar

Joined: July 29th, 2013, 9:13 am
Posts: 609
In the Xwidget engine Certain objects seem to have problems in setting colours using code. The yahoo widget methods are documented so you can look up the method required to change styling and apply it, it just works. For example:

Code:
playListPage.style.backgroundColor = "rgba(255,255,255,0.06)";

However, in the Xwidget engine there is no documentation and you cannot trust the inline suggestion system (intellibollox) so you need to have a look inside the main.xul file and see how it does things, from this you will receive a pointer as how it should be done in code... It won't always be correct but it may help.

For example:

Changing the background of a graphical object is performed using the IDE by selecting the "fill color" properties tab. Choosing and enabling the background colour is acheived by pressing on the enabled button and selecting color from the pop-up dialog. Easy enough.

[ picture here of IDE and colour selection ]


When the widget is saved this results in the following XML code being written to the main.xul file.

Code:
<text name="playListText0" background.solidColor.enabled="true" background.solidColor.color="128,128,128,255" />

This is the functional equivalent of the following in code, where we can set the same object properties using:

Code:
playListText0.background.solidColor.enabled="true";
playListText0.background.solidColor.color="128,128,128,255"; //this does not function

Unfortunately, even though the code is functionally valid, the second command is not recognised by the Widget engine and an error is thrown regarding converting a string to an integer.

The intellibollox suggestion system is utterly useless when it comes to helping you determine the right method to colour a background but it seems to imply that the following code is more or less correct:

Code:
playListText0.background.solidColor="rgba(255,255,255,0.06)";
playListText0.background.solidColor="rgb(255,255,255)";

Although no error is generated, neither of these lines performs any useful function. I suggest that the widget engine has a bug in the configuration of background colours, it recognises the object's properties and makes an attempt to process a string containing RGB information but it does nothing with it.

There may well be other methods as suggested by the intellibollox, including colorize. I have tried various methods and combinations but the logical and obvious solutions do not work. With no documentation and no examples it is harder work to find a solution.

The end result is that it is not possible to style an Xwidget background colours using this method, ie. in code, styling the background colours in the IDE and switching them on and off again at will seems to be the only way, cumbersome and annoying though it may be.

Note: I can confirm that the Xwidget is bug-ridden when it comes to handling colours.

Code:
playListText0.font.fill.color="245,15,20,255" ;

Setting certain values in code causes the font colour to change but not to colour that matches what is set in the IDE nor what should be expected from a valid RGB selection. Setting other perfectly valid values causes a generic error that the engine cannot convert from a string to an integer. Fundamentally, setting colours in code is broken in Xwidget.


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

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 30 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:  
cron

Powered by phpBB® Forum Software © phpBB Group