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

World: r3wp

[View] discuss view related issues

Volker
21-Sep-2005
[2661]
system/view/caret: none. but focus will put a string there, so you 
have to none it each time.
Henrik
21-Sep-2005
[2662]
ok, thanks
Geomol
21-Sep-2005
[2663]
Henrik, you use feel/engage to catch mouse events. You can use the 
VID style KEY to catch key events. No need to put focus on box and 
remove cursor.
Henrik
21-Sep-2005
[2664]
I tried that and it only works when you focus the box on purpose
Geomol
21-Sep-2005
[2665x2]
view layout [box red feel [engage: func [face action event] [print 
action]] key #"k" [print ["Key 'k' pressed!"]]]
Try click the box and press key 'k'.
Henrik
21-Sep-2005
[2667]
yes... by clicking the box, you focus it :-)
Geomol
21-Sep-2005
[2668]
ehh, not as the function 'focus' does. There's no cursor visible.
Henrik
21-Sep-2005
[2669]
but I needed to set the focus from within the code and before volkers 
solution I couldn't do that with turning on the cursor
Geomol
21-Sep-2005
[2670]
:-) Why do you need to set focus on box in code? It'll get the events, 
when the user press the box.
Henrik
21-Sep-2005
[2671]
but the user doesn't press the box, because it's layered below other 
faces
Geomol
21-Sep-2005
[2672x2]
And you make it get events by setting focus on it? I didn't know 
that.
I would have thought, that it was something about feeding a new event 
into the system with the face as a target. That is: creating a entirely 
new event and feed it into the event system.
Henrik
21-Sep-2005
[2674]
I have multiple buttons in my layout, but need to catch keyboard 
events at all times for global keyboard shortcuts. that's why I wanted 
to focus the box from within the code.
Geomol
21-Sep-2005
[2675x2]
Why not just use the VID KEY style for global keyboard events?
(Sorry if I ask too much.) ;-)
Henrik
21-Sep-2005
[2677x2]
because I don't know how to use that...
it's mostly a matter of stumbling onto things that work and not the 
best or most efficient way of doing things
Geomol
21-Sep-2005
[2679x3]
Ok, I've found, that using key #"<some key>" is a fine, clean way 
of catching keyboard shortcuts. A key style get the keyboard event, 
no matter what other style is in focus (unless it's a field of some 
kind of course). The key style can get small, LARGE, <ctrl>-keys, 
arrows and F-keys.
Just a hint, if you can use it.
It was a bit wrong saying: "no matter what other style is in focus". 
Most styles are not in focus like that. They get events. Putting 
a style in focus mean, it's ready for some text input. Using VID's 
key style puts an event filter high up in the event system, so keyboard 
shortcut events can be filtered, before the styles further down the 
event-system get the events.
Gabriele
21-Sep-2005
[2682]
Geomol: actually, there is a reason to focus a face without having 
a caret in it; for example, if you have two styles that can be controlled 
by the arrow keys in the same layout. VID's keycodes are global and 
detected at the window level, which isn't always a good idea.
Geomol
21-Sep-2005
[2683x2]
Aha! I've never used focus this way, but I see the point.
(Then I learned something today too.) :-)
view layout [b: box red feel [engage: func [face action event] [print 
["box" action event/key]]] key #"k" [print ["Key 'k' pressed!"]] 
do [focus b]]
james_nak
21-Sep-2005
[2685]
A couple of questions: Is there a switch to start view in the console 
mode (CLI)? I know I can do something in the user.r but I'd like 
to do it from a prompt on demand. And also, anyone have any idea 
why my emails sent via a rebol program take so long to arrive. Any 
special settings in the header or hints. I 've created a program 
that sends emails to a list but I notice that it takes a long time 
(30 minutes or more) to receive the email. I checked by sending from 
Outlook and through the command line in rebol and it  was instantaneous. 
There's something happening and I wonder if any on you  have seen 
this.
MikeL
21-Sep-2005
[2686]
james ... on the view desktop see menu User. The dialogue User Settings 
opens. On it there is a line "open desktop on startup"
james_nak
21-Sep-2005
[2687]
Thanks Mike. Can this be done programatically? I mean when I start 
rebol, I use I call it from the command line. What I'd like is to 
be able do something like "view.exe -console" for example.
Volker
21-Sep-2005
[2688]
How about a script for that? only containing halt. then "rebol con.r".
james_nak
21-Sep-2005
[2689]
Hmm. That's an idea. Thanks.
Pekr
22-Sep-2005
[2690]
does View 1.3 allow modal windows? I mean - you want user to confirm 
something and you want him/her to block from access to backrgound 
windows of your app ....
Graham
22-Sep-2005
[2691]
view layout [ title "Modal Test" button "Alert" [ alert "Modal test" 
]]
Pekr
22-Sep-2005
[2692]
main window can get focus, but at least it does seem to not being 
active event-wise ...
Graham
22-Sep-2005
[2693]
that's a bug .. that appeared in the betas.  Before that, the main 
window did not get focus.
Pekr
22-Sep-2005
[2694x2]
ah, now I see - it is based upon 'inform and show-popup ...
so did anyone anything to focus/event system in betas?
Graham
22-Sep-2005
[2696x2]
huh?
You really are trying to make us read twice!
Pekr
22-Sep-2005
[2698]
why? what did I say?
Graham
22-Sep-2005
[2699]
exactly. who knows?
Pekr
22-Sep-2005
[2700]
I don't understand your logic then ... you said there is a bug, probably 
somewhere around focusing ... I asked, if someone did any changes 
in View for beta release?
Graham
22-Sep-2005
[2701x2]
well, that wasn't what you wrote.
However, I did file a RAMBO report on this issue.
Pekr
22-Sep-2005
[2703]
second - you provided me with example .... using 'alert .... so I 
looked into alert (as I don't want just alert window, but my own 
window with some other elements, which will deny leaving focus to 
any of background windows), to see what is it based upon and so I 
just remarked that "the trick" is based upon 'inform function, which 
is based upon show-popup ....
Graham
22-Sep-2005
[2704]
http://www.rebol.net/cgi-bin/rambo.r?id=3801&
Pekr
22-Sep-2005
[2705]
OK, then my english is twisted or I do post too many thoughts in 
parallel .... if there would be some ability to attach particular 
message as an reaction to another one, it would be clearer, but I 
am not sure there is any kind of "thread based" IM client around 
:-)
Graham
22-Sep-2005
[2706]
view a: layout [btn 200x200 [view/new/options layout [btn 100x100] 
reduce ['parent a]]]
Pekr
22-Sep-2005
[2707]
you sure show-popup really blocked background windows in the past?
Graham
22-Sep-2005
[2708x3]
This is what you wrote "so did anyone anything to focus/event system 
in betas?"

I don't understand the question.
and yes, it used to stay infront of parent windows.
From memory, it changed behaviour around about March betas.