Problem with the height of some widgets

Hi. ROOTers

I am having a problem with the height of some widgets writing a GUI. For example, look at the TGComboBox at the right picture. It has the height too small. However, the code producing these frames is THE SAME, but is running on the different machines. The left frame has been produced on Ubuntu 16.04, ROOT 6.16/00; the right frame — on CentOS 7, ROOT 6.04/00. (The grey outer border is not a part of a frame). I attach the full (1003 Bytes) . But here are the lines which could be helpful:

    TGGroupFrame *testGroup = new TGGroupFrame( fMainFrame, "Test", kHorizontalFrame );
    TGLabel *testLabel = new TGLabel( testGroup, "Test:" );
    TGComboBox *testCombo = new TGComboBox( testGroup );
        testCombo->AddEntry( "TEST1", 0 );
        testCombo->AddEntry( "TEST2", 1 );
        testCombo->Resize( 60, testLabel->GetDefaultHeight() );

    TGLayoutHints *groupLH = new TGLayoutHints( kLHintsTop | kLHintsExpandX, 3, 3, 3, 3 );
    TGLayoutHints *labelLH = new TGLayoutHints( kLHintsNormal, 2, 2, 2, 2 );
    TGLayoutHints *comboLH = new TGLayoutHints( kLHintsNormal, 2, 2, 2, 2 );

    testGroup->AddFrame( testLabel, labelLH );
    testGroup->AddFrame( testCombo, comboLH );

    fMainFrame->AddFrame( testGroup, groupLH );

1580456519_1441_31012020_150x107 1580456431_1440_31012020_140x91
So my question is what is the generic way to set the height of a widget (particularly of a combo)?

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided

I would use fixed values where possible, since the default sizes might change, depending on the font used and the window manager

As I do in my application. Thanks for the response.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.