This macro gives an example of how to set/change text button attributes.
protected:
public:
{
}
};
protected:
public:
};
{
fButton =
new TGTextButton(contents,
"&This button has a multi-line label\nand shows features\n"
"available in the button classes");
fButton->Resize(300, 200);
fButton->ChangeOptions(fButton->GetOptions() |
kFixedSize);
fButton->SetToolTipText("The assigned tooltip\ncan be multi-line also", 200);
disable->Connect(
"Toggled(Bool_t)",
"TGButton", fButton,
"SetEnabled(Bool_t)");
horizontal->Connect(
"Pressed(Int_t)",
"ButtonWindow",
this,
"DoHPosition(Int_t)");
vertical->Connect(
"Pressed(Int_t)",
"ButtonWindow",
this,
"DoVPosition(Int_t)");
left->GetEntry()->Connect("TextChanged(char*)", "ButtonWindow", this, "DoLeftMargin(char*)");
right->GetEntry()->Connect("TextChanged(char*)", "ButtonWindow", this, "DoRightMargin(char*)");
top->GetEntry()->Connect("TextChanged(char*)", "ButtonWindow", this, "DoTopMargin(char*)");
bottom->GetEntry()->Connect("TextChanged(char*)", "ButtonWindow", this, "DoBottomMargin(char*)");
Connect(
"CloseWindow()",
"TApplication",
gApplication,
"Terminate()");
DontCallClose();
Resize();
SetWMSizeHints(GetDefaultWidth(), GetDefaultHeight(), 1000, 1000, 0, 0);
SetWindowName("Button Test");
MapRaised();
}
void ButtonWindow::DoHPosition(
Int_t id)
{
Int_t tj = fButton->GetTextJustify();
fButton->SetTextJustify(
tj);
}
void ButtonWindow::DoVPosition(
Int_t id)
{
Int_t tj = fButton->GetTextJustify();
fButton->SetTextJustify(
tj);
}
void ButtonWindow::DoLeftMargin(char *val)
{
fButton->SetLeftMargin(atoi(val));
}
void ButtonWindow::DoRightMargin(char *val)
{
fButton->SetRightMargin(atoi(val));
}
void ButtonWindow::DoTopMargin(char *val)
{
fButton->SetTopMargin(atoi(val));
}
void ButtonWindow::DoBottomMargin(char *val)
{
fButton->SetBottomMargin(atoi(val));
}
{
}
#define ClassDef(name, id)
R__EXTERN TApplication * gApplication
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize MapSubwindows
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t SetWMSizeHints
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
A composite frame with a border and a title.
virtual void SetTitlePos(ETitlePos pos=kLeft)
A composite frame that layout their children in horizontal way.
This class handles GUI labels.
This class describes layout hints used by the layout classes.
Defines top level windows that interact with the system Window Manager.
TGNumberEntry is a number entry input widget with up/down buttons.
TGNumberEntryField * GetNumberEntry() const
Get the number entry field.
Yield an action as soon as it is clicked.
A TGTextEntry is a one line text input widget.
A vertical 3D line is a line that can be used to separate groups of widgets.
A composite frame that layout their children in vertical way.
ROOT GUI Window base class.