[15 Mar 2009] Bug in SetLayerStyle() with an Inserted TextObject

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
PEB
Posts: 592
Joined: Sun Feb 21, 2010 1:28 am

[15 Mar 2009] Bug in SetLayerStyle() with an Inserted TextObject

Post by PEB »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 15 Mar 2009 11:06:22 -0000

Hi Andreas,

I've got a really strange bug here. The following code does not work with OS 4.1 (the text gets destroyed in the interval):

Code: Select all

EnableLayers()
SetFont("DejaVu Sans.font", 16)
CreateTextObject(1, "This is a test")
InsertLayer(1, #TEXTOBJECT, 1, #CENTER, #CENTER)
Function p_TimeInterval()
    SetLayerStyle(1, {Text = GetTime(TRUE)})
EndFunction
SetInterval(10, p_TimeInterval, 1000)
Repeat
    WaitEvent
Forever
There are two ways of working around this problem.

1) Remove the SetFont() line, and use the default font.

OR

2) Use DisplayTextObject() instead of InsertLayer()
User avatar
airsoftsoftwair
Posts: 5943
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[17 Mar 2009] Re: Bug in SetLayerStyle() with an Inserted TextObject

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 17 Mar 2009 10:14:30 +0100
Hi Andreas,

I've got a really strange bug here. The following code does not work with OS 4.1 (the text gets destroyed in the interval):

Code: Select all

EnableLayers()
SetFont("DejaVu Sans.font", 16)
CreateTextObject(1, "This is a test")
InsertLayer(1, #TEXTOBJECT, 1, #CENTER, #CENTER)
Function p_TimeInterval()
   SetLayerStyle(1, {Text = GetTime(TRUE)})
EndFunction
SetInterval(10, p_TimeInterval, 1000)
Repeat
   WaitEvent
Forever
There are two ways of working around this problem. 1) Remove the SetFont() line, and use the default font. OR 2) Use DisplayTextObject() instead of InsertLayer()
Yes, that's definitely a bug. I've fixed it. Thanks for the report!
Locked