Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Oval buttons

 [1/10] from: andy::flyingcat::com at: 5-Sep-2002 11:48


Hi: I'm still working away on my rebol scripts. Sometimes I think its getting easier, then I get stuck on some simple thing... I'm trying to make oval buttons, with their background the same color as the background of the rest of the face. If I do view layout [button 120x120 "test" with [effect: [0x1 oval 255.0.0] ] ] I would expect (at least, according to a line in one of the tutorials) to get an oval button on a background of red. Instead I get an oval button on a field of black. (with a blue edge) If I do view layout [button 120x120 "test" with [effect: [0x1 oval 0.255.255 ]] ] I get an oval button on a field of white. If I specify an edge view layout [button 120x120 "test" with [effect: [0x1 oval] edge: [color: 255.0.0 ] ] ] My edge is the color I specify, but the oval button is on a black background. If I specify both edge and oval color view layout [button 120x120 "test" with [effect: [0x1 oval 0.255.255 ] edge: [color: 255.0.0 ] ] ] I can get an oval with a white background and the edge I specify. But so far, I can't seem to figure out how to get the background field of the oval button to be what I actually want. --- What am I missing ? (BTW, because I need the Call command, I am using Rebol/View/Pro released version. I haven't tried any betas) Thanks, Andy

 [2/10] from: petr:krenzelok:trz:cz at: 5-Sep-2002 18:29


Andy Finkel wrote:
>Hi: >I'm still working away on my rebol scripts. Sometimes I think its
<<quoted lines omitted: 18>>
>view layout [button 120x120 "test" with [effect: [0x1 oval 0.255.255 ] >edge: [color: 255.0.0 ] ] ]
I am not sure if it is what you are asking for, but few latest View releases changed the way transparency works by default. Try putting 'merge in the beginning of effect block .... -pekr-

 [3/10] from: andy:flyingcat at: 5-Sep-2002 13:04


>>If I specify both edge and oval color >>
<<quoted lines omitted: 4>>
>'merge in the beginning of effect block .... >-pekr-
Hi pekr When I put up an oval button, I get a (for instance) blue round button that looks cut out of a solid white square, in a window with background color gray. What I want is a round blue button that looks cut out of a solid grey square (with no edge), in a window with background color gray. So what I want is basically a round, flat, blue button coming out of the background. But I don't seem to be able to get that. Rebol/view seems to pick a color for the "cutout" area automatically; I can't seem to specify what I want view layout [backcolor 255.255.0 button 120x120 255.255.0 "test" with [effect: [0x1 oval ] edge: [color: 255.240.0] ] ] For instance, is almost there; I get a yellow button, with a black cutout area, with (slightly different) yellow edges, on a window with a background yellow color. If I could control the color of that black cutout area, I'd have what I want. (since I'm using the released version of View/Pro I don't think the new merge words are available to me; and since I need Call, I'm kind of stuck with this version) Andy

 [4/10] from: mh983:attbi at: 5-Sep-2002 17:40


I'm guess this is a bug. I tried your example with the beta version of view, and the colors are what you expected, but when I run it on the 'official' view (non-pro), I always see the black background. With your last example, the cut-out area in the beta version is that slightly different yellow color, not black. So it looks like the color you set for the border should be used for the cut- out area as well. mike

 [5/10] from: greggirwin:mindspring at: 5-Sep-2002 11:49


Hi Andy, << (BTW, because I need the Call command, I am using Rebol/View/Pro released version. I haven't tried any betas) >> Try the latest releases (available at http://www.reboltech.com/downloads). Just put them in the same directory as your current version and give them different names. The pro features should be enabled if it can find your license key. Let me know if that works for you. --Gregg

 [6/10] from: mh983:attbi at: 5-Sep-2002 17:41


by the way, I didn't need to use 'merge, it just worked for me as-is.

 [7/10] from: anton:lexicon at: 6-Sep-2002 4:45


I have found the new effect pipeline in the betas so confusing I have given up before already, trying the same thing. Anyway, here is a round-about way of doing it, which works in REBOL/View 1.2.1.3.1 21-Jun-2001: img: to-image layout [ origin 0 image blue effect [oval key 0.0.0] ] view center-face layout [ button "hello" img edge [size: 0x0] ] To make the button change colour or image when you click on it, you are going to have to delve into the button more. But here's another way: view center-face layout [ button 100x50 black "hello" [print "hi"] edge [size: 0x0] effect [ draw [pen white circle 50x25 20 fill-pen red flood 50x25] key 0.0.0 ; (black) ] ] To get the colour to change when you click, you can set the 'effects facet: effect-blks: [ [draw [pen white circle 50x25 20 fill-pen red flood 50x25] key 0.0.0] [draw [pen white circle 50x25 20 fill-pen green flood 50x25] key 0.0.0] ] view center-face layout [ b: button 100x50 black "hello" [print "hi"] with [effects: effect-blks] edge [size: 0x0] ] Anton.

 [8/10] from: anton:lexicon at: 6-Sep-2002 4:59


That's right. Do not be frightened, people. Hack away at the bleeding edge sometimes. Your license key will still work with the new betas. But, I can tell you have been beaten down by your experience with windows. Now you are frightened of what could happen if you install a program. :) Don't worry, I had the same worries, but this is rebol... The worst thing that could happen is a new rebol install can steal your .r file association and/or a registry entry specifying rebol home directory is changed. In this case, you can fix it by hand, just by searching through the registry for "rebol". You will come across the rebol home directory soon enough. I tested how rebol responds on a new system by simply renaming a rebol registry directory key. When rebol.exe ran, it couldn't find that directory in the registry anymore, so it assumed that it wasn't installed and opened the install window. Anton.

 [9/10] from: g:santilli:tiscalinet:it at: 5-Sep-2002 21:38


Hi Andy, On Thursday, September 5, 2002, 5:48:42 PM, you wrote: AF> I'm trying to make oval buttons, with their background the same color as AF> the background of the rest of the face. I think OVAL is not probably the effect you need; anyway, this should be close: view layout [box 50x50 255.0.0 effect [oval key 0.0.0]] I don't seem to be able to do the same with the BUTTON style, and I wonder why. I'll have to have a closer look at it. Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r

 [10/10] from: rotenca:telvia:it at: 5-Sep-2002 23:27


Hi Andy, Gabriele and all
> I don't seem to be able to do the same with the BUTTON style, and > I wonder why. I'll have to have a closer look at it.
Try on the ufficial release: view layout [button "Try" red effect [oval 0.0.0 key 0.0.0] feel [redraw: none] edge none] Oval color is the "extern" of oval, inside is, by default, a hole on the red color of the button. The key 0.0.0 makes the extern of the oval and of the button trasparent. Edge must be none to not see the edge. Redraw must be replaced by an user function. Hope this helps. On the new betas it does not work. --- Ciao Romano PS: Amiga rulez! :-)

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted