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

World: r3wp

[View] discuss view related issues

Pekr
21-Aug-2009
[9082]
Is there an easy way of how to resize an image? I tried:

i1: load %my-img.png
i2: make image! 82x63 i1

but the image is black :-)
Henrik
21-Aug-2009
[9083]
DRAW or use effect [fit] in view
Dockimbel
21-Aug-2009
[9084]
Untested, but should work :

i1: load %my-img.png
i2: make image! 82x63
draw i2 [image i1 0x0 82x63]
Pekr
21-Aug-2009
[9085]
thanks, will test ...
Geomol
21-Aug-2009
[9086]
Pekr, if you use DRAW to resize it, the result will be anti-aliased, 
just using view and it won't.
Pekr
21-Aug-2009
[9087x2]
works, thanks. I just wanted to test, how does REBOL resize. It is 
the same catastrophe as IE. Kudoz to FF ...
Geomol - how do I do it using View?
Geomol
21-Aug-2009
[9089]
i2: to-image layout [image i1 82x63 effect [fit]]
Henrik
21-Aug-2009
[9090]
DRAW allows upward bilinear filtering, but not downward. VIEW simply 
uses nearest neighbor.
Pekr
21-Aug-2009
[9091]
What I need is smaller PNG, because SharePoint just sends original 
image to browser, instructing it to resize. IE is pretty much ugly, 
FF is OK. I tried in xnView, my friend in IrfanView, no matter what 
we do, we can't save so that it preserves transparent color ...
Henrik
21-Aug-2009
[9092]
Forget using REBOL for that, if you want to preserve quality.
Geomol
21-Aug-2009
[9093x3]
I'm not sure, if view preserves transparent!?
I think, you can preseve transparent by making a separate image from 
the alpha channel, resizing rgb and alpha separately and combine 
them in the end to a final image.
(If it's a problem otherwize.)
amacleod
3-Sep-2009
[9096x2]
How much work is involved in getting linux view to work on the ARM 
processor?


I see core running on ARM, Dec-Alfa, Sparc etc and even linux view 
runs on X86 and PPC.


Does the graphics side of view need to deal with teh processor or 
does the OS its riding on take care of that part?


I see some cheap UMPC's with touch screens that I would love to put 
my app on but they are ARM base and run CE or Linux....
It it just a matter of a recompile for that processor and OS?
james_nak
3-Sep-2009
[9098]
Does anyone know how to set the selected rows programatically within 
a text-list?
Geomol
4-Sep-2009
[9099x2]
>> main: layout [tl: text-list data ["line 1" "line 2" "line 3"]]
>> insert tl/picked "line 2"
>> view main
I look in the style and not the documentation, when finding out these 
things. Like:
>> ? tl
Then I notice picked.
james_nak
4-Sep-2009
[9101x2]
Geomol, thanks. It must be some weird user error because I thought 
I tried that and it didn't work. Thanks.
Next question (sorry). I need to make a requestor a little more sophisticated 
than the default ones. I already have a main window opened. I need 
to open this requestor on top but wait for user input. I've fooled 
around with do-events and show-popup but not getting the needed behavior.
amacleod
4-Sep-2009
[9103x3]
try inform...its modal
You can create basically any type of layout you need and it stays 
on top until user reacts to it...
Use hide-popup to close inform window
james_nak
5-Sep-2009
[9106]
Perfect. Thanks.
amacleod
5-Sep-2009
[9107]
My only beef with inform is that It is not so easy to impliment a 
window without border or title bar...I'm sure its possible but I 
have not looked into it too deep...
james_nak
5-Sep-2009
[9108]
That's true. Congratulations on your FDNY project. and speaking of 
window titles, Nick A wrote a nice script for changing titles in 
a windows environment: http://www.rebol.org/view-script.r?script=title-bar.r
(unless you really like having "Rebol" in the title bar.
Maxim
11-Sep-2009
[9109]
just discovered a nasty bug in view event handling...  anyone found 
a way to solve the following:


if you remove a face from a layout within the action of that face, 
its "away" engage feel gets stuck until you click on something... 


everytime you hover over something else, its away function is called 
even though its not even displayed in the view anymore!
Henrik
12-Sep-2009
[9110]
I suppose one would ask in the away function about visibility, but 
I guess that doesn't stop the away function from being run.
Maxim
12-Sep-2009
[9111]
exactly.
Anton
12-Sep-2009
[9112]
I remember something like that. When you click down, the View system 
has to remember which face you clicked down on. In my DO-EVENT simulation, 
I called this face the "down-face". It remembers this face so that 
it can send subsequent "drag" (away/over) events to it, until the 
up event. Obviously it takes no account of whether the down-face 
is still in the layout or not. Pity, isn't it?
Henrik
12-Sep-2009
[9113]
so why does it "unstick" when you click something? can that "unsticking" 
be simulated?
Anton
12-Sep-2009
[9114x3]
Simple, a new "down-face" is set when you click down (so the old 
one is forgotten).
I don't think it can be simulated. (You can try sending a fake 'down 
event to the engage, but I think I probably tried that.) The setting 
of the "down-face" happens in native code in DO EVENT somewhere.
Thankyou, closed source.
Maxim
12-Sep-2009
[9117]
I was about to try fiddling around in the vid sdk code to see if 
some context holds the face expecting the away events.. but your 
post sort of confirms that I won't find it  :-(
Henrik
12-Sep-2009
[9118]
anyhow, it should be RAMBO'ed, so others can see it as a known bug.
Pekr
12-Sep-2009
[9119]
new down-face is set when you click down

 - just curious. What if you would like to do multi-selection? I mean 
 - holding shift down, and selecting e.g. some list elements? You 
 have to remember all down faces, no?
Maxim
12-Sep-2009
[9120x2]
yes but not in the event system.
what happens here is that a down event always expects (and creates) 
an up event ... but since the face is removed while in the handling 
of the down event it gets mixed up and this face gets stuck somewhere 
deep  in the view core and it ends up with a reference to a face 
which isn't displayed anymore... so it tries to get that (away)  
event  to trigger over and over .


what I fear most is that the face will end up leaking RAM. but tests 
have not shown it to be the case so far.
Anton
14-Sep-2009
[9122]
A down event does not create an up event. You letting go of the mouse 
button creates the up event.
Maxim
14-Sep-2009
[9123]
there is always an up event corresponding to the down event for a 
face you clicked on, even if the face is removed from you or you 
aren't releasing the mouse over it.

  there is also a move event triggered each time for some obscure reason.
Anton
14-Sep-2009
[9124]
The reference to the "down-face" is probably stored by View in a 
single variable. When you click down again on another face, that 
reference is changed, so (I assume) there should be no problem.
Maxim
14-Sep-2009
[9125]
exactly.
Anton
14-Sep-2009
[9126x3]
If you don't release the mouse button, you don't get an up event.
What you're saying is when the up event comes, it is sent to the 
engage of the face that was clicked down on, no matter where the 
mouse is now.
But anyway, just nitpicking.
Maxim
15-Sep-2009
[9129x2]
yes and it continues to send it away events every time you cross 
the boundry of a face !
anyone know a way to prevent text-list from picking more than one 
item with ctrl?
BenBran
23-Sep-2009
[9131]
I need some clairfication in reading the syntax/specs for Rebol2.x 
stuff.
I'm sure there is a pattern, but I havn't seen it yet.

Example: taken from rebol.net/wiki/VID:_Styles#Derived_styles_2

TEXT-LIST
   size: pair!
   rows: block!

   selected: block! ; this way set-face will not work. need to solve 
   this.
   action: block!
   background: tuple!
   background-draw: block!

how do I know when to assign a value to a [word] i.e. 

lo: [text-list size: 300x200]		;;does not work 
view layout lo

and when not to use the [word] such as 

lo: [text-list 300x200] 	;; works
view layout lo


Question 2. Could someone give a one line (short as possible) example 
of setting all the values for this text-list keyword using this format 
lo: [text-list ......]
view layout lo

thanks in advance.