Q: How to make TGMainFrame fixed size?

Hi,

I’m trying to find how to make my TGMainFrame to be fixed size.
I found Tetris is fixed size but it is a TCanvas not a TGFrame.
It should be simple enough but I can’t find any option or example.
Please let me know how to do it.

Many thanks in advance,
Yun-Ha

Hi Yun-Ha,

To have a TGMainFrame not resizable after you creare all user interface elements inside, you need:TGDimension size = GetDefaultSize(); SetWMSize(size.fWidth, size.fHeight); SetWMSizeHints(size.fWidth, size.fHeight, size.fWidth, size.fHeight, 0, 0); The last line sets so-called resizable hints:

  • first two parameters define the original width and height of the application,
  • next two parameters define (if different) the width and height to which the application window can be resized,
  • last two define the steps of the resizing along width and height directions.
    In the case above first two pairs are equal and the steps are set to 0.
    Cheers, Ilka