Consultor Eletrônico



Kbase P74719: Dyn: How to change the label of a button in a smartToolBar at runtime?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   21/04/2004
Status: Unverified

GOAL:

How to change the label of a button in a smartToolBar at runtime?

FIX:

See Enhancement request #20040414-020 on Posse.

So far in 2.1A01, it is not possible to change the label of a button in a toolbar if it is not associated with a link.

Indeed, resetTargetActions is the only API that does something with the label of a button (see btButton.hdl:LABEL = {fnarg actionLabel btButton.Name}, and with a blank link (like for the Exit Button, as you can see when running the displayAction procedure), the FOR EACH btButton will not find any button with link = "-target".

Suggestions:
Implement a getBtButton function in toolbar.p to return the handle of the btButton temp-table. You will then be able to update btButton.Name and have access to the handle of the button to achieve btButton.hdl:LABEL = btButton.Name.
You should call resetTargetActions manually afterwards to resize the buttons in the toolbar.