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

Object extension / clipboard / scrolling images

 [1/3] from: atruter::hih::com::au at: 12-Mar-2002 17:06

Three subjects in one . . . sorry ;) -------------------------------- <SNIP>The issue, as I understand it, is that you can't add new functions and variables to TIMER. It's set of words is fixed when it is created and cannot be extended. You would have to create a new object, based on TIMER, in order to add new words to it.</SNIP> Have I missed something here? I "extend" objects all the time in the following manner . . . timer: make object! [ time: does [print now/time] ] timer: make timer [ date: does [print now/date] ] -------------------------------- On the calls for binary clipboard support and the argument that it might not be cross-platform . . . If the following were possible: view layout [ image clipboard:// ; either default to last item or some sequence qualifier ] or even save %image.clp clipboard:// then all sorts of useful functionality (like still and live picture grabbing) become possible. Even an implementation where REBOL can read from (and only the "last" item in the clipboard) but not write to would be very useful as getting data in the first place is often more problematic than what is done with it (where we at least have REBOL programmatic choices). If this "extended clipboard" functionality is only available with /View then it would by definition be as cross-platform as /View is (ie. if I have a GUI I have some basic facility to "cut & paste" binaries). The fact that different OS's have different means of getting this data to and from the clipboard should be irrelevant to REBOL. If I want to create a REBOL screen grabber then the capture initiation ("Print Screen" under Windows) is external to REBOL, it is the reference to that captured data under REBOL I am then concerned with. -------------------------------- Another simple scrolling image demo (called "Image Demo") is at my rebsite (Dobeash). Uses crop not offset though, as it also handles zooming. Regards, Ashley

 [2/3] from: greggirwin:mindspring at: 12-Mar-2002 3:16

Hi Ashley, << Have I missed something here? I "extend" objects all the time in the following manner . . . >> You're not really "extending" the object, but creating a new object using the original object as a template. This is often not a problem, but suppose you have other references to the original object. When you create the new one, those other references don't get updated, so they are still pointing at the original object, not the newly created and extended object. --Gregg

 [3/3] from: al:bri:xtra at: 13-Mar-2002 17:52

One alternative to a object is use a block, like:
>> xo: make block! 10
== []
>> append xo 'Test
== [Test]
>> append Xo func [x] [print x + 5]
== [Test func [x][print x + 5]]
>> xo/test 12
17 Andrew Martin ICQ: 26227169