WndCreate Function

Microchip Graphics Library

Microchip Graphics Library
WndCreate Function
C
WINDOW * WndCreate(
    WORD ID, 
    SHORT left, 
    SHORT top, 
    SHORT right, 
    SHORT bottom, 
    WORD state, 
    void * pBitmap, 
    XCHAR * pText, 
    GOL_SCHEME * pScheme
);
Overview

This function creates a WINDOW object with the parameters given. It automatically attaches the new object into a global linked list of objects and returns the address of the object.

Input Parameters
Input Parameters 
Description 
WORD ID 
Unique user defined ID for the object instance. 
SHORT left 
Left most position of the Object. 
SHORT top 
Top most position of the Object. 
SHORT right 
Right most position of the Object. 
SHORT bottom 
Bottom most position of the object. 
WORD state 
Sets the initial state of the object. 
void * pBitmap 
Pointer to the bitmap used in the title bar. 
XCHAR * pText 
Pointer to the text used as a title of the window. 
GOL_SCHEME * pScheme 
Pointer to the style scheme used. 
Returns

Returns the pointer to the object created

Preconditions

none

Side Effects

none

Example
WINDOW *pWindow;
    pWindow  = WndCreate(ID_WINDOW1,                // ID
                         0,0,GetMaxX(),GetMaxY(),   // whole screen dimension
                         WND_DRAW,                  // set state to draw all
                         (char*)myIcon,             // icon
                         "Place Title Here.",       // text
                         NULL);                     // use default GOL scheme

    if (pWindow == NULL)
        return 0;
    WndDraw(pWindow);
    return 1;
Microchip Graphics Library Version 3.06.02 - October 15, 2012
Copyright © 2012 Microchip Technology, Inc.  All rights reserved