66 :TGTransientFrame(p,
main, w, h, options)
67{
68
69
71
72 ChangeOptions((GetOptions() & ~kVerticalFrame) | kHorizontalFrame);
73
74 fF1 =
new TGCompositeFrame(
this, 60, 20, kVerticalFrame | kFixedWidth);
75 fF2 =
new TGCompositeFrame(
this, 60, 20, kHorizontalFrame);
76
77 fOkButton =
new TGTextButton(
fF1,
new TGHotString(
"&Ok"), 1);
79 fF1->Resize(
fOkButton->GetDefaultWidth() + 40, GetDefaultHeight());
80
83
84 fL1 =
new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 2, 3, 0);
85 fL21 =
new TGLayoutHints(kLHintsTop | kLHintsRight, 2, 5, 10, 0);
86
90
91 fLabel =
new TGLabel(
fF2,
new TGHotString(label));
92
96 else
98
100 fText->Associate(
this);
101 fText->Resize(220,
fText->GetDefaultHeight());
103
104 fL5 =
new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 3, 5, 0, 0);
105 fL6 =
new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 0, 2, 0, 0);
106
110
111 MapSubwindows();
112 Resize(GetDefaultSize());
113
114
115 Int_t ax, ay;
117 Window_t wdum;
118 gVirtualX->TranslateCoordinates(
main->GetId(), GetParent()->GetId(),
119 (Int_t) (((TGFrame *)
main)->GetWidth() -
120 fWidth) >> 1,
121 (Int_t) (((TGFrame *)
main)->GetHeight() -
122 fHeight) >> 1, ax, ay, wdum);
123 } else {
124 UInt_t root_w, root_h;
125 gVirtualX->GetWindowSize(fClient->GetRoot()->GetId(), ax, ay, root_w, root_h);
126 ax = (root_w - fWidth) >> 1;
127 ay = (root_h - fHeight) >> 1;
128 }
129
130 Move(ax, ay);
131 SetWMPosition(ax, ay);
132
133 SetWindowName("Enter Text");
134
135 SetMWMHints(kMWMDecorAll | kMWMDecorMaximize | kMWMDecorMenu,
136 kMWMFuncAll | kMWMFuncMaximize | kMWMFuncResize, kMWMInputModeless);
137
138 MapWindow();
139 fClient->WaitFor(this);
140}