r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[View] discuss view related issues

Terry
16-Jan-2005
[262x2]
That still doesnt get my bit of view code into the layout.
unless you're building the layout.. but I'm looking to add a word 
that represents some bit of view code.
Sunanda
16-Jan-2005
[264]
It's trickier if you've already usd layout to convert the dialect 
to VID objects -- then you need to read up on make-face and similar 
functions.
Pre build, just do things like:
x: [button "hi" [print "hello"]]
y: [button "bye" [print "goodbye"]]
z: []
append z y
append z x
view layout z
>>
Graham
16-Jan-2005
[265]
>> x: [ btn "quit" [] ]
== [btn "quit" []]
>> view layout do [ x ]
Terry
16-Jan-2005
[266]
I"m not just doing X, i might do Y and Z as well.
Graham
16-Jan-2005
[267]
but you didn't say that ...
Sunanda
16-Jan-2005
[268]
Terry, you probably need a lot of Composes in that case.

The Vid dialect has ti survive the Do's, so you may need to use more 
lit-words  {'button rather than button)
Terry
16-Jan-2005
[269]
this works

>> x: [quit]
== [quit]
>> view layout [btn x]
Sunanda
16-Jan-2005
[270]
You said you might need to Do it firstL
Try
 x: [quit]
 do x
to see the problem here if you do need to use do first.
Terry
16-Jan-2005
[271]
Hmm, i was just wondering if there is a way to use  'words to represent 
some vid code, be it a button, area... whatever.
Sunanda
16-Jan-2005
[272]
Yes -- but you need to append, compose or mold it to make it the 
right series of characters for Layout to understand.
Volker
16-Jan-2005
[273x2]
depends on what you are doing you can use panel:
 view layout[ panel x panel y .. ]
another way is to use styles. if you want a customized button.
Vincent
16-Jan-2005
[275]
just view layout compose [(x) (y) (z)]
Chris
16-Jan-2005
[276x4]
eFish -- note that Romano has a patch for the ctx-text object: http://www.rebol.it/~romano/#sect2.2.
 You could explore that too...
Terry, I'd suggest either 'compose or 'stylize (or 'stylize/master).
; You could set up a function or two to simplify this code:
my-styles: []
append my-styles stylize [x: btn "Quit" [quit]]
append my-styles stylize [y: btn "Print" [print 'foo]]
view layout [styles my-styles x y]
; For example -- to accumulate styles:
add-styles: func ['val spec /new /local blk][
   blk: [] if new [clear blk]
   append blk stylize head insert spec to-set-word val
]
; Usage:
my-styles: add-styles x [btn "Quit" [quit]]
Gregg
16-Jan-2005
[280]
Here's what I use for simple timers in layouts:

stylize/master [
    timer: sensor 1x1 rate 0:0:1 feel [
        engage: func [face action event] [
            if action = 'time [do-face face none]
        ]
    ]
]
eFishAnt
16-Jan-2005
[281]
aha, Chris thanks!  what I was looking for!
Ryan
16-Jan-2005
[282]
exactly what I needed to complete the undo code for my editor! Thanks 
Chris!
Terry
17-Jan-2005
[283]
Styles are the way to go.  I'm adding °styles° to the °7° system.. 
idea is to have a large collection of panes, buttons, fonts etc... 
all nicely categorized and available at anytime.  If you have some 
styles (or other code), drop it into the °7° group and I'll add it 
to the library.
james_nak
20-Jan-2005
[284]
Hello, I have an app that calls another app with a "do %..." The 
problem is that when I want to exit from the first app after closing 
the second, I am left at a command line as if I called the app from. 
Any one know how to do a double exit?
Sunanda
20-Jan-2005
[285]
Tried quit ?
james_nak
20-Jan-2005
[286]
Yes, I'm sorry, I use "quit."
Sunanda
20-Jan-2005
[287]
Hmmm, that should work....the 2nd app hasn't redefined quit has it?

(I often redefine it like this quit: :halt so I *can* get to a console 
when a large application quits)
james_nak
20-Jan-2005
[288x2]
Ah!! That was it. Sunanda, good thinking. Now I have to figure out 
how to keep it from quitting the 2nd app but that fixed that. Thanks!
Got it working fine. Thanks Sunanda.
Romano
21-Jan-2005
[290]
Chris, why don't you use stylize/styles?
Chris
21-Jan-2005
[291x3]
It didn't occur to me when composing the sample; though I assume 
you mean within the 'add-styles function?
; For example -- to accumulate styles:
add-styles: func ['val spec /new /local blk][
   blk: [] if new [clear blk]
   stylize/styles head insert spec to-set-word val blk
]
; Usage:
my-styles: add-styles x [btn "Quit" [quit]]
Hmm, that doesn't work -- I'd need to think about it...
Romano
21-Jan-2005
[294x2]
perhaps i do not understand what you want to do, but if the goal 
is building a growing set of styles, i think that this is the standard 
way:
x: stylize/styles [a: field] []
x: stylize/styles [b: field] x
view layout [styles x a "style a" b "style b"]
the first command could also be a more simple:
x: stylize [a: field]
Chris
21-Jan-2005
[296]
The idea is to take a word! and a block! and set the word! to a style 
created using the block! -- accumulating as desired.  I've implemented 
it as a wrapper for stylize...
Romano
21-Jan-2005
[297x2]
it is what stylize/styles already does, no?
only the word must be a set-word already in the block
Chris
21-Jan-2005
[299]
Yep.  That's what my function does -- puts the word in the block 
and uses stylize.
Romano
21-Jan-2005
[300]
ah, ok!
DideC
25-Jan-2005
[301x2]
Does one know what is the used of the 'text flag ?
And why does flag-face and deflag-face copy the flags block before 
modifying it ???
Sunanda
25-Jan-2005
[303]
One possibility: the default flags block may be  global -- shared 
between all default faces. So, to alter an instance, it needs a specific 
copy.
DideC
25-Jan-2005
[304]
It was my first though, but block! are not shared between object!.

Or was it done for an old View version where 'make does not duplicate 
block! ???
Anton
26-Jan-2005
[305]
I think so.
DideC
27-Jan-2005
[306]
For the 'text flag, I have found. It is used by multi/color to dispatch 
tuple! values to face/font/color or face/color.
Guest
29-Jan-2005
[307]
is there any gui designer out there ?
eFishAnt
29-Jan-2005
[308x2]
Guest, you should get your login name in Accounts.
and yes, there are some brilliant gui designers around...some of 
the best in the industry.
Guest
29-Jan-2005
[310]
thx for reply eFishAnt, are these gui designers working with rebol 
? (e.g. creating a rebol code skeletons)
eFishAnt
29-Jan-2005
[311]
there are some absolutely brilliant GUI's that various REBOLers have 
designed.  I don't know where to start the list...and there is a 
layout.r tool which generates a GUI from a pallete of styles...not 
sure what you are looking for