[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'nvWidgets' (#nvidia-widgets)

UIContext.doButton

UI method for rendering and processing a push button

Declaration

Source position: line 0

function UIContext.doButton(

  const r: Rect;       //optionally provides a location and size for the button

  const Text: ;       //text to display on the button

  var state: Boolean; //whether the button is depressed

  style: Integer = 0  //optional style flag to modify the look (default = 0)

):Boolean;            //Boolean result

function UIContext.doButton(

  const r: Rect;     //optionally provides a location and size for the button

  const Text:        //text to display on the button

):Integer;            //Integer result

Description

The button method does only take a text and state variable. This variable is modified if the button is pressed or depressed. When a state change occurs the method function returns True.

Example code how to implement a button

none.Rect(0, 0);
ui.beginGroup(GroupFlags_GrowDownFromRight);
  if ui.doButton(none, 'Apply') then
  begin
    //code to apply your changes
  end;
ui.endGroup;