BBjWindow::setRepaintEnabled

Description

In BBj 16.0 and higher, this BBjWindow method controls whether program action (such as adding controls or setting attributes of controls) will cause a repaint on the window.

Syntax

Return Value

Method

void

setRepaintEnabled(boolean enabled)

Parameters

Variable

Description

enabled

Specifies whether repaints should be enabled.

Return Value

None.

Remarks

After setRepaintEnabled(0) has been called, adding controls or modifying controls will not cause the window to be repainted. Calling setRepaintEnabled(1) will cause the window to be repainted and all modifications to the window that have been made since calling setRepaintEnabled(0) will appear.

Certain major structural changes to the window always force an immediate repaint.

Example

rem ' BBjWindow::setRepaintEnabled

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()
title$ = "BBjWindow::setRepaintEnabled"
window! = sysgui!.addWindow(50,50,500,400,title$,$00090003$)
grid! = window!.addGrid(100,101,102,5,5,490,350,$81ce$,50,2)
update! = window!.addButton(201,50,360,90,25,"Update Grid")
update!.setCallback(update!.ON_BUTTON_PUSH,"update_grid")
toggle! = window!.addButton(301,150,360,220,25,"Toggle setRepaintEnabled")
toggle!.setCallback(toggle!.ON_BUTTON_PUSH,"setRepaintEnabled")
for row = 0 to 49
    tmp$ = str(rnd(99999))
    grid!.setCellText(row,0,tmp$)
    tmp$ = str(10 * row:"#########0")
    grid!.setCellText(row,1,tmp$)
next row
window!.setCallback(window!.ON_CLOSE,"eoj")
gosub setRepaintEnabled
process_events

eoj:
release

update_grid:
    window!.setRepaintEnabled(setRepaintEnabled)
    print "getRepaintEnabled: ",window!.getRepaintEnabled()
    rowHeader! = grid!.getRowHeader()
    set = !set
    print iff(set,"Set","Clear")," row header text."
    for row = 0 to 49
        wait .02
        text$ = iff(set,"Row "+str(row),"")
        rowHeader!.setCellText(row,text$)
    next row
    window!.setRepaintEnabled(1)
    print "getRepaintEnabled: ",window!.getRepaintEnabled()
return

setRepaintEnabled:
    setRepaintEnabled = !setRepaintEnabled
    print "setRepaintEnabled",setRepaintEnabled
return

See Also

BBjAPI

BBjSysGui::setRepaintEnabled

BBjWindow::getRepaintEnabled

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.