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

World: r3wp

[View] discuss view related issues

james_nak
10-Aug-2005
[2170x2]
Is there a way to generate buttons on the fly? I've often wondered 
about that.
But thank you all, your explanations make sense.
Anton
10-Aug-2005
[2172]
do http://www.lexicon.net/antonr/rebol/gui/iterated/list-of-checks.r
Volker
10-Aug-2005
[2173]
Yes there is. After all vid-styles are faces, and can be used at 
that level, means put in a face/pane.
james_nak
10-Aug-2005
[2174]
Didier's delete-email.r has a text list that seems to work. I'll 
have to check to see what he is doing differently.
Volker
10-Aug-2005
[2175]
the easiest way imho is to make the button in a layout and throw 
the layout away.
  layout/tight[my-button: button "test" [..]]

and now you have a button in 'my-button, which you can use in another 
face/pane
james_nak
10-Aug-2005
[2176]
Thanks all.
Volker
10-Aug-2005
[2177]
Hmm, Antons way works too. He has all face-states extra in a block. 
In supply he puts it in the face, and in action-block, when it is 
changed, he puts that value back in the block. That could be used 
now with set-face/get-face with some styles.
james_nak
10-Aug-2005
[2178]
I'll check that out.
Anton
10-Aug-2005
[2179]
do http://www.lexicon.net/antonr/rebol/gui/iterated/list-of-toggles.r
james_nak
10-Aug-2005
[2180]
Thanks Anton!
[unknown: 10]
10-Aug-2005
[2181]
Cyphre, my compliments on the nice demos on your site... I like SWIS 
and the vconsole rocks :)
Anton
11-Aug-2005
[2182x2]
James, cool. Hope it helped. Just uploaded improved version in which 
the list is more self-contained (not so many external variables lying 
around).
(essentially the same.) More fiddling involved with a list of buttons, 
though. The button style feel must be modified to save the state 
when it changes in engage, such as when the mouse drags off the button 
(and then perhaps back on again.)...
james_nak
11-Aug-2005
[2184]
Thanks. I'll take a look at it. Man, how do you know this stuff?
james_nak
12-Aug-2005
[2185]
Anton, I thought your example was superb. I started to adapt it to 
my "grid" of toggles but as usual I'm not thoroughly understanding 
what's going on and I can't make my 4 x 48 grid without the rows 
being the same toggle.
[unknown: 10]
13-Aug-2005
[2186]
Is it or isnt it...the mouse-wheel in rebol..? looks not...
Pekr
13-Aug-2005
[2187x3]
it is ...
http://www.rebol.com/docs/view-system.html#section-5.10- look at 
scroll-line and scroll-page events ...
Some week or two ago someone posted kind of visual app to see even-flow 
... maybe link could be reposted here, but dunno if it featured mouse 
wheel events ....
[unknown: 10]
13-Aug-2005
[2190]
Thanks... !
PhilB
13-Aug-2005
[2191]
You can process mouse wheel events in view .... AltMe does it for 
example .... I believe that the event type is  .... event/type = 
'scroll-line
[unknown: 10]
13-Aug-2005
[2192]
Does anyone have a good performance with Rebol/view and i.e. Hummingbird 
Remote Desktop?  Seems Rebol is quiet slow here where GTK GUI is 
flashing over my screen my Rebol gui's do need far more time..
Any hint of tip is welcome..
Graham
13-Aug-2005
[2193x2]
I previously used this for buttons with images :


view layout [ button "Reply" 60 font [align: 'right] myimage effect
[] ]

but this doesn't work for btn

view layout [ btn "Reply" 60 font [align: 'right] myimage effect
[] ]
myimage: load 64#{
R0lGODlhDwAMALMPAKnZ+P/yqvSs/83x/fnP//3kj/GT////9f/9zwAAAP//6eT3
/Hd8oUNJdvTReAAAACH5BAEAAA8ALAAAAAAPAAwAAARX8MnHap1YsnMUCkymKdzx
FSHGIGR3JsnUBHRROHhCJGmzBp9AQbeDJRoDBqhCJAiexwWAsVg0nwLDcTo4VHVP
g/hIrQ7Oiaxxewa43QltQ9Ko2++w+SMCADs=
}
Chris
14-Aug-2005
[2195]
view layout [btn "Reply" 60 effect [extend draw [image 5x5 myimage]] 
para [origin: 20x2]]
Graham
14-Aug-2005
[2196]
Kewl .. thanks.
Anton
14-Aug-2005
[2197x5]
James, what do you want to do with your grid of toggles ? (sounds 
like could be used for an audio application, like drum patterns). 
Do you want them to have different texts and colors as well, etc. 
?
Here is a demo of a box receiving mouse scroll-wheel events:
view layout [b: box navy feel [engage: func [face action event][print 
[event/type event/offset]]] do [focus b]]
In my recent explorations of the view system, I found it necessary 
to see what is going on.

This program shows detect, engage and over functions in action for 
a face and its subface:
http://www.lexicon.net/antonr/rebol/doc/event-flow-diagram.r
(this doesn't show scroll-wheel events, but it does if you FOCUS 
the first face in the layout. eg.
	layout [... b: big-label ... do [focus b] ]
james_nak
14-Aug-2005
[2202]
Anton, again thanks for your expert help. What I am trying to do 
is to set up a grid that has 15 minute increments as toggles for 
a whole day. To make it easier for the user, I wanted to have the 
4 columns: morning, afternoon,evening and night. Your program helped 
me with getting the rows to be different but the columns were the 
same. Just minutes ago the idea came to me that perhaps I have been 
approaching it all wrong and the simple answer (although not too 
elegant perhaps) was to just create 4 individual lists across. It 
works so now I can clean up my "scratch" app and move on to making 
the actual tool. Thanks Anton. You don't know how much you have helped.
Anton
14-Aug-2005
[2203x7]
James, I'm on to it. Shouldn't be hard.
http://www.lexicon.net/antonr/rebol/gui/iterated/grid-of-toggles.r
Are events really comparable? It looks like some events are sent 
twice:
mold-event: func [e][remold [e/1 e/2 e/3 e/4 e/5 e/6 e/8 e/9 e/10]]
old-event: none
view layout [
	b: box navy feel [
		detect: func [face event][
			print [same? old-event event mold-event event]
			old-event: event
		]
	]
]
(hold the mouse over the blue box, look for TRUE at the left)
Is it really that the same event is sent twice ?
(or are events not properly comparable with SAME?)
james_nak
14-Aug-2005
[2210]
Anton, wow, you make it seem so easy. You really understand how Rebol 
works. Thanks. That's a much more elegant way than I had done.
Pekr
15-Aug-2005
[2211x5]
I tried to define my own stylesheet. I used backdrop, but it does 
not seem to adapt to resizing. So I used backeffect, but it seems 
to me I can't use it inside stylize/master?
hmm, even backeffect is buggy .... even without resizing it does 
not cover whole background, oh my ...
it seems to me, that backeffect is recalculated wrongly, if 'resize 
window option is used. Can anyone confirm? It seems as low-level 
buffering bug - I can see background screen underneath :-)
view/options layout [backeffect compose [gradient 1x1] btn "Quit" 
[quit]] [resize]
... sorry if there is bug in above code, wrote it off-hand ...
Anton
15-Aug-2005
[2216x4]
Cool James, but it can be yet more elegant, using a single iterated 
face instead of four (one for each column), but it's not a concern 
for your app, as you have a fixed, small number of columns (4).  
If it was a grid of large or "infinite" width, then you would better 
program the list's pane function yourself.
Pekr, this is an old problem, as I recall. Now what was the solution 
again..?
;Found it: You have to WAIT:

view/new lay: layout [size 200x200 bd: backdrop blue effect [gradient]]
bd/size: lay/size: lay/size + 40x40  ;== 240x240
show lay
wait 0.01
You can notice some other quirky bugs related to resizing the window 
and backdrop, too.