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

World: r3wp

[View] discuss view related issues

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.
Chris
15-Aug-2005
[2220x2]
; It seems snappier to apply backdrop and effects to 'lay itself, 
and works with resize:
lay: layout [size 200x200 backcolor blue]
lay/effect: [gradient]
view/options lay [resize]
'Seems' being the operative word -- I haven't explored potential 
downsides...
Anton
15-Aug-2005
[2222]
Yes, that's probably better. Pekr, BACKCOLOR and BACKEFFECT change 
the color and effect of the window face, while BACKDROP creates a 
new face and puts it in the window-face/pane (like any other style).
Chris
15-Aug-2005
[2223]
Or asked, why backdrop doesn't  apply to the window face...
Anton
15-Aug-2005
[2224]
Well, because BACKDROP is a face, you can do more stuff with it.
Chris
15-Aug-2005
[2225x2]
'course this'd be better than my example: [size 200x200 backcolor 
blue backeffect [gradient]]
I suppose, it's a shame you can't manipulate the window face from 
VID though (with those exceptions)
Anton
15-Aug-2005
[2227]
Yes, a /with refinement might be good.
Pekr
15-Aug-2005
[2228]
That guys, but those are by-solutions. I regard it being bug - background 
is background, no matter if you resize or not :-) Rebol resizing 
is rather weak anyway - I have seen no other app, which freezes its 
UI when you resize its window ....