World: r3wp
[View] discuss view related issues
older newer | first last |
Maxim 21-Feb-2007 [6798x2] | instead of you having to remember to fill out forms. |
I've juste noticed the nice values we get for event key when pressing function keys !!! in order: console listen tcp udp icmp dns local odbc oracle | |
Gabriele 21-Feb-2007 [6800x2] | is that 2.7? that is a bug, will be fixed in next release. |
they should give f1 f2 etc of course :) | |
Gregg 21-Feb-2007 [6802] | Hmmm, I've always gotten f1, f2, etc., though I don't use them much, so this may be new. |
Gabriele 21-Feb-2007 [6803] | gregg, yes, they are supposed to be f1 etc. |
Gregg 21-Feb-2007 [6804] | I know they have been in the past. |
Gabriele 21-Feb-2007 [6805x3] | there's a bug with 2.7 where event/key, when it should be a word, is wrong |
that's probably because of the internal changes... probably wrong pointer or something like that | |
ins, del, home, end, pgup and pgdown have the same problem | |
Gregg 21-Feb-2007 [6808x2] | 1.3.2 is OK. |
Ah, just 2.7 then; OK. | |
Gabriele 21-Feb-2007 [6810] | yep. the bug was introduced in 2.7 |
Maxim 21-Feb-2007 [6811] | sorry... forgot to specify that its only 2.7 related... I just tought the values where funny... I assumed the break was that the keys didn't actually trigger... but then, on inspection... figured out what was really happening. |
Anton 21-Feb-2007 [6812] | When is the next release, by the way ? I ask because we keep stumbling on this same bug, and I think it's an easy one to fix, judging by how fast those other string bugs were fixed. |
Gabriele 22-Feb-2007 [6813] | i guess when Carl manages to escape from thread prison ;) |
Anton 27-Feb-2007 [6814x3] | Does anyone know a way how to detect when all rebol windows are inactive (ie. because a non-rebol window became active) ? |
I can trap inactive events sent to a rebol window, but I want to know whether that was because another rebol window was activated or a non-rebol application window was activated. | |
If it is a rebol window, that window gets an active event --- but this is *after* the previous inactive event. | |
Henrik 27-Feb-2007 [6817] | another window in the same rebol process or a differen rebol process? |
Anton 27-Feb-2007 [6818x2] | Same process. |
I need something like a "none-active" event that lets me know when all rebol windows are inactive. | |
Henrik 27-Feb-2007 [6820] | I would like to know that too. A program I'm making has a timer mechanism where the program must be active all the time and I want to display an alert if the window gets out of focus. |
Anton 27-Feb-2007 [6821x2] | Maybe the system port ? |
Let me dig around... | |
Henrik 27-Feb-2007 [6823] | never messed with it |
Anton 27-Feb-2007 [6824x9] | How many windows in your program ? |
If only one, it's easy - just trap inactive event. If more than one, and since you are running a timer, you can track the state of all windows and react when a timer event comes along after an inactive event which was not followed by an active event. | |
Probably that's my solution too - run a timer. | |
excellent, time events are still running even when all rebol windows are inactive. This means it's possible. | |
active-windows: [] insert-event-func event-func: func [face event][ ;print event/type if event/type = 'active [if not find active-windows event/face [append active-windows event/face]] if event/type = 'inactive [if find active-windows event/face [remove find active-windows event/face]] if event/type = 'time [ if none-active? <> empty? active-windows [ none-active?: empty? active-windows if none-active? [ print "all windows inactive!!" ] ] ] event ] view/new win1: layout [size 400x250] view/new win2: layout [size 500x200] win1/rate: 0 show win1 ; start time events none-active?: false do-events | |
Can you see any holes in this method ? (Apart from the fact that it requires time events.) | |
I discovered a problem when closing the first window which has RATE set. Now time events no longer flow and so the state isn't detected. But it is solved by catching the close event and setting RATE in a second window. | |
do http://anton.wildit.net.au/rebol/view/detect-all-windows-inactive.r | |
The above seems to be working satisfactorily. It has the limitation of setting the window/rate, though. | |
Maxim 27-Feb-2007 [6833x2] | I handle this by patching the wake-event func and checking if the screen-face/pane has any faces within (which is the pane which holds the windows). when ever this happens, it means all windows are closed. and so I quit with none which disables the do-events. |
obviously I verify after the part which handles any close event types, to make sure I trap any event which would have unviewed the last window or popup. | |
Gregg 27-Feb-2007 [6835] | Seems like it should work Anton. Another way would be to catch the inactive event, set a "deadman switch" timer to go off shortly. When a window gets an 'active event, disable that timer. |
Maxim 27-Feb-2007 [6836x3] | oops... "so I quit with none" above should have read... "so I return with none" |
hum. isn't it possible to have decimal rates? I just tried using 0.5 and am getting no 'time events. is this normal? | |
(v 2.7) | |
Gregg 27-Feb-2007 [6839] | I believe it rounds them. If you want slower rates, use a time! value (e.g. 0:0:2 for every two seconds). |
Anton 27-Feb-2007 [6840x7] | Maxim, catching all *inactive*, not simply closed. |
Gregg, I'm working on that way now. For minimal impact, I only start time events if they aren't running already, and then I restore the window/rate after I catch the first time event. | |
This version uses the "deadman switch" timer idea and is working ok. do http://anton.wildit.net.au/rebol/gui/demo-all-windows-inactive-handler.r | |
http://anton.wildit.net.au/rebol/gui/all-windows-inactive-handler.r | |
The reason I need this is for a pop-menu system (implemented with windows). When a completely different application window becomes active, I want to close all menues and submenues. | |
And it seems to be working for this application.. :) Now the long test... | |
oh no it's buggy. it works sometimes and sometimes not. Damn, time events are tricky. | |
Maxim 28-Feb-2007 [6847] | ahhh didn't notice the subtility. |
older newer | first last |