Flat Attribute For Dynamic Button

emnu

Member
Hi,

I tray to set the FLAT-BUTTON attribute for a dynamic created button but i get next error:

*** UNABLE TO SET FLAT-BUTTON because the BUTTON widget has been realized. (4053)

/* CODE FRAGMENT */

/* DYNAMIC CREATION BUTTON BEGINS */
CREATE BUTTON hCurBtn IN WIDGET-POOL "ToolBar"
ASSIGN
LABEL = ENTRY(iNumBtns,"{&TOOLBAR}":U)
ROW = iRow
COLUMN = iCol
WIDTH = 5
HEIGHT = 1.13
FRAME = FRAME DEFAULT-FRAME:HANDLE
SENSITIVE = IF ENTRY(iNumBtns,"{&TOOLBAR-BUTTON-INIT}":U) = "TRUE" THEN TRUE ELSE FALSE
VISIBLE = TRUE
TOOLTIP = ENTRY(iNumBtns,cToolTip)
FLAT-BUTTON = TRUE
TRIGGERS:
ON CHOOSE PERSISTENT RUN prcTbActions IN THIS-PROCEDURE (INPUT hCurBtn).
END TRIGGERS.

/* assign images */
hCurBtn:LOAD-IMAGE-UP(cImageFileU).
hCurBtn:LOAD-IMAGE-DOWN(cImageFileD).
hCurBtn:LOAD-IMAGE-INSENSITIVE(cImageFileI).

/* DYNMIC CREATION BUTTON ENDS */

Any clue ?

Thanx for any response
 

jongpau

Member
Hi Emmanuel,

Try moving "FLAT-BUTTON = TRUE" to somewhere above the "VISIBLE = TRUE". As soon as you set the VISIBLE attribute to TRUE the widget will be realized and some attributes cannot be changed anymore.

HTH
 
Top