Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Show all icons in avkon.mbm (See related posts)

There are 2 type of mbm files. The following code work with
ROM-type (most mbm on Z:\) only.
>>> from appuifw import *
>>> avkon = u'z:\\system\\data\\avkon.mbm'
>>> def showicon(id_list, maskfunc=lambda x:x):
...     if type(id_list) == int:
...         id_list = [id_list] # one item
...     entries = []
...     if type(maskfunc) == dict:  # allow dict as a func
...         func = lambda id: maskfunc.get(id,id)
...     else:
...         func = maskfunc
...     for id in id_list:
...         item = u'%s, %s' % (id, func(id))
...         icon = Icon(avkon, id, func(id))
...         entries.append((item, u'', icon))
...     app.body = Listbox(entries, lambda: None)
...
>>> showicon(range(503))  # all icons, including mask
>>> showicon(range(0,100,2), lambda x:x+1)  # first 50 icons, with their mask brother

You need to create an account or log in to post comments to this site.


Click here to browse all 5147 code snippets

Related Posts