The class TGLayoutHints comes from section 4.1 chapter 25 of Root User’s Guide,
in example2b.cxx, the line code is:
AddFrame(fEcanvas, new TGLayoutHints(kLHintsExpandX |
here the first argument of class TGLayoutHints constructor is “kLHintsExpandX |
kLHintsExpandY”, when changing the argument value to 1 or 10000, in the three case,
the results had no changes,
so what is the function of the first argument of class TGLayoutHints constructor?
Please read tips for efficient and successful posting and posting code
ROOT Version: 6.28/04
Compiler: GCC 9.4.0
The next line code is:
TGHorizontalFrame *hframe=new TGHorizontalFrame(this, 200,40);
when changing the second argument 200 to 2000, and the third argument 40 t0 400,
No changes happened from the results.
A line code is:
hframe->AddFrame(draw, new TGLayoutHints(kLHintsCenterX,5,5,3,4));
when changing the kLHintsCenterX to 1000, No changes happened from the results.
As described in the documentation you mentioned:
Setting its first parameter to
kLHintsExpandX|kLHintsExpandY we define the canvas window as expanded on x and y in the frame. The next four parameters define amounts of padding in left, right, top and bottom in pixels. This means that the canvas window will be expanded when the parent window expands, but it will keep around a frame of 10 pixels on left, right, top and 1 pixel on bottom.
Right, this depends on the
TGLayoutHints applied to that frame and the size of its parent frame (a child frame cannot be larger than its parent)
Sorry, but what do you expect when changing a meaningful value with a random one?
I would suggest also to take a look at the
@bellenot , thanks, i am a beginner of GUI application, so i want to know the exact means of these parameters.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.