Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Adding a button to a container

After creating the button and its model listener, the application inserts the button into the XY container, as shown in the code example below.

  1. Set the location of the button in the XY container (in a WidgetPos structure), set bVisible to TRUE, and call IXYContainer_Insert() to insert the button in the XY container, as follows:
    dwpos.x = 20;
    dwpos.y = 150;
    dwpos.bVisible = TRUE;
    
    if (AEE_SUCCESS != IXYContainer_Insert(pMe->picXYCon,
                pMe->piwButton, WIDGET_ZNORMAL, &dwpos)) {
        return FALSE;
    }
    
  2. The button widget keeps a reference to the static widget it decorates, so the pointer to the static widget can be released, as follows:
    IWidget_Release(piwStatic);

When the application is run, the button looks like this: