BUI logoDWC logoBBjControl::setAttribute

Description

In BBj 15.00 and higher, this method sets a control attribute on the BBjControl.

Syntax

Return Value Method
void setAttribute(String attribute, String value)

Parameters

Parameter Description
attribute Specifies an attribute to be set for the control.
value Specifies the value of that attribute.

Return Value

None.

Remarks

This functionality is primarily intended for setting low-level BUI element attributes or DWC component attributes. When running in GUI, the attributes do not affect the control itself, but may be used by the developer.

Example

rem ' BBjControl::setAttribute

sysgui = unt
open (sysgui)"X0"
sysgui! = bbjapi().getSysGui()

window! = sysgui!.addWindow(100,100,400,400,"setAttribute",$00090083$)
window!.setCallback(window!.ON_CLOSE,"eoj")
control! = window!.addButton(100,125,25,250,25,"Control",$$)
window!.addStaticText(201,5,75,100,25,"Attribute:",$8000$)
window!.addStaticText(202,5,125,100,25,"Value:",$8000$)
attribute! =  window!.addEditBox(101,125,75,250,25,"attribute",$$)
value! =  window!.addEditBox(102,125,125,250,25,"",$$)
setAttribute! = window!.addButton(103,125,175,250,25,"setAttribute",$$)
setAttribute!.setCallback(setAttribute!.ON_BUTTON_PUSH,"setAttribute")
getAttribute! = window!.addButton(104,125,225,250,25,"getAttribute",$$)
getAttribute!.setCallback(getAttribute!.ON_BUTTON_PUSH,"getAttribute")
hasAttribute! = window!.addButton(105,125,275,250,25,"hasAttribute",$$)
hasAttribute!.setCallback(hasAttribute!.ON_BUTTON_PUSH,"hasAttribute")
removeAttribute! = window!.addButton(106,125,325,250,25,"removeAttribute",$$)
removeAttribute!.setCallback(removeAttribute!.ON_BUTTON_PUSH,"removeAttribute")

process_events

eoj:
   release

setAttribute:
  attribute$ = attribute!.getText()
  value$ = value!.getText()
  control!.setAttribute(attribute$,value$)
return

getAttribute:
  attr$ = attribute!.getText()
  attr! = control!.getAttribute(attr$)
  i = msgbox("value = """ + str(attr!) + """",0,"getAttribute "+attr$)
return

hasAttribute:
  attr$ = attribute!.getText()
  has! = control!.hasAttribute(attr$)
  i = msgbox("has "+attr$+" = "+Boolean.toString(has!),0,"hasAttribute "+attr$)
return

removeAttribute:
  attr$ = attribute!.getText()
  control!.removeAttribute(attr$)
return

See Also

BBjAPI

BBjSysGui

BBjWindow

DWC Themer App

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