World: r3wp
[I'm new] Ask any question, and a helpful person will try to answer.
older newer | first last |
mhinson 17-May-2009 [2683] | Hi, I have read the recomended http://www.rebol.com/docs/view-guide.html so I have an idea of some of the stuff to expect from VID, but as soon as I try to do anything not explicity shown in that document I find my understanding is really very thin & flimsy. This is an example of me failing to get the results I expected. Perhaps there is just one basic step I have omitted that is messing everything else up? Any tips would be welcome & appreciated, but dont miss a Sunday snooze on my account please :-) mmm: layout [ space 0x0 ;; thought this would make items touch each other. dosnt work? my-sldr1: slider 300x10 [print "1 clicked"] ; ok my-sldr2: slider 300x10 [print "2 clicked"] ; ok space 1x1 ;; thought this would make items 1 pixel further apart. dosnt work my-sldr3: slider 300x10 [print "3 clicked"] ; ok name1: text "Inital text" 100x30 ; ok button "Change text" [name1/text: "Text now changed" show name1] ; ok button "Cente" [my-sldr2/size: 100x40 show mmm] ;; this breaks, but does make a change my-sldr1/step: 25 ;; imagined this did soemthing, but cant see or guess what, seems to break the lat button my-sldr3/edge/color: blue ;; this works but also applies its self to the last button my-sldr3/dragger/color: red ;; doesnt seem to work ] view mmm ;; ok ? mmm ;; shows components of object, reference for what they all mean is not available ? my-sldr1 ;; again guessing what they do is frustrating probe my-sldr1 ;; I know what the parts are but cant guess which ones work or what they do. |
Henrik 17-May-2009 [2684x2] | With ?, you can only see one face at a time. The subfaces are stored in PANE. If you try: probe mmm watch the console scrolling a lot of code. That's the entire face tree. |
The space 0x0 and 1x1 should work. Otherwise try space 0 and space 1. | |
mhinson 17-May-2009 [2686] | it seems that you just saying they work, causes them to work... well the space is applied to the following item with reference to the one after that, not the space between the items where the word "space" is put.... After moving the position of the space this also cause the dragger to turn red too. The probe mmm, are the 14,000 lines all of VID? |
Henrik 17-May-2009 [2687x2] | space works on elements from when SPACE is stated and then the space will stay that way for the rest of the layout description or until it's changed. If you want specific spacing between elements, PAD is used. |
probe mmm is the face tree, generated by VID, when using the LAYOUT function. It's not VID itself. | |
mhinson 17-May-2009 [2689] | Any idea why my example does so many screwy things? |
Henrik 17-May-2009 [2690] | Sorry, I didn't notice, but you can't put paths in the layout block. Those last three lines of code should be outside the layout block. |
mhinson 17-May-2009 [2691] | I had assumed all the layout refinements would be in there. would this not be appropiate either? button "Cente" [my-sldr2/size: 100x40 show mmm] |
Henrik 17-May-2009 [2692x2] | yes, that's fine, because that is an action of the button. The action is a function with 'face and 'value passed and is regular REBOL code. |
But after that block, those paths break the layout, because you are back in the dialect domain. | |
mhinson 17-May-2009 [2694] | ok, i moved the changes to outside the layout block, but this dosnt work my-sldr3/dragger/color: red and this button dosnt redisplay the layout, it just overwrites the existing stuff. button "Cente" [my-sldr2/size: 100x40 show mmm] ;; this breaks, but does make a change I am guessing that the display is not dynamic in the way I am expecting? |
Henrik 17-May-2009 [2695] | When altering a facet of a face, it must be shown before the change can be seen. This is a little complicated to explain: You have chosen to resize a slider, which is a face with subfaces. Thus if you resize a slider, you need to access its internal resize function, in order for it to properly resize the knob as well. if you alter the size of a face like above, you are literally only altering the size of the outer face of the slider. VID does not know what you are trying to do there. BUT: Given it's incompleteness, SLIDER does not have an internal resize function. :-) This is not intentional, and you've stepped into the mud here. This is one of the most lacking parts of VID, in that when the layout is set up, it can be laborious to change. Fortunately there are unofficial solutions to that, so I suggest you don't bother with this and try something else. Alternatively, try working a bit with RebGUI. |
Maxim 17-May-2009 [2696] | one thing about the space, is that it needs to be specified BEFORE the next face, cause the space is calculated when it encounters a face, so if you use space after a face, the space accorded to the previous face has already been allocated. |
mhinson 17-May-2009 [2697] | Resizing a slider is on reflection a fairly odd thing to want to do, and I was only doing it because "size" was the first thing I came across that sounded straight forward to do to test my understanding. On reflection, I think that it is unlikely for me to grasp much of what can be done with VID until it gets a makeover with the documentation. Perhaps I could contribute to the documentation on the Wiki by listing all the items that can be changed for slider & then discovering what each one does by trial & error. would this be helpfull, or just cause another job for someone to delete it in favor of a master plan? |
Henrik 17-May-2009 [2698x2] | At this point, I'm not sure it's worth documenting more. Perhaps 2-3 years ago. 90% of work is currently directed toward VID for REBOL 3 which is an entirely and far superior GUI system. |
entirely = entirely different | |
mhinson 17-May-2009 [2700] | could I use R3 for playing with graphics yet? Is the documentation public? |
Henrik 17-May-2009 [2701] | it has a few bugs, but you can play with it. docs are public. |
mhinson 17-May-2009 [2702] | I looked at RebGUI and had a play with the demos. Afraid RebGUI looks as if it would be even more complicated. I may as well start learning about R3 graphics as by the time I have learnt R3 I expect R4 wll be in development. :-) |
Henrik 17-May-2009 [2703x2] | R3 is still alpha software and the layout engine is going to be changed, since it's not laying out faces correctly many times, but the dialect is not likely to change. There are also only Carl's styles available in strong colors, and they are not so good looking. |
but the underpinnings with GOBs, text and DRAW is fairly stable. it's fun to play with. | |
Maxim 17-May-2009 [2705x3] | there is also glayout, which works very out of the box and is built over VID. the api isn't document though. you can look at the glayout-demo app on rebol.org so have an idea of all it can do. it layout engine is very complete, and seems like the basis for how R3 was implemented... they use the same philosophy. glayout handles ALL resizing automatically, and it even includes real scrollpanes, which react to content, as it changes (scrollbars resize automatically, for example) |
there are just a few pointers to know if you want to create completely new styles, its not very complicated. | |
I am using it for my ssh-tool, which will be online within a few days (once I get my web server fully operational). | |
mhinson 17-May-2009 [2708] | how do I get to the r3 console please? I just get a dos type box with a >> prompt. |
Maxim 17-May-2009 [2709] | r3 lives within the OS console |
mhinson 17-May-2009 [2710x2] | so no interactive console any more? |
or at least not for any code that splits across 2 lines | |
Maxim 17-May-2009 [2712] | what do you mean by interactive? its the same but instead of being a separate windows app, the console is directly within the dos prompt. |
mhinson 17-May-2009 [2713] | but it works complety differently? |
Maxim 17-May-2009 [2714] | no its pretty much the same. |
Sunanda 17-May-2009 [2715] | Sadly: <The R3 alpha uses the default Windows console. This is a temporary situation until the new console has been created. > http://www.rebol.net/wiki/Notes_about_Windows_Console |
mhinson 17-May-2009 [2716] | >> print [ ** Syntax error: missing "]" at "end-of-script" ** Near: (line 1) print [ |
Maxim 17-May-2009 [2717] | I hadn't noticed the multi-line difficency ! |
mhinson 17-May-2009 [2718] | So I just have to paste unformatted code only? |
Maxim 17-May-2009 [2719x3] | sunanda... for my part, I'd rather it stay there. at least we have real stdio. |
working in a telnet/ssh session for example, I can (in theory at least) use rebol remotely. | |
for my part, I'd rather use a rebol session as a remote shell, than bash. | |
mhinson 17-May-2009 [2722] | I have to format the code in indented blocks to not lose track of what I am trying to do. Sorry to be so lame. |
BrianH 17-May-2009 [2723] | I do clipboard:// |
mhinson 17-May-2009 [2724] | Ah that sounds like a plan |
BrianH 17-May-2009 [2725] | You don't even need a REBOL header anymore (I changed that). |
mhinson 17-May-2009 [2726x2] | The R3 documentation shows this example for view view layout [ h2 "The time is currently:" h3 form now button "Close" [unview] ] But it does not work. Am I expecting too much from the documentation (sorry) Could someone give me a graphics example that works please to start me off. |
Sorry, I see the R3 docs are a work in progress. I better back out of R3 graphics for now I think or I will get classed as a troll. sorry. | |
Henrik 17-May-2009 [2728] | there are actually two sets of GUI documentation. The right one is located here: http://rebol.net/wiki/R3_GUI |
mhinson 17-May-2009 [2729] | Thanks Henrik, now I have some things that work to play with.. I also want to study Glayout... AND Maxim's SSH-tool project sounds very interesting... Off to bed now, back to parsing tommrow I think. |
mhinson 18-May-2009 [2730] | I have found an example for R3 here (about the only one I could spot so far) http://rebol.net/wiki/Script_Writing_With_The_Visual_Interface_Dialect It looks quite nice with rounded corners to the buttons too. The example crashes when you try to exit so I suppose there is lots to do before this is ready for general use. I know how long developmnet cycles can take so I won't be holding my breath :-) I suspect the R2 functions built in will do more than enough for what I want & that I just need stick with one thing till I can understand it enough to know what it will do & what its limitations are. I showed my parsing project ot a work coleague & he suggested some additional data that it should colect, he was very impressed when I implimented his suggestion & tested it all in under 3 minutes. |
Janko 19-May-2009 [2731] | I am reading about these mezzaines 3 times per day here and I still don't have any clue what they are... I googled but found nothing either.. .so what are mezzaines? |
Graham 19-May-2009 [2732] | mezzanines are functions written in Rebol as opposed to C |
older newer | first last |