World: r3wp
[View] discuss view related issues
older newer | first last |
Ladislav 6-Oct-2006 [5739x2] | Confusion for Pekr: f: func [x] [x] g: func [x] [x] var1: first second :f var2: first second :g bind second :f var2 bind second :g var1 f 1 g 2 f 3 g 4 |
what a mess, isn't it? | |
Pekr 6-Oct-2006 [5741] | yes, it is :-) |
Anton 6-Oct-2006 [5742] | Let me guess output: none, none, 1, 2 ? |
Ladislav 6-Oct-2006 [5743] | wrong |
Anton 6-Oct-2006 [5744] | Oops. |
Ladislav 6-Oct-2006 [5745] | #[unset!] 1 2 3 |
Anton 6-Oct-2006 [5746] | Ok makes sense. |
Pekr 6-Oct-2006 [5747] | fuctnion words remember their values? g 2 results in 1, which is there because there was first call to f 1 |
Anton 6-Oct-2006 [5748] | All words remember their values, unless you rebind the words to a different context. Whether a word is in a function body block or not doesn't matter. |
Ladislav 6-Oct-2006 [5749] | warning! according to the documentation it is possible that in the future REBOL function words will be set to #[none!] or something else when the function returns |
Henrik 8-Oct-2006 [5750x2] | Anyone have an idea on how INFORM stops the event system and returns to the console after pressing a button, allowing it to return a value? I've been studying the source of SHOW-POPUP, HIDE-POPUP, INFORM and the various POPFACE-FEEL objects, but I can't figure out how it's done. |
pressing a button = pressing a button in an INFORM | |
Gabriele 9-Oct-2006 [5752x2] | check the wake-event function |
basically, inform does a new wait [] | |
Anton 9-Oct-2006 [5754] | Starting at the top: system/view/event-port/awake ---> system/view/wake-event |
Gabriele 9-Oct-2006 [5755x2] | wake-event behaves differently when there is a popup open |
it returns true (which makes wait [] return) when hide-popup has been called | |
Anton 9-Oct-2006 [5757x2] | Yes, wake-event calls system/view/popface/feel |
inform calls show-popup which creates your new pop-face. | |
Rebolek 12-Oct-2006 [5759] | simple and almost useless tool :) do http://bolek.techno.cz/reb/webtext.r |
Anton 12-Oct-2006 [5760] | Hmm not bad. |
Gregg 12-Oct-2006 [5761] | Very cool bolek! With a few more fields for control of color and gradients, and the ability to save as an image, I would suggest it for inclusion as a Desktop entry with things like Font-lab and such. |
Rebolek 12-Oct-2006 [5762] | Good idea, Gregg, I'll look into it! Hm, guess I should finish Texture-lab also... :) |
Gregg 12-Oct-2006 [5763] | Yes! That was a way cool app. |
Rebolek 12-Oct-2006 [5764] | Updated version of TextureLab - do http://bolek.techno.cz/reb/texture-lab.r |
Louis 14-Oct-2006 [5765x6] | What could be causing this error. I get it whither I encap or not. ** Script Error: trans-date has no value ** Where: switch ** Near: forall args [ val: first args switch/default type?/word val [ pair! [append pairs val] integer... So far as I know I haven't touched this part of the script this is found in. |
Is there anything wrong with this: style dater txt bold right [trans-date/text: copy (to-string now/date)] 48x24 | |
or this: dater "T-Date:" trans-date: field 80x24 (to-string now/date) feel [ engage: func [face action event][ if action = 'up [ lv-dat: request-date/date/offset (now/date) 315x30 if lv-dat <> none [ trans-date/text: copy to string! lv-dat show trans-date ] ] ] ;trans-date/text: copy (to-string now/date) show trans-date ] | |
I really have trouble debugging view scripts, especially long complicated ones. Usually, I make only one of two changes, then run the script. That way I know what part of the code is actually causing the error. This time, however, after making some changes I had to take care of an unrelated problem before I had opportunity to test the script. Now several months later, I finally have time to test, but ... I can't remember what the last changes were. | |
Has anyone written a "How to debug REBOL/View" doc? | |
Are there any debug tools? | |
Graham 14-Oct-2006 [5771x3] | Your error says 'trans-date is not defined. |
trans-date is defined in your layout .. so therefore must be reference before the layout is created if you have that error. | |
without seeing the relevant part it may be that the problem is that your style references a field which has not been defined yet. | |
Louis 14-Oct-2006 [5774x2] | Thank, Graham. I'm looking. |
I was using the wrong version of the SDK. | |
Anton 14-Oct-2006 [5776] | Louis, you're doing something strange there with the SHOW in the feel. |
Louis 14-Oct-2006 [5777x2] | I couldn't find the error because it didn't exist in the code. :>) |
Anton, you mean because there are two shows? | |
Anton 14-Oct-2006 [5779x2] | No, when you specify a feel spec block, you're actually doing something like this: feel: make feel [ 1) engage: func ... 2) show trans-date ] |
You are making an object. On line 1) you are replacing the value of the 'engage word with a new function value of your own. On line 2) you are simply doing some code. So this code executes at the time of the object creation. | |
Louis 14-Oct-2006 [5781] | OK, how do I do it right? |
Anton 14-Oct-2006 [5782x5] | Looking at the code I assume what you want to do is initialise the text facet and make sure it's shown the first time the display is shown. |
Well, you shouldn't have to SHOW the first time - that should be taken care of by VIEW or the SHOW that shows your whole layouted face in which you have your dater and trans-date field. | |
So that just leaves setting the text correctly the first time. And you are already doing that. | |
So just remove those two final lines from the feel spec. | |
By the way, to-string already makes a copy. >> same? (to string! str: "example") str == false | |
Louis 14-Oct-2006 [5787] | I'm learning a lot tonight. Thanks. |
Anton 14-Oct-2006 [5788] | Welcome. |
older newer | first last |