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

World: r3wp

[View] discuss view related issues

Gregg
7-Mar-2007
[6859]
Yeah, the View system isn't the easiest thing to work with sometimes. 
OTOH, it's not so bad when compared to, say, writing Windows custom 
controls.
Maxim
7-Mar-2007
[6860]
Not saying its better else where  ;-) ... I guess I'll have to make 
a memoriser within a custom key handler callback in GLayout. that 
way within the action I can check if the last key press was tab or 
enter.  :-)
Anton
7-Mar-2007
[6861x4]
Maxim, FIELD's FEEL is not so obscure. You need to bind to CTX-TEXT 
and SYSTEM/VIEW, that's all.
Familiarity with the code and a willingness to explore is all you 
need. Eventually you realise those two contexts are the most important 
ones in the View system.
Actually, investigating what happens when you press tab leads to 
the following solution:

view layout [field with [refocus: func [shift][print "tab pressed"]][print 
"action"]]
The way to this solution:
print mold svv/vid-styles/field/feel  ; notice: "edit-text"

print mold get in ctx-text 'edit-text  ; notice: "tab-char" handler
Maxim
7-Mar-2007
[6865x5]
Familiarity with the code and a willingness to explore is all you 
need. Eventually you realise those two contexts are the most important 
ones in the View system.

  I have been peeking around for since view 1.0 and still continue 
  to find new things... sometimes, its just sucha pain, that I give 
  up.  the ctx-text cannot  be infered by the code... so I have never 
  been able to find it.
which is why I ask... cause for other things, I have found the solution 
which others might not have.
this is what I like about our community.  we all share. not much 
"protection" going on here.
In this example, I have been trying to find the damned edit-text 
funtion for a few hours when I wanted to edit and just didnt' find 
it.  system/words is huge.  I'm happy you found it... I just never 
got to it...yet I found out other things.
I am one of the people who can claim a certain level of advancement 
with VID and view, and yet why do I keep fiddling around with such 
things...  there are so many little details to remember that it comes 
to a point where I keep forgetting what I haven't played with within 
a year... but it always comes back to bite me the year after ;-)
Anton
7-Mar-2007
[6870]
That's why we write things down :)
Maxim
8-Mar-2007
[6871]
hehe you have time?
Anton
8-Mar-2007
[6872x2]
Yes, I like to write things down that I think will save me time later. 
x N
But, if it took you more than 15 minutes to find edit-text, why didn't 
you just ask someone here ?
Maxim
8-Mar-2007
[6874]
sometimes... we don't have access to the good things in life.
Henrik
8-Mar-2007
[6875]
I completely agree with Maxim, although I don't forget the things, 
but it still takes a long time to figure out how to do trivial stuff 
with a field.
Maxim
9-Mar-2007
[6876x2]
anyone know if there is a way to make image! with a filled bg color?
I can use a face and call to-image on it, but I'd think that creating 
the image directly is faster, especially since I wanted to use the 
draw command directly on the bitmap too.
Henrik
9-Mar-2007
[6878]
make image! [20x20 red], I think
Maxim
9-Mar-2007
[6879x4]
nope
a ha... has to be reduced first  :-)
thanks.
this works:

make image! [20x20 255.0.0]
Henrik
9-Mar-2007
[6883]
you can make a transparent image too with 0.0.0.255
Maxim
9-Mar-2007
[6884x2]
strange, I am sure I tried the above yesterday at 2 AM..  but didn't 
get a result... might have tried with to-image
although I am already using 
make image! 20x20 


when you've slept 15 hours in 4 days... I guess the mind gets a bit 
fuzzy.
btiffin
3-Apr-2007
[6886]
Hi,


   Anyone know the inner workings of the  browse  native under Linux? 
    I lost a working browse with 2.7.5, and had to put in the old hack 
   using call.   I was hoping I could just configure my Linux to help 
   the native browse find a browser.
Graham
3-Apr-2007
[6887]
It doesn't.
Gabriele
3-Apr-2007
[6888x2]
i haven't checked the recent versions... but browse used to just 
call /usr/bin/netscape (or variants of that) on unix.
you could strace rebol while using browse to figure out what's going 
on.
btiffin
3-Apr-2007
[6890]
Gabriele: Thanks... trying...
strace -f didn't show me much.
I then tried

cp konqueror netscape   in /usr/bin/  as root  and it definetly changed 
something cause now I'm getting 
sh: -c: line 0: unexpected EOF while looking for matching `"'

On the right track it seems...
Thanks.
Alan
3-Apr-2007
[6891]
doing a search found this : Brian: browser for  Rebol/View >1.2.1 
set-browser-path "path/to/firebird -url "

for Rebol/View 1.21 (may not work on linux): append clear netscan/def-browser 
"path/to/firebird -url "
btiffin
3-Apr-2007
[6892]
Alan;  I think set-browser-path has been deprecated (or at least 
hidden from public REBOL word lists) for security reasons.  My 2.7.5.4.2 
doesn't expose that word.  But thanks.  All pointers will help.
Alan
3-Apr-2007
[6893]
guess so as I have not been able to get it working on the Amiga either 
:(
btiffin
3-Apr-2007
[6894]
I'm lucky and have a fire-and-forget brain.  I solved this problem 
(with the help of others) on an older Debian 3.1 box.  And I forget 
how it was done.  If we are patient, one of the guru's will give 
us that little tidbit that gets the problem solved.   For what it 
is worth this is the hack I've been using.

linux?: equal? fourth system/version 4
if linux? [
    attempt [unprotect 'browse]
    browse: func [value [any-string!] /only] [
	    call reform ["konqueror " rejoin [{"} value {"}]]
    ]
]
Alan
4-Apr-2007
[6895]
thanks will try that with the Amiga/Mandriva
Henrik
9-Apr-2007
[6896]
does anyone ever get "Bad font style!" when setting fonts in a VID 
layout under Windows? The same layout does not cause errors under 
MacOSX.
Ammon
9-Apr-2007
[6897]
I've seen that error but I don't recall the solution. :(
Anton
9-Apr-2007
[6898]
what is the font style ?
Ashley
10-Apr-2007
[6899]
Note that there is a subtle difference between:

	style: none

and:

	style: 'none

I've been caught by this a few times.
Henrik
10-Apr-2007
[6900x5]
view layout [backdrop white at 100x664 pad 0x-28 text "Xcv"
    left
    400 font [
        style: [none none]
        name: "Arial"
        size: 40
        offset: 0x0
    ] para [origin: 0x0 margin: 0x0 indent: 0x0] pad 0x28
    at 0x0 box 0x0 effect [draw []]
]
OSX doesn't seem to bother with it and provides the correct layout.
I know the style block seems it may not be reduced, but the original 
code is:

font-block: compose/deep [
  style: [(all [italic 'italic]) (all [bold 'bold])]
  name: (name)
  size: (size)
  offset: 0x0
]
it is the style that's causing it, but still don't understand why 
it works correctly under OSX...
is it possible to merge the face text with an effect to, say, rotate 
the text 90 degrees?
Rebolek
10-Apr-2007
[6905]
only AGG text. Or you have to render text to bitmap (to image! face 
...) and then use the bitmap.
Henrik
10-Apr-2007
[6906]
OK, that does it. I'm going to try imagemagick anyway and see if 
I can get that working.
Gregg
10-Apr-2007
[6907]
ImageMagick works well. I've only needed and done simple stuff with 
it--it's so feature rich and complex, I don't have time to dig in 
and do fancy stuff.
Henrik
10-Apr-2007
[6908]
well, it won't work here now since I read it requires ghostscript 
to do what I need. I'm not going to balloon a 130 k script to 30 
Megs, just for that :-)