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?
Example:
//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@@OO ",
" ..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
Lutz