A simple example of creating icon image from XPM data, included into the code.
const char * const icon1[] =
{
"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 ",
" "
};
public:
virtual ~MyMainFrame();
void DoExit();
};
void MyMainFrame::DoExit()
{
Cleanup();
}
{
gClient->GetColorByName(
"yellow", yellow);
SetWindowName("Icon test");
MapSubwindows();
Resize(GetDefaultSize());
MapWindow();
}
MyMainFrame::~MyMainFrame()
{
Cleanup();
}
void iconAsXPMData()
{
new MyMainFrame(
gClient->GetRoot(), 350, 80);
}
#define ClassDef(name, id)
R__EXTERN TApplication * gApplication
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
This class handles GUI icons.
This class describes layout hints used by the layout classes.
Defines top level windows that interact with the system Window Manager.
const TGPicture * GetPicture(const char *name)
Get a picture from the picture pool.
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
Yield an action as soon as it is clicked.
ROOT GUI Window base class.
- Author
- Ilka Antcheva 27/09/2007
Definition in file iconAsXPMData.C.