/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/resource.py
ViewVC logotype

Annotation of /branches/WIP-pyshapelib-bramz/Thuban/UI/resource.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1303 - (hide annotations)
Wed Jun 25 09:39:51 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/UI/resource.py
File MIME type: text/x-python
File size: 790 byte(s)
Cleaned up how we determine file extensions.
(GetImageResource): Return an wxImage from our Resources.

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 jonathan 1303 from wxPython.wx import wxBITMAP_TYPE_XPM, wxBITMAP_TYPE_ANY, wxBitmap, wxImage
12 jonathan 648
13    
14     bitmapdir = os.path.join(Thuban.__path__[0], os.pardir, "Resources", "Bitmaps")
15 jonathan 1303 bitmap_extensions = {wxBITMAP_TYPE_XPM: ".xpm",
16     wxBITMAP_TYPE_ANY: ""}
17    
18 jonathan 648 def GetBitmapResource(file, type):
19 jonathan 1303 filename = os.path.join(bitmapdir, file) + bitmap_extensions[type]
20 jonathan 648 return wxBitmap(filename, type)
21    
22 jonathan 1303 def GetImageResource(file, type):
23     filename = os.path.join(bitmapdir, file) + bitmap_extensions[type]
24     return wxImage(filename, type)
25    

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26