Hi Anatoly,

anatoly techtonik wrote:

... If you want to have user resizable windows,  you have to set

ttytype[0] = 1;

Looks magical. Is it possible to make it a "property of the window" or
more obvious API switch?

   I didn't like that very much either.  My preference was to make use of
the PDC_set_resize_limits( ) function.  A call such as
PDC_set_resize_limits( 20, 55, 70, 100) will tell Win32a that the window
can be 20 to 55 lines high and 70 to 100 columns wide.  Make it
PDC_set_resize_limit( 20, 55, 80, 80),  and the window will be fixed at
80 columns and cannot be resized horizontally.  If the first and second
arguments are equal,  and the third and fourth are equal,  you have a
non-resizable window.

   The problem is that,  at least at present,  PDC_set_resize_limits( )
is available only in Win32a.  I rather like the fact that if one compiles
PDCurses as a DLL,  you can swap between the SDL,  Win32 console,  and
Win32a flavors just by swapping DLLs,  no recompiling required.  But if
your program calls PDC_set_resize_limits( ) and you try using the SDL
or Win32 console DLLs,  you get a "function not found in DLL" problem.

   _However_,  I think I've found a way to have our cake and eat it too.
You can now call PDC_set_resize_limit( ) before initscr( ),  as described
above.  This will mean you're stuck with Win32a only,  though.

   _Or_,  you can add lines such as

ttytype[0] = 20;    /* Window must have at least 20 lines in Win32a */
ttytype[1] = 55;    /* Window can have a max of 55 lines in Win32a */
ttytype[2] = 70;    /* Window must have at least 70 columns in Win32a */
ttytype[3] = 100;   /* Window can have a max of 100 columns in Win32a */

   This remains a little magical.  But you can do it without causing trouble
when using non-Win32a DLLs.

   I've made this change,  and am testing it out.  Seems good so far...
with luck,  I'll post it shortly.

   Yet another solution would be to add PDC_set_resize_limit( ) to all
other flavors of PDCurses.  It would do absolutely nothing in Win32 console,
SDL,  DOS,  and OS/2,  where resizing can't be done.  It _could_ work
as advertised in the X11 flavor.

   Thanks for mentioning this.  As I wrote,  I really didn't like the
ttyname[0] = 1; solution.  The above looks somewhat less ugly.

-- Bill

Reply via email to