Hi Swapan,
GTWVT is no console application - that is a real (graphic) window.
What you described works also fine in GTXWC (Linux),
! but NOT in GTWVG or brand new GTQTC !
i do not really understand - a question ?
a) you must disable the window close button with:
hb_GTInfo( HB_GTI_CLOSABLE, .F. )
else the application window will close by click on this
b) after disable close button, you will get a HB_K_CLOSE inkey, when user clicks on that button.
Therefore you correctly set the EventMask:
Set( _SET_EVENTMASK, INKEY_ALL + HB_INKEY_GTEVENT )
[ just a TIP: subtract ( - ) INKEY_MOVE, to get rid of all these mouse move inkeys ( HB_K_MOVE ) ]
c) SETKEY() works in READ, MENU TO, ACHOICE etc ..
in other cases you need a loop (i.e.: do while) to check for that special inkey.
Conclusion:
your menu ' eat ' the HB_K_CLOSE, will not exit as it seem to do after a K_ESC.
My interest: what functions are you calling for your menu ?
Regards
Rolf
Hi Swapan,
GTWVT is no console application - that is a real (graphic) window.
What you described works also fine in GTXWC (Linux),
! but NOT in GTWVG or brand new GTQTC !
i do not really understand - a question ?
a) you must disable the window close button with:
hb_GTInfo( HB_GTI_CLOSABLE, .F. )
else the application window will close by click on this
b) after disable close button, you will get a HB_K_CLOSE inkey, when user clicks on that button.
Therefore you correctly set the EventMask:
Set( _SET_EVENTMASK, INKEY_ALL + HB_INKEY_GTEVENT )
c) SETKEY() works in READ, MENU TO, ACHOICE etc ..
in other cases you need a loop (i.e.: do while) to check for that special inkey.
Conclusion:
your menu ' eat ' the HB_K_CLOSE, will not exit as it seem to do after a K_ESC.
My interest: what functions are you calling for your menu ?
GTWVT is no console application - that is a real (graphic) window.
I considered it as a console only, and HMG (the only gui which I've tested a bit) as a real gui...BTW, Does GTWVT carries "command button" and other windows things?! If yes, I'm not aware of it and that would be just great. Moreover for my this 1st harbour app. wanted to keep the console commands only and not move to "complete gui" for easy maintenance...
you're right!, only a graphic window makes no GUI.
A big difference of GUI versus CUI/ TUI is the concept of input management: complex event & slot driven versus simple inkey queue.
( GTWVT is designed for use with text coordinates, but the char positions are internally calculated on pixels.
Further it have, explainable, problems with persistence of graphics - a picture to describe:
https://groups.google.com/d/msg/harbour-users/agqNvpLAwbg/jYEe3INwCngJ )
If i refer to 'console', i mean a pure only text capable window - which does not need a GUI desktop - often found in conjunction with a server only.
GTWVT can not, what you above asked - but it is a bit more than 'only console' and was once time the origin for GTWVG.
What you described works also fine in GTXWC (Linux),
! but NOT in GTWVG or brand new GTQTC !
I assume trapping of "close" button event would be required in any platform, and GTWVG or GTQTC definitely be having it. May my crude method won't work there.
both GTs theoretically can ... but
GTWVG generates a K_ESC ( if the close button is enabled ! ;-)
in GTQTC three lines must be outcommented ( i already posted, but it was refused ).
So these are NOT able in official release to trap HB_K_CLOSE ( only my personal versions does so .. )
Perhaps later on was "able" to work it under the loop also without using SET KEY...but definitely had some issues/glitches, so removed it and kept finally SET KEY for now.
for a fully control of HB_K_CLOSE you need BOTH types.
SETKEY() is needed for the case when application i.e. just stand in a getmask ( READ ).
The way with checking result of INKEY() [ or LASTKEY() ] is needed when i.e. working with a browse class and there subsequent checking user input.