On Tue, 10 Mar 2009, Pritpal Bedi wrote:

Hi,

> SetKey() function is thread safe, I know.
> Can it be made GT safe also?
> I have this scenario:
> Function Main()
> @ 10,10 SAY 'Test'
> SetKey( K_F2, {|| Alert( 'Hello' } )
> hb_gtReload( 'WVG' )
> ? '.'
> // Here if I press F2, alert function is executed.
> // while I am expecting that it should not as 
> // I am placed in a new window.

I so not think so. inkey() does not respect SetKey()
settings. SetKey() needs explicit support to activate
codeblok attached to given key value. See TBROWSE or
TGET code. GT does not know anything about it.

> do while inkey()<>27
> enddo
> return nil

You want to make setkey() settings local to GT driver.
I do not think it's good idea. It will stop to be thread
local for threads which shares GT.
Even if I'll change it then your next question will be
making THREAD STATIC variables used in GET system also local
to GT or sth like that.
I believe that it may help you in some of your code but it
will also break other code which now may need thread local
setting because it uses single GT driver in different threads,
f.e. with GTCTW.
So it's not a modification which is acceptable for all users.
I think that you should rather try to use extended CL53 functionality
and local to given object SetKey() setting (see setkey() methods) or
even your own function which will use CARGO value in GT driver to keep
your local GT setting. F.e. you can store hash array in GT cargo item
and use "SETKEY" index to keep your own SeyKey() array inside.

best regards,
Przemek
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to