Set icon

From Bennu Wiki
Jump to: navigation, search


Definition

INT set_icon ( <INT fileID> , <INT graphID> )

Set the window icon to a certain graph.

The icon will only be updated after set_mode() is called, so call set_icon() before set_mode(). The map used for the icon must be 32x32 large, but it can have different depths. After set_icon() and set_mode() have been called, the map used for the icon can be freed from memory using unload_map().

Parameters

INT fileID - The fileID of the file containing the graph.
INT graphID - The graphID of the graph to be used as an icon.

Returns

INT : true

Example

import "mod_key"
import "mod_map"
import "mod_wm"
import "mod_video"

Const
    screen_width  = 320;
    screen_height = 200;
    screen_depth  =  16;
End

Process Main()
Private
    int map;
    int iconsize      =  32;
Begin

    set_mode(screen_width,screen_height,screen_depth);

    map = new_map(iconsize,iconsize,screen_depth);
    map_clear(0,map,rgb(0,255,255));

    set_title("<-- Look at the cyan block!");
    set_icon(0,map);

    unload_map(0,map);

    Repeat
        frame;
    Until(key(_ESC)||exit_status)

End

Used in example: set_mode(), new_map(), map_clear(), rgb(), set_title(), set_icon(), unload_map(), key(), exit_status


Mod_wm
Globals None
Imported:
ExitstatusFocusstatusFullscreenGraphmodeM7MousestatusScalemodeScaleresolutionScaleresolutionaspectratioScaleresolutionorientationWindowstatus
Constants None
Imported:
DOUBLEBUFFERHWSURFACEM1024X768M1280X1024M320X200M320X240M320X400M360X240M376X282M400X300M512X384M640X400M640X480M800X600MODE16BITSMODE16BPPMODE2XSCALEMODE8BITSMODE8BPPMODEDOUBLEBUFFERMODEFRAMELESSMODEFULLSCREENMODEHARDWAREMODEMODALMODEWAITVSYNCMODEWINDOW
Functions Getdesktopsize()Getwindowpos()Getwindowsize()Minimize()Movewindow()Seticon()Settitle()Setwindowpos()