World: r3wp
[View] discuss view related issues
older newer | first last |
Volker 27-Sep-2006 [5634] | Why want you do that? If you want to refine things after layout, you can do instead: lay:layout[..] do extras view lay I |
Janeks 27-Sep-2006 [5635x2] | Something is totaly wrong I I can't get to run new version of my script in my web page. I am changeing version numbers to the same at the both ends (html page and script) - no success.? What else could I missed. |
O'k I somehow managed to view chages in Plugin object frame by using new script instead of old one (saveiing old one as old01.r and putting it in html page). But Volker's example does not work for me, fex: mainWin: layout [ t1: text "AAA" button 200x20 "Atvērt kārtis" [ do something ] do [ t1/text: "Text changed" show t1 ] ] view mainWin | |
Anton 27-Sep-2006 [5637x5] | What exactly does not work ? |
I presume you see the window with the text and the button. Do you see "Text changed", or "AAA" ? | |
Probably you only see "Text" in the window. The TEXT has a constant size and the word wrap means that only "Text" can be seen. Try changing to this: | |
t1: text -1x100 "AAA" edge [size: 1x1] do [t1/text: "Text changed" show t1] | |
Look here: print mold svv/vid-styles/text/init where it says: size: (size-text self) .... We can do the same: view layout [ t1: text "AAA" btn "Modify" [ do bind [ text: "Text changed" size: 1000x200 size: (size-text self) + (edge-size? self) + (to-pair all [para (to-pair para/margin) + to-pair para/origin]) show self ] t1 ] ] | |
Janeks 28-Sep-2006 [5642] | I see just "AAA". What I need is to see "Text changed". It could look useless, but in real life I need similar thing, but with panes and images. I would like to open plugin main window, so that user could see all the controls on layout. When it is done, then image from internet is loaded - progress bar is changing and finaly image is displayed in the pane. It is not problem to change some control by using button when it the layout is open - of course I should take in account text size for text fields. My problem is how to invoke event that in other systems is called - "after window open" or something similar. |
Anton 28-Sep-2006 [5643] | I tested the above code with the plugin and it's working for me. There is no good reason why this should not work for you too. (There must only be a bad reason :-) |
Oldes 28-Sep-2006 [5644x3] | I'm now reviewing one of my old View script and I need to turn of antialiasing to make it compatible with the AGG draw, what's the command please? I cannot find it. |
I've found it, it's anti-alias off not antialias :-) http://www.rebol.com/docs/draw-ref.html | |
Hmm, it's not good, that now it will throw error if I use older Rebol version:( | |
Janeks 28-Sep-2006 [5647x2] | Well, Anton first my mistake was connected with that plugin used previous version of script. To better see my problem, than try this: mainWin: layout [ t1: text "AAA bbbbb" button 200x20 "Do something" [ do something ] do [ wait 10 t1/text: "Text changed" show t1 ] ] view mainWin Then you wil of course get text changed but before 10 seconds you will only see just "Rebol/Plugin 2.6.2.3.1", but not the layout - layout appears after 10 seconds and then of course t1 is cahged. But I need at first to see layout and then after 10 seconds t1 is changed. |
But in wait 10 place I have load http://server/image.ext | |
Anton 28-Sep-2006 [5649x2] | Well you must do: view/new mainWin: layout [ t1: text "loading..." pic: image 73x76 ] pic/image: load http://server/image.ext t1/text: "loaded." show window do-events |
See working code: http://anton.wildit.net.au/rebol/plugin/browser-plugin-test.html http://anton.wildit.net.au/rebol/plugin/browser-plugin-test.r | |
Janeks 28-Sep-2006 [5651] | O'k - thanks, Anton! Now it is clear! |
Anton 28-Sep-2006 [5652] | You're welcome. |
james_nak 5-Oct-2006 [5653] | Does anyone know how to turn on/off the busy indicator at will? I'm moving files with services and it would be nice to show that something is happening. Thanks in advance. |
Volker 5-Oct-2006 [5654] | system/options/quiet: false ; ? |
Pekr 6-Oct-2006 [5655] | I have one question from Bobik, to which I don't know an aswer: he's trying to stylize/master his field, but it does not work for him, unless he uses full path in 'engage function, e.g.: system/words/ctx-text/edit-text face event get in face 'action whereas 'field itself does not need full path specified. Why such a difference? Or is he doing anything wrong probably? |
Volker 6-Oct-2006 [5656] | Because 'field is bound there. probe ctx-text/edit thats the feel plugged into 'field. |
Pekr 6-Oct-2006 [5657x3] | REBOL [] stylize/master [ myfield: field with [ feel: make feel [ engage: func [face act event][ switch act [ down [ either equal? face focal-face [unlight-text] [focus/no-show face] caret: offset-to-caret face event/offset show face ] over [ if not-equal? caret offset-to-caret face event/offset [ if not highlight-start [highlight-start: caret] highlight-end: caret: offset-to-caret face event/offset show face ] ] key [ if event <> newline [ edit-text face event get in face 'action ] ] ] ] ] ] ];end of stylize? halt |
So you just can't take original field feel method, and use it inside of stylize? | |
that was wrong, sorry: REBOL [] stylize/master [ myfield: field feel [ engage: func [face act event][ switch act [ down [ either equal? face focal-face [unlight-text] [focus/no-show face] caret: offset-to-caret face event/offset show face ] over [ if not-equal? caret offset-to-caret face event/offset [ if not highlight-start [highlight-start: caret] highlight-end: caret: offset-to-caret face event/offset show face ] ] key [edit-text face event get in face 'action] ] ] ] ];end of stylize? view layout [f1: field f2: myfield button "End" [quit]] | |
Volker 6-Oct-2006 [5660] | Theres a trick. feel: make feel bind [..] ctx-edit |
Pekr 6-Oct-2006 [5661] | f2 field crashes the script ... it does not know focal-face, neither it does edit-text |
Volker 6-Oct-2006 [5662x4] | then it finds edit-text withut path. BTW you only need ctx-text/edit-text, not that system/words before. |
field is defined inside system/view. | |
so it can shortcut system/view/focal-face too. bind to both. | |
In the sdk-source they are nested there. | |
Pekr 6-Oct-2006 [5666] | hmm, that is guru stuff ... although I do seem to understnad the bind, I think I also understand, while less experienced user is in hell ... then stylize/master is insufficient imo |
Volker 6-Oct-2006 [5667x2] | The other trick is to edit the feel to use full pathes. |
system/view/focal-face, unlight-text, highlight-start, caret. and ctx-text/edit-text. | |
Pekr 6-Oct-2006 [5669] | well, it is just - stylize/master is here for you to define new style ... looking into other ones. It should not presume you know about where the stuff is bound ... the question is, if it could be cured :-) after all - touching stylize/master you are already touching the guru stuff, so you better know what you are going to do ... and how :-) |
Volker 6-Oct-2006 [5670x2] | Its not stylize fault. its rebol and defining things in another context. |
That style is not written to be probed and pasted. maybe it should. in the source it is inside the right context, so no guru-stuff needed. just a member of an object plugged elsewhere. | |
Pekr 6-Oct-2006 [5672] | would it be different looking into SDK sources? |
Volker 6-Oct-2006 [5673x3] | there is something like ctx-edit: context[ edit-text: func .. edit: make feel[..] ] |
and system/view around that. At least thats the usual way. | |
No, for system/view %source/view-edit.r there is some bind-magic at the end. | |
Anton 6-Oct-2006 [5676x2] | Pekr, what does Bobik want to do ? It looks like he wants to capture the return key (which is #"^M" and not newline by the way). |
Here is a quick way to modify the engage function, maybe it does what he wants. view layout [ f: field feel [ engage: func [face act event] head insert copy/deep second :engage [ if (probe event/key) = #"^M" [exit] ] ] ] | |
Pekr 6-Oct-2006 [5678] | I will post it to him ... what does your function do in particular? :-) |
Anton 6-Oct-2006 [5679] | Insert PROBE before head insert ... and you will know. |
Pekr 6-Oct-2006 [5680] | well, it seems to insert the code into body of engage which is used for our new engage function as a template, or something like that :-) |
Anton 6-Oct-2006 [5681] | First it copies the body of engage (copy/deep second :engage). Copying the code this way keeps the binding of all the words. Then it inserts some new code. INSERT leaves us after the insert, so we use HEAD to move back to the head of the block. The copied and modified code is then used as the body of a new engage function. Because we are creating a function using FUNC, the body block is bound to the new function's context, as usual. This means that the 'event word is bound correctly and the new code works correctly. (That's what happens anytime we create a function.) |
Pekr 6-Oct-2006 [5682] | and if 'function would be used instead? |
Anton 6-Oct-2006 [5683] | No difference there. |
older newer | first last |