1 |
jonathan |
648 |
# Copyright (c) 2003 by Intevation GmbH |
2 |
|
|
# Authors: |
3 |
|
|
# Jonathan Coles <[email protected]> |
4 |
|
|
# |
5 |
|
|
# This program is free software under the GPL (>=v2) |
6 |
|
|
# Read the file COPYING coming with Thuban for details. |
7 |
|
|
|
8 |
|
|
import os |
9 |
|
|
import Thuban |
10 |
|
|
|
11 |
|
|
from wxPython.wx import wxBITMAP_TYPE_XPM, wxBitmap |
12 |
|
|
|
13 |
|
|
|
14 |
|
|
bitmapdir = os.path.join(Thuban.__path__[0], os.pardir, "Resources", "Bitmaps") |
15 |
|
|
EXT_XPM = ".xpm" |
16 |
|
|
EXT_NONE = "" |
17 |
|
|
|
18 |
|
|
|
19 |
|
|
def GetBitmapResource(file, type): |
20 |
|
|
if type == wxBITMAP_TYPE_XPM: |
21 |
|
|
ext = EXT_XPM |
22 |
|
|
else: |
23 |
|
|
ext = EXT_NONE |
24 |
|
|
|
25 |
|
|
filename = os.path.join(bitmapdir, file) + ext |
26 |
|
|
return wxBitmap(filename, type) |
27 |
|
|
|