Extending button images.
[1/18] from: carl:pacific at: 28-May-2001 13:29
Shows how to reuse a button image but keep that nice look.... Let me know if it works
ok on your system.
REBOL []
if not all [view? system/version >= 1.2.0] [alert "Update now." quit]
img: load-thru/binary http://www.rebol.com/how-to/graphics/button.gif
view layout [
backcolor white
image img "Orig"
image 140x38 img "Long" effect [extend]
image 200x38 img "Longer" effect [extend]
image 70x70 img "Square" effect [extend]
image 200x70 img "Big Button" effect [extend]
image 200x38 img effect [extend 3x0]
]
[2/18] from: larry:ecotope at: 28-May-2001 14:04
Hi Carl
Seems to work OK on Win98 for the first five buttons. The sixth one is like
a thermometer with a bulb on the far right, don't know what it is supposed
to look like.
-Larry
----- Original Message -----
From: <[carl--pacific--net]>
To: <[rebol-list--rebol--net]>
Sent: Monday, May 28, 2001 1:29 PM
Subject: [REBOL] Extending button images.
Shows how to reuse a button image but keep that nice look.... Let me know
if it works ok on your system.
REBOL []
if not all [view? system/version >= 1.2.0] [alert "Update now." quit]
img: load-thru/binary http://www.rebol.com/how-to/graphics/button.gif
view layout [
backcolor white
image img "Orig"
image 140x38 img "Long" effect [extend]
image 200x38 img "Longer" effect [extend]
image 70x70 img "Square" effect [extend]
image 200x70 img "Big Button" effect [extend]
image 200x38 img effect [extend 3x0]
]
[3/18] from: gjones05:mail:orion at: 28-May-2001 16:08
From: <[carl--pacific--net]>
> Shows how to reuse a button image but keep
> that nice look.... Let me know if it works ok on your system.
I am continuously amazed at what REBOL achieves in so few commands.
Yes, works fine on Win98.
--Scott Jones
[4/18] from: ammoncooke:y:ahoo at: 28-May-2001 15:23
Don't know just what you are looking for, but the image doesn't resize or
tile for any of the buttons. On Win 2K
HTH
Ammon
[5/18] from: ptretter:charter at: 28-May-2001 16:53
On my win2k box everything looks good but the bottom button. Which looks
like a thermometer as mention before. Great thing is I didnt know I had an
older verion of /View/Pro until I ran the code.
Paul Tretter
[6/18] from: ptretter:charter at: 28-May-2001 16:51
Same here on win2k pro.
Paul Tretter
[7/18] from: allenk:powerup:au at: 29-May-2001 8:29
----- Original Message -----
From: "Larry Palmiter" <[larry--ecotope--com]>
To: <[rebol-list--rebol--com]>
Sent: Tuesday, May 29, 2001 7:04 AM
Subject: [REBOL] Re: Extending button images.
> Hi Carl
>
> Seems to work OK on Win98 for the first five buttons. The sixth one is
like
> a thermometer with a bulb on the far right, don't know what it is supposed
> to look like.
>
> -Larry
Same results as Larry, for me on Win2000.
http://www.rebolforces.com/reb/images/extend.png
Cheers,
Allen K
[8/18] from: brett:codeconscious at: 29-May-2001 8:26
Looks fine here - Win NT 4.0
That default extend effect must have some smarts :)
Brett.
[9/18] from: agem:crosswinds at: 29-May-2001 1:01
Same here on linux
-volker
>>>>>>>>>>>>>>>>>> Ursprüngliche Nachricht <<<<<<<<<<<<<<<<<<
Am 28.05.01, 23:29:22, schrieb "Allen Kamp" <[allenk--powerup--com--au]> zum
Thema [REBOL] Re: Extending button images.:
[10/18] from: carl:cybercraft at: 29-May-2001 12:29
On 29-May-01, Larry Palmiter wrote:
> Hi Carl
> Seems to work OK on Win98 for the first five buttons. The sixth one
> is like a thermometer with a bulb on the far right, don't know what
> it is supposed to look like.
Same results with Amiga.
--
Carl Read
[carl--cybercraft--co--nz]
[11/18] from: joel:neely:fedex at: 28-May-2001 19:49
Hey, guys!
Same on RedHat 7.1...
See below.
Allen Kamp wrote:
> ----- Original Message -----
> From: "Larry Palmiter" <[larry--ecotope--com]>
<<quoted lines omitted: 7>>
> > -Larry
> Same results as Larry, for me on Win2000.
Lemme guess? The extra trick in the last one
image 200x38 img effect [extend 3x0]
extends by rendering up to the third pixel column of the
image on the left, then duplicating that column as many times
as required, then rendering the rest of the image on the
right. Alternately stated, "crack" the image at the specified
column, left-justify the left part, right-justify the right
part, and fill in the gap by duplicating the specified column.
-jn-
------------------------------------------------------------
Programming languages: compact, powerful, simple ...
Pick any two!
joel'dot'neely'at'fedex'dot'com
[12/18] from: ptretter:charter at: 28-May-2001 20:09
extend Extends an image horizontally, vertically, or both. An image is
stretched without affecting its scale. For instance, a button with rounded
ends can be resized without affecting the dimensions of the rounded ends.
This allows a single button bitmap to be reused over a wide variety of
sizes. Two PAIRs are supplied as arguments. The first PAIR specifies the
offset where the image should be extended. It can be horizontal, vertical,
or both. The second PAIR specifies the number of pixels to extend in either
or both directions.
[13/18] from: carl:rebol at: 28-May-2001 20:37
That's correct. Thermometer mode.
[14/18] from: carl:rebol at: 28-May-2001 20:37
Ok, thanks to all of you who tried it.
I was seeing an odd problem occur earlier, where the extend failed
in the second face. But, I have not seen it recently. Glad to hear
it works on most systems.
Would also like to accept negative numbers to shrink the button too.
Maybe in next View rev.
-Carl
[15/18] from: petr:krenzelok:trz:cz at: 29-May-2001 6:31
Carl Sassenrath wrote:
> Ok, thanks to all of you who tried it.
I tried it too, but can't find simple way of how to let it behava like right
button? Once you use 'button instead of 'image in 'layout, it draws 'edge
around the button and it doesn't seem to be what we wanted. I tried to at
least make text provided hot, but it is a little bit difficult to center the
text upon image face. Or is there any simple aproach?
Thanks,
-pekr-
[16/18] from: ronald:gruss:libertysurf at: 29-May-2001 14:52
Hi Carl,
Tried this under W98 :
image 200x38 img effect [extend 3x0]
W98 crashed !!
Sorry "...works on most systems..." but not on mine ;-(((
Bye
[17/18] from: blazs:orac:au at: 11-Jun-2001 15:44
Hello [carl--pacific--net]
On 29-May-01, [carl--pacific--net] wrote:
> Shows how to reuse a button image but keep that nice look.... Let me
> know if it works ok on your system.
>
>From what I can tell it looks fine on the Amiga version of REBOL:
>> system/version
== 1.2.0.1.1
The bottom button looks like a thermometer for me as well :)...and the
window the buttons are contained in is not resizable, which is
expected looking at the code.
Regards
Blaz
[18/18] from: arolls:bigpond:au at: 13-Jun-2001 5:28
Referring back to Carl's original email...
You mean the effect [extend] looks like
the window should be resizeable?
No. That just means the images stretch to
the size of the button you've specified.
For resizeable layouts, you must first
specify that the main face be resizeable
like this:
view/options layout [button] [resize]
Then catch the 'resize event with your
custom event handler. Then you can do
whatever kind of resizing you want.
Quoting Larry Palmiter's modification
to Sterling's script (of 8 May 2001):
REBOL []
main-lay: layout [
b1: button red "Quit" [quit]
]
view/new/options main-lay [resize]
main-lay/feel: make main-lay/feel [
detect: func [face event] [
switch event/type [
resize [
b1/color: random 255.255.255
b1/offset: main-lay/size - (b1/size)
show b1
]
]
event
]
]
wait none
Anton.
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted