Hi Gregg,
 
> If your app is already handling events (e.g. by calling VIEW), you
> don't need to call DO-EVENTS again.
 
Yes Gregg that's right.
My app is for example a style definition [face with etc...] defined
in a module like the Show-menu function and all the functions
of the differents libs i write. My file app are named with .s extension
like style.
 
To load and show the application i have sys.r/start function to do
that and set the window feel of my app to show it's user-data/menu
if not none when right mouse button is press in the detect func.
Also if the app file is calculator.r the feel is also change to save
in calculator.txt the relative position on screen of the window when the
user close the app.
So all the apps are very user friendly because they always appear at
the place the user define when quitting.
 
In this function start like in the show-menu i used to do a do-events
at the end thinking that if i do not that the events process is stop.
So with your help Gregg now in the user.r i lauch the main user app with :
 
sys.r/start main-app.s
do-events
 
quit

The only time i lauch do-events it is in the user.r, perfect.
 
In fact my libs are called .r :
 
>> ? .r
Found these words:
   file.r          object!   [file split-file split-path undirize get-dir]
   locale.r        object!   [months days]
   styles.r        block!    length: 2
   sw.r            object!   [unset! error! datatype! context! native! action! ...
   sys.r           object!   [ansi-prompt ansi cd assign clic-face cls show-men...
 
sw.r IS system/words the very first lib give by Rebol !!
It is shorter to write sw.r/print than system/words/print in all the
function that use a refinement name the same as a global word.
 
> It's not like
> using the DoEvents function in VB--for those who are familiar with
that.

No and NEVER PC and M$ software at home, never use VB only
working sometimes in C++ Builder Delphi Java and after AREXX AmigaE
Rebol at home !!
 
> Right, I was wondering more about the syntax you used--using a
> set-word with "get in context", rather than using SET in the context
I don't want to define the module value (function etc... ) globaly except
when i do the module itself to debug it because the structure is :
 
REBOL []
 
debug-name: get in context
[   module-value: etc...
] 'module-value
 
; try game in french jeux d'essai or unitary tests ?!
debug-name etc...
 
I now the Rebol Style is not to have libs concept but put all the source in the same 
file BUT if you want to try Rebol PROGRAMMING IN THE LARGE not in the small how do you 
do ?
 
Many thanks again to all of you for all the informations you give on this ML !!
 
-yos

Gregg Irwin <[EMAIL PROTECTED]> wrote:

Hi Yos,

AT> I try many hacks to the code to not have the problem but
AT> without succes. How have you think about hide the do-events line ?

If your app is already handling events (e.g. by calling VIEW), you
don't need to call DO-EVENTS again. It can cause problems because you
then basically have two main event loops in your app. It's not like
using the DoEvents function in VB--for those who are familiar with
that.

AT> The encapsulation in a context (get in context) is good when the value
AT> is complex and use other functions put in this context.

Right, I was wondering more about the syntax you used--using a
set-word with "get in context", rather than using SET in the context
itself. e.g.

show-menu: get in context [
show-menu: func [v] [print v]
] 'show-menu

context [
set 'show-menu func [v] [print v]
]

-- Gregg

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.

                
---------------------------------
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout !
Créez votre Yahoo! Mail

Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.

Reply via email to