TGPictureButton icon

Hello Rooters,

Is there a way to specify the icon, that will be displayed in an TGPictureButton other than referencing an existing file?
Let me explain what I mean:
Usually you create a TGPictureButton the following way:

where “bicon.xpm” is an existing file in the proper folder. But what if I don’t want to have that file existing and I rather want to have it in the source code, how can I tell the TGPictureButton where to find the information?

//here we are ie. in a class header:
const char * bicon1[] =
"16 16 8 1",
" 	c None s None",
".	c #808080",
"X	c #FFFF00",
"o	c #c0c0c0",
"O	c black",
"+	c #00FFFF",
"@	c #00FF00",
"#	c white",
"     .....      ",
"   ..XXoooOO    ",
"  .+XXXoooooO   ",
" .@++XXoooo#oO  ",
" .@@+XXooo#ooO  ",
".oo@@+Xoo#ooooO ",
".ooo@+.O.oooooO ",
".oooo@O#OoooooO ",
".oooo#.O.+ooooO ",
".ooo#oo#@X+oooO ",
" .o#oooo@X++oO  ",
" .#ooooo@XX++O  ",
"  .ooooo@@XXO   ",
"    ",
"     ..OOO      ",
"                "
//now we are inside a class constructor:
new TGPictureButton(bframe,bicon1)   //does not work, I don't know how to archive this

The above icon is just the source code of “cdrom_t.xpm” and just an example. But I hope you get the idea of what I am trying to do.

Thank you


Hi Lutz,

Currently TGPictureButton needs an existing file. We will take into consideration your request.

Best regards, Ilka

you can save data to temporary file and then create TGPictureButton from
this file.

we’ll try to add possibility to create pictures from “embedded” data.

Regards. Valeriy