bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Panels and Pads


From: Bryan Christ
Subject: Re: Panels and Pads
Date: Wed, 17 Jan 2007 09:50:16 -0600

Here's what I would suggest...

1.  Use windows with panels (as should be done).
2.  Do all your heavy work on a pad.
3.  When you need to display a portion of the pad, use overwrite() or
copywin() to copy the contents to the window.

If you use overwrite(), there is one caveat.  Pads and windows operate
in absolute coords.  If you need to copy from 0,0 on the pad to 0,0 on
the window, but the target window is positioned at 4,4 (on the screen),
you need to first move the pad to 4,4 and then copy the contents using
overwrite().

On Wed, 2007-01-17 at 10:34 -0500, Sadrul H Chowdhury wrote:
> 
> On 1/17/07, Bryan Christ <address@hidden> wrote:
>         Why are you trying to use pads instead of windows?
> 
> Some of the configuration dialogs are too huge to fit into the screen.
> Using normal WINDOWs for them leads to indeterminate crashes on some
> systems. Pads promise a possible alternative without a lot of extra
> (and possibly unnecessary) work. 
> 
> Sadrul
> 
> 
>         On Wed, 2007-01-17 at 09:21 -0500, Sadrul H Chowdhury wrote:
>         > Hi. I am going to need to allow large dialogs in my ncurses
>         > application (gaim-text). So I am trying to use pads.
>         However, as it
>         > turns out, I cannot create a panel with a pad in it. So I am
>         using the
>         > following hack, which seems to work quite alright:
>         >
>         > pad->_flags &= ~_ISPAD;
>         > win = derwin(pad, MIN(screen_height, widget_height),
>         >               MIN(screen_width, widget_width), 0, 0); 
>         > panel = new_panel(win);
>         > pad->flags |= _ISPAD;
>         >
>         >
>         > Most of the operations, like refreshing, printing text,
>         moving etc.
>         > seems to work pretty well. When it comes to resizing, I do
>         wresize on 
>         > 'pad', recreate 'win' and 'panel' as above. But it causes
>         the window
>         > to disappear from the screen, and never reappear again. Is
>         there some
>         > magic I can do to make it work? Or is there a better way of
>         doing what 
>         > I am trying to do?
>         >
>         > Cheers,
>         > Sadrul
>         > _______________________________________________
>         > Bug-ncurses mailing list
>         > address@hidden 
>         > http://lists.gnu.org/mailman/listinfo/bug-ncurses
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]