AltME: R3-GUI

Messages

Josh
Cyphhre, hehe, I never used get--face in R2 vid
Thank you for the explanation, I will adjust my R2 behavior as well!
Josh
I had always used /text and /data refinements
Josh
Looking at the source for GET-FACE, I don't see any calls to GET-FACET
AREA's facet TEXT-EDIT looks like it just stores the initialization, and the state/caret objects contain run-time data
Josh
Different for text-tables (from previous example)?  
>> get-face tt2
== none
have to use /field refinement
Cyphre
"Looking at the source for GET-FACE, I don't see any calls to GET-FACET" - true, as I metioned above...the internal implemetation of getter/setter interface is not important for app developer. He just needs to know what "fields" the style can get/set etc (will be documented in the new R3GUI docs)
But if you are interested in the GET-FACE internals: the GET-FACE calls ON-GET actor of the style. The style programmer can write the ON-GET (and also simmilarly ON-SET) actor whatewer he wants. So the real internal logic(may include direct access to facets) how the style returns your requested values is inside the actor.
For more info you can read following section in the docs: http://development.saphirion.com/rebol/r3gui/actors/index.shtml#sect8
"Different for text-tables (from previous example)?  
>> get-face tt2
== none
have to use /field refinement"
Yes, that's possible. The behavior of get/set-face is completely in hands of style programmer. Regarding the text-table: maybe the "get-face tt2" default call couls return a block with complete data of the table? Or some other value? You can dicuss this here with Rebolek(author of text-table) and any other R3GUI users.
Josh
I think my first thought would be get-face FACE would return the whole data block

Marco
Speaking of this I'd like to know your opinion about the generic problem of setting/getting a value of a face. Which one of the following methods would you like best?
    face/size: 20x30 show face
    face/set 'size 20x30
    face/resize 20x30
    set-face face 'size 20x30
    resize-face face 20x30
and here are their generic implementations:
    face/set: func [attr value /no-show][
        switch/default attr [
            'size [self/size: value]
            ;...
        ] [set in self attr value]
        unless no-show [show self]
    ]
    face/resize: func [value /no-show][
        do pick [self/set self/set/no-show] none? no-show 'size value
    ]
    set-face: func [face attr value /no-show][
        switch attr [
            'size [do pick [face/resize face/resize/no-show] none? no-show value]
            ;...
        ]
    ]
    resize-face: func [face value /no-show][
        do pick [set-face set-face/no-show] none? no-show 'size value
    ]
Robert
I like this: "face/size: 20x30 show face" but it's not good as you code hard against the widget internal structure. One change and you have to change your code.
So, this is the way to go: set-face face 'size 20x30
Henrik
I agree with Robert on SET-FACE.

DideC
Hi all,
In this file https://github.com/saphirion/r3-gui/blob/master/source/text-keys.r3
line 92, I see what could be a typo: "delete deslect"
I don't see any other "deslect" in all the files in source/
(reposted to be readable due to the link)
line 92, I see what could be a typo: "delete deslect"
I don't see any other "deslect" in all the files in source/
Gregg
Well, there are other 'deselect references around it, so I assume that's what it should be.
DideC
I suppose too. But I don't have the insight of r3gui to be sure. So I let whose who know (make) it to correct it.
GrahamC
@DideC .. I've mentioned this typo on the 22nd May, but now we have the sources on github it seems the appropriate way is to fork, fix and make a pull request ...
Cyphre
Marco, since R3 GUI uses own resizing algorithm you should read the documentation first to get the idea. Things like face/size: XxY won't work anymore for you. (unless you "force" to turn the resizing off for certain face(s) or implement own "custom" layout style that is not based on PANEL/GROUP containers)
To lcarify my answer: R3GUI can ofcourse use absolute positioning or any other resizing algorithm possible. The resizing is not "hardcoded" in the R3GUI core code. Anyone can implement own Layout style that treats the contained faces in any way.

Last message posted 267 weeks ago.