30 TRootEmbeddedCanvas *fEcan;
31 TGStatusBar *fStatusBar;
35 ~MyMainFrame()
override;
38 void SetStatusText(
const char *txt,
Int_t pi);
44void MyMainFrame::DoDraw()
55 for (
Int_t i = 0; i <
n; i++) {
57 y[i] = 10 *
sin(
x[i] + 0.2);
58 printf(
" i %i %f %f \n", i,
x[i],
y[i]);
63 gr->SetMarkerColor(4);
64 gr->SetMarkerStyle(21);
65 gr->SetTitle(
"a simple graph");
66 gr->GetXaxis()->SetTitle(
"X title");
67 gr->GetYaxis()->SetTitle(
"Y title");
72 c1->GetFrame()->SetFillColor(21);
73 c1->GetFrame()->SetBorderSize(12);
78void MyMainFrame::DoExit()
80 printf(
"Exit application...");
84void MyMainFrame::SetStatusText(
const char *txt,
Int_t pi)
87 fStatusBar->SetText(txt, pi);
94 const char *text0, *text1, *text3;
96 text0 = selected->GetTitle();
97 SetStatusText(text0, 0);
98 text1 = selected->GetName();
99 SetStatusText(text1, 1);
101 sprintf(text2,
"%c", (
char)px);
103 sprintf(text2,
"%d,%d", px, py);
104 SetStatusText(text2, 2);
105 text3 = selected->GetObjectInfo(px, py);
106 SetStatusText(text3, 3);
113 Int_t wid = fEcan->GetCanvasWindowId();
115 fEcan->AdoptCanvas(myc);
116 myc->
Connect(
"ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",
"MyMainFrame",
this,
117 "EventInfo(Int_t,Int_t,Int_t,TObject*)");
121 Int_t parts[] = {45, 15, 10, 30};
123 fStatusBar->SetParts(parts, 4);
124 fStatusBar->Draw3DCorner(
kFALSE);
131 draw->
Connect(
"Clicked()",
"MyMainFrame",
this,
"DoDraw()");
134 exit->
Connect(
"Pressed()",
"MyMainFrame",
this,
"DoExit()");
140 SetWindowName(
"Embedded Canvas Status Info");
144 Resize(GetDefaultSize());
150MyMainFrame::~MyMainFrame()
160 new MyMainFrame(
gClient->GetRoot(), 200, 200);
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
double Double_t
Double 8 bytes.
#define ClassDefOverride(name, id)
externTApplication * gApplication
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
A composite frame that layout their children in horizontal way.
This class describes layout hints used by the layout classes.
Defines top level windows that interact with the system Window Manager.
Provides a StatusBar widget.
Yield an action as soon as it is clicked.
ROOT GUI Window base class.
Mother of all ROOT objects.
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
This class creates a TGCanvas in which a TCanvas is created.
RVec< PromoteType< T > > sin(const RVec< T > &v)