Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: colour text corruption

From: gjones05:mail:orion at: 14-May-2001 18:18

From: "Graham Chiu"
> I was playing around with the howto on panels, and put them > into my vidwiki pages. > > However, a little oddity occurs with the page named > "howto-subpanel-4" > > When you pass your mouse pointer over the text, it > highlights as expected. But after you click on it, the text > stays highlighted gold, and then after that black turns into > gold - Midas effect! And it affects other pages as well :-( > > -- > Graham Chiu
Hi, Graham, The Midas Touch -- I like the idea! So I tried hooking it up to my Curriculum Vitae, but, alas, it didn't turn into gold! :-( This struck me as a curious buglet, and out of curiosity, I tried to track it down. It took a long, long time to figure out where it was being introduced. The first thing that I discovered is that distributed applications through the /View desktop can be extremely difficult to debug. After much struggling, I finally convinced myself that it wasn't your code or Jeff K.'s (scroll-face.r). The code looked so complicated that I just assumed that the font color was getting corrupted somehow with all the face manipulations. It was in the course of using selective probes that I noticed what was going on. Then I was able to simplify the recreation of the bug to its simplest form. The problem can be recreated as follows: REBOL [] view layout [ txt "Click Me" [ view/new l1: layout [ txt "Click to Close" [ unview l1 ] ] ] ] In the main window, the 'txt path font/colors contains the default color (black 0.0.0) and the highlight color (255.180.55 if I recall correctly) in a block. The text is clicked while the cursor is over the text, which means that the font/color (notice that this is singular) changes to the highlight color, as one would expect. But the font/colors (plural) now changes to [255.180.55 255.180.55]. Thereafter, the default color will remain corrupted. This change stays in effect until that instance of REBOL/View is unloaded. I cannot find the code the is doing the corrupting, but I suspect that it is a simple typo (a color is poked into 'font/colors instead of 'font/color) somewhere in the view vid code. The work-around is as follows: REBOL [] view layout [ txt "Click Me" [ view/new l1: layout [ txt "Click to Close" [ unview l1 ] face/font/colors/1: 0.0.0 ] ] ] This work-around explicitly pokes the black default color back into the block. I'll forward this to [feedback--rebol--com] as a possible bug. Your REBOL Wiki is really taking shape. Keep up the good work. --Scott Jones