World: r3wp
[View] discuss view related issues
older newer | first last |
james_nak 23-Apr-2010 [9780] | Maxim, perfect. Thanks. Thanks also to B.C. (My problem was getting the interface to allow a button to be pressed.) |
BudzinskiC 25-Apr-2010 [9781] | I'm currently writing a Rogue like game with Rebol. I used a box to display the game map and set the focus on it so that it receives keyboard input but when I do that there is a weird white stripe being drawn on top of the box in the center. Any idea why that is and how I can make it go away? http://img.skitch.com/20100425-ju42itgetsasupi6yerc1ph4db.png |
Henrik 25-Apr-2010 [9782x3] | That's the caret. Use FOCUS/NO-SHOW, if you want keyboard access to a face, but don't want to display the caret. |
Though I'm not sure if it can be done when there is other content in the face like that. | |
otherwise an alternative is to provide a sensor face, size 0x0, sitting in the corner. focus that and the caret won't appear. then control the main game area using the sensor face. | |
BudzinskiC 25-Apr-2010 [9785] | Will have to do that, no-show isn't working. Thanks :) |
Henrik 25-Apr-2010 [9786] | The caret is controlled by View on the C-layer, so there is not much else to do about it. |
BudzinskiC 25-Apr-2010 [9787] | Ah well I'm sure it's going to be fixed in R3. R3 will make everything better. And coffee. Or so I've heard :) |
Henrik 25-Apr-2010 [9788] | yes, text is managed on the mezzanine level, while high performance parts are in the open parts now. |
Izkata 25-Apr-2010 [9789] | /no-show prevents the face from visibly being updated - if you do a [show FACE] later on, the effect of /no-show is negated |
Henrik 25-Apr-2010 [9790] | yes, correct. |
ChristianE 25-Apr-2010 [9791x2] | If you do not have/need text or if you display text only thru agg instead of face/text, you can hide the superfluous caret in R2/View by setting the face's para to to an origin like -100x-100. |
That allows you to FOCUS such faces without having to care about caret. | |
Henrik 25-Apr-2010 [9793] | good tip |
BudzinskiC 25-Apr-2010 [9794] | Works great, thanks :) |
Anton 25-Apr-2010 [9795] | It should be enough to set the face/text to none. |
BudzinskiC 25-Apr-2010 [9796x4] | That works too, thanks :) Shouldn't it be none by default then? Why is the default an empty string? |
That works too, thanks :) Shouldn't it be none by default then? Why is the default an empty string? | |
That works too, thanks :) Shouldn't it be none by default then? Why is the default an empty string? | |
Sorry for that, AltMe was acting up | |
Anton 25-Apr-2010 [9800x2] | What face or style do you base the face which displays your map on? |
Ah - BOX. print mold svv/vid-styles/box/text ;== none but it's FOCUS which does more than necessary. Check the souce of FOCUS. I patched FOCUS so it doesn't have such presumptuous side effects. | |
BudzinskiC 26-Apr-2010 [9802] | Ah alright, I checked the value of face/text after I already used focus on it. |
Henrik 26-Apr-2010 [9803] | Anton, nice one. |
Graham 29-Apr-2010 [9804x2] | Where would this be coming from ? near: [if find [down alt-down] Â act] where: 'wake-event where the original code is feel: make feel [ engage: func [face act evt][ if find [down alt-down] act [ focus/no-show face/parent-face face/start: evt/offset ] if find [over away] act [ face/offset: face/offset + evt/offset - face/start clamp face show face ] ] ] |
It's from Henrik's code ... but I can't see how something could modify the code ! Anyway I've trapped it ... so it's not a problem now. | |
Henrik 29-Apr-2010 [9806] | mine? which code exactly? |
Graham 29-Apr-2010 [9807] | it's something you wrote that allows you to pan an image |
Henrik 29-Apr-2010 [9808] | ok, the image-pan style? |
Graham 29-Apr-2010 [9809x2] | yep |
pan-image style | |
Henrik 29-Apr-2010 [9811] | if you look at that error, there is an extra char in there. it's possible that you can find it in the source code and delete it. |
Graham 29-Apr-2010 [9812x2] | It's not there .. that's the worry! |
so something is corrupting memory | |
Henrik 29-Apr-2010 [9814] | the char may be invisible. double-checked? |
Graham 29-Apr-2010 [9815x3] | yes |
Otherwise I'd get the error as soon as I ran the code right? | |
but it happens after I move the image around a bit | |
Henrik 29-Apr-2010 [9818] | I'm not sure. The problem is that there is a char which you on a mac can accidentally type when holding down alt while pressing space. the you get a hard-space char (I think it is). rebol doesn't handle it properly always, but it doesn't prevent code from loading. |
ChristianE 29-Apr-2010 [9819] | The stray char looks fairly familiar. You're probably have problems with cp1252- and utf8-encodings? |
Graham 29-Apr-2010 [9820x4] | Ok, let me delete the space and reinsert ... |
plain vanilla code .. | |
Oh .. it's working! | |
maybe there was something odd invisible?? | |
ChristianE 29-Apr-2010 [9824] | A hard-space then, just as Henrik said. |
Graham 29-Apr-2010 [9825] | wonder why it only errors later on ... |
ChristianE 29-Apr-2010 [9826] | A hard-space, this can be encoded by UTF-8 as 0xC2 0xA0, 0xC2 is #"Â". |
Graham 29-Apr-2010 [9827] | Good to know |
ChristianE 29-Apr-2010 [9828] | It loads, but is probably mistaken for a word with no value? What was the exact error message? Word has no value or so? |
Maxim 29-Apr-2010 [9829] | i've had similar errors with PC control codes embeded in a script. |
older newer | first last |