Whilst I was controlling the order when tabbing through GETs and keeping buttons that should not have been tabbed through avoided, there remained the issue of these buttons grabbing the focus when clicked on.
That was relatively easy to fix by adding the following code to buttons.c
- Code: Select all Expand view RUN
HB_FUNC( BTNNOFOCUS )
{
gtk_button_set_focus_on_click( GTK_BUTTON( hb_parnl( 1 ) ), FALSE );
}
and this to button.prg
- Code: Select all Expand view RUN
METHOD SetNoFocusOnClick() INLINE BtnNoFocus( ::hWnd )
now if you code as follows
- Code: Select all Expand view RUN
oBtn:SetNoFocusOnClick()
then when you click on oBtn the focus will stay set where it was.
I note that this might be very useful for buttons on toolbars.
Also a question to Antonio and other users. Should this be an option on BUTTON creation - in other words should @ row, col BUTTON command have a new clause, maybe NOFOCUS, to support such a capability directly rather than code along the following lines
- Code: Select all Expand view RUN
@ row, col BUTTON oBtn PROMPT "Some Prompt" ACTION( etc
oBtn:SetNoFocusOnClick()
just do it in one line
- Code: Select all Expand view RUN
@ row, col BUTTON "Some Prompt" NOFOCUS ACTION( etc
Regards
Doug
(xProgrammer)