THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 27/01/2012 at 07:09, xxxxxxxx wrote:
Originally posted by xxxxxxxx
I've included the description in the res and header file (with BORDER set) and, well, the border is visible, but I have not found a way to set the bitmap. The cpp examples all listen for a MSG_DESCRIPTION_GETBITMAP message, which is never being called in my case. So, how do I set the bitmap on the button in Python?
Using Python, it's not possible to set the bitmap for a custom bitmap GUI in a description with MSG_DESCRIPTION_GETBITMAP message.
Here's how to do this in a Python plugin:
First, before you register the plugin, you register the bitmap with a valid ID:
BITMAP_ID = 100000 # Choose a unique ID!
..
if __name__ == "__main__":
..
gui.RegisterIcon(BITMAP_ID, bitmap)
plugins.Register*Plugin()
..
Then, in your res description file declare your BITMAPBUTTON element like this:
BITMAPBUTTON PLUGIN_BITMAP { BORDER; ICONID1 100000; }
In the res we can only use the bitmap ID literal value (100000), not its ID name (BITMAP_ID).