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:
~MyMainFrame() override;
void DoExit();
};
void MyMainFrame::DoExit()
{
Cleanup();
}
{
gClient->GetColorByName(
"yellow", yellow);
SetWindowName("Icon test");
Resize(GetDefaultSize());
MapWindow();
}
MyMainFrame::~MyMainFrame()
{
Cleanup();
}
void iconAsXPMData()
{
new MyMainFrame(
gClient->GetRoot(), 350, 80);
}
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
#define ClassDefOverride(name, id)
externTApplication * gApplication
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void w
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize MapSubwindows
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.