TGLabel with more then one line of text

hi Rooters

how would it be possible to have a Label of text on a TG…Frame with more then one line of text. i can not find any nice solution. having a new TGLabel for every line of text does not seem to be a beautifull way for doing things.

many thanks
Igor

Hi Igor,

You can use a TGTextView widget - it allows manipulations with lines of text. Having multiple lines in a TGLabel is in our ToDo list.

Cheers, Ilka

[quote=“antcheva”]Hi Igor,

You can use a TGTextView widget - it allows manipulations with lines of text. Having multiple lines in a TGLabel is in our ToDo list.

Cheers, Ilka[/quote]

mmm, thanks,
how do I hide scrollbars in TGTextView object ?

i am thinking to do it through the layouts but it does not seem to work.
whatever i do to change the layouts of TGTextView does not work.
i tried

  1. new TGTextView(fFrame,10,10,“primary”, TGView::kNoHSB)
  2. TGTextView *f = new TGTextView(fFrame,10,10,“primary”)
    fFrame->AddFrame(f,new TGLayoutHints( TGView::kNoHSB,0,0,0,0));
    both ways do not work

Hi Igor,

There is a parameter ‘sboptions’ in the TGTextView constructor that sets the visibility of scrollbars - kNoHSB and kNoVSB.

Cheers, Ilka

[quote=“antcheva”]Hi Igor,

There is a parameter ‘sboptions’ in the TGTextView constructor that sets the visibility of scrollbars - kNoHSB and kNoVSB.

Cheers, Ilka[/quote]

thanks,
i removed the srollbars!
in first case i omitted by mistake id=-1
in second case - just wrong approach as it seems to me. just does not work.

now i have a problem making the background same color as my parent frame, and make it un kSunkenFrame

Hi Igor,

You have edited your last post, but I see typos in the code. Please provide the text you want to have on each line and I will prepare an example.

Thank you, Ilka

You can change the background color in use by default in the TGTextView constructor - the parameter after ‘sboptions’ can be set to GetParent()->GetBackground(). If you wish post your example - it will save some time.

Cheers, Ilka

[quote=“antcheva”]Hi Igor,

You have edited your last post, but I see typos in the code. Please provide the text you want to have on each line and I will prepare an example.

Thank you, Ilka[/quote]

it would be just great, thanks:
i want to have an absolutely identical to TGLabel style text in two lines:
1line "primary"
2line "vertex"
the background - grey,
not Sunken and not Raised (don’t know the opposite to both of them)
no border
no internal identation ( perfectly text is in top left corner touching the borders, which are not seen anyway)

i have this 2line problem in several places, so I hoped it would be worth doing via one “object”.

Hi Igor,

Thank you for provided details. I will prepare the example tomorrow, because I am not at work today.

Cheers, Ilka

Hi Igor,

Please find an example in the attached macro.

Best regards, Ilka
labelsview.C (1.27 KB)

[quote=“antcheva”]Hi Igor,

Please find an example in the attached macro.

Best regards, Ilka[/quote]

many thanks!
works fine, just as i need it.
any way would probably rap it into a class for myself, untill new TGLabel appears

Hi Igor,

You are welcome. I will keep you informed about the multiple lines TGLabel development.

Cheers, Ilka