implement a self-dimensioning TEXT widget

  • I need a self-dimensioning TEXT widget.
    I tried in this way:

    unfortunately this doesn't work: It seems that there is a clip rectangle that is as large as the size with which the widget was created the first time.

    where am I wrong?

    Is there a way to be notified of changing the text string?

    best regards
    Max

  • I tried to simulate the behavior to find out what could be wrong.
    the source code is:

    when TEST is defined the 'A' is shown as follows:

    [Blocked Image: https://s18.postimg.org/405uwep2x/auto_Resize.png]

    only 3 pixel are shown, but if I break into cbResizableText() I can see that x size should be 10 pixel (and 10 is passed as second parameter of WM_SetXSize())

    If TEST is not defined the WM_SetXSize() function is not called from inside the cbResizableText() callback. This way everything works:
    [Blocked Image: https://s18.postimg.org/v0jnknda1/auto_Resize1.png]


    It seems that the WM_SetXSize() function has problems when invoked inside the callback.

    Are there other working and reliable ways to change the size inside the callback?

    best regards
    Max

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!