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

World: r3wp

[!REBOL3 Host Kit]

Andreas
4-Nov-2010
[748x2]
hmm, i don't think any of the RDC_QUIT vectors are called, iirc
what are you going to use for the event device? some amiga-ism?
ssolie
4-Nov-2010
[750x2]
yes, setting up a timer at the moment
the current event device uses some windows-ism
Andreas
4-Nov-2010
[752x4]
yes
i have a dirty hack somewhere for linuxisms :)
using libevent
and integrated into the network device
ssolie
4-Nov-2010
[756x2]
the Dev_Event device has a #ifdef TO_WIN32 on it
took me a while to figure out why no events were happening... heh 
:)
Andreas
4-Nov-2010
[758]
do you have select(2) on amiga?
ssolie
4-Nov-2010
[759]
if RDC_QUIT isn't working should I file a bug report?
Andreas
4-Nov-2010
[760]
i think so, yes. even if it is not a bug, it'll help clarify when 
the quit callbacks are actually supposed to be called.
ssolie
4-Nov-2010
[761x2]
yes, there is select() available
I didn't think I would need it for handling gui events
Andreas
4-Nov-2010
[763]
won't help you much with windowing, i guess
ssolie
4-Nov-2010
[764]
amiga is much more like windows in that respect
Andreas
4-Nov-2010
[765]
you have a message loop :) ?
ssolie
4-Nov-2010
[766x2]
yes, very much like the windows one
Wait(), GetMsg(), etc.
Andreas
4-Nov-2010
[768]
will make porting much easier
ssolie
4-Nov-2010
[769]
btw.. how do I add line feeds in altme?  so everything isn't a new 
line
Andreas
4-Nov-2010
[770]
you click the small "pencil icon", and then send messages with ctrl-s
GrahamC
4-Nov-2010
[771]
you can also use
Andreas
4-Nov-2010
[772]
(the "pencil" toggles multi-line mode)
ssolie
4-Nov-2010
[773x2]
line 1
line 2
thanks :)
Andreas
4-Nov-2010
[775]
do you have a window opening for the window gob already :) ?
ssolie
4-Nov-2010
[776]
yes I do.. just need to handle some events now so I can make it quit 
as well
Andreas
4-Nov-2010
[777]
very nice :)
ssolie
4-Nov-2010
[778]
one small step at a time
Carl
5-Nov-2010
[779]
nice!
Cyphre
5-Nov-2010
[780x2]
Andreas, I got this in OSX when compiling your test files:
http://cyphre.mysteria.cz/tests/osx-exports.txt
(
gcc version 4.0.0 (Apple Computer, Inc. build 5026)
Apple Computer, Inc. version cctools-590.obj~12
)
Carl
6-Nov-2010
[782]
Ah, so about the same as mine.
ssolie
6-Nov-2010
[783]
I found this line in the host-kit when handling the closing of a 
window:

Close_Window(gob);	// Needs to be removed - should be done by REBOL 
event handling

My question is how do I do this the right way?


I think I need to do an RL_Event(EVT_CLOSE) and then somehow wait 
for REBOL to notify me. How will REBOL notify me it is ready to perform 
EVT_CLOSE?
ssolie
7-Nov-2010
[784]
Would CTRL-C map to the EVT_INTERRUPT event?
I'm asking because when I do this:
>> wait system/view/event-port


R3 never returns and I cannot interrupt it. I'd like to fix this 
is possible.
Anton
7-Nov-2010
[785]
Esc key is supposed to interrupt it, isn't it?
Carl
7-Nov-2010
[786x8]
Steve, on window close issue, we need to decide.


The issue is this: when use hits a close button (or causes OS-side 
close event), do we close the window at the host layer, or do we 
send an event, allowing the higher layer to pre-empt the close.
=user
Arguments can be made both ways.


The win32 code currently sends EVT_CLOSE, but also calls Close_Window().
Steve, a few comments on script interrupt...


Yes, currently, we use CTRL-C. But, it's purpose must be better defined, 
because there are really 2 types of interrupts that we want to process.
1. script interrupt: does a halt
2. program interrupt: does an exit
Because the host-kit side cannot know the state of execution in the 
core, it is necessary to use RL_Escape() to signal the event.
What we want eventually is for host-kit to detect ESC, and call RL_Escape 
for that too.  But, that requires that we use raw stdio processing 
(or use an OS that's good enough to detect and signal us on a specific 
key press), so it's not implemented yet.
Notice that on Windows, your WAIT example above will interrupt as 
expected on CTRL-C. So that part of the basic mechanism is implemented.
Anton
7-Nov-2010
[794]
+1 Close_Window() in host layer.

The scenarios I'm thinking of (eg. where an app delays the closing 
of the window to dialog you with "data is not saved!") seem pretty 
cheap in this day and age, and justifiably should not be allowed 
to preempt the window close.
There could be scenarios I haven't thought of, though.
ssolie
7-Nov-2010
[795x3]
Amiga has CTRL-D which means interrupt script and CTRL-C which means 
interrupt command (from the shell).
By script I mean a shell script but it could also mean REBOL script. 
:)
It is also possible for a window close to fail if the EVT_CLOSE event 
cannot be queued. This situation is currently ignored in the Windows 
implementation.