bug-ncurses
[Top][All Lists]
Advanced

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

Can't Get Subwindow To Show


From: TW
Subject: Can't Get Subwindow To Show
Date: Thu, 8 Jan 2009 19:45:31 -0700

Hi,

        I'm having trouble getting a subwindow to show 
on a window attached to a panel.

        I created my windows:

                w1->setdim(maxy-2, maxx, 1, 0, FALSE, TRUE); /* Main data 
window */
                w2->setdim(maxy-2, maxx, 1, 0, FALSE, TRUE); /* Form */

        w1 has some data on it, and w2 contains a form at the top of it.  I 
want the 
subwindow below that form on w2.

        setdim() is as such:

              void   setdim(int y, int x, int beginy, int beginx, bool 
echotrue, bool bord)
              {
                 border = bord;

                               /* (nlines, ncols,  begin_y, begin_x) */
                 localwin = newwin(y, x, beginy, beginx);
                 if(border) 
                    box(localwin, 0, 0);

                 if(echotrue)
                    echo();
                 else
                    noecho();
                 keypad(localwin, TRUE);
                 wrefresh(localwin);
              }

        My windows and panels are declared in the WinManip class as such:

                WINDOW *localwin, *localsub;
                PANEL *my_panels[2], *top; /* top handles panel switching */

        I can get my window and subwindow with these functions:

                WINDOW* getwindow() { return localwin; }
                WINDOW *getsubwnd() { return localsub; }

        I then call set_panels via w1 with w2 as a parameter:

              void set_panels(WinManip *win2)
              {
                 my_panels[0] = new_panel(this->getwindow());
                 my_panels[1] = new_panel(win2->getwindow());

                 set_panel_userptr(my_panels[0], my_panels[1]);
                 set_panel_userptr(my_panels[1], my_panels[0]);

                 top = my_panels[0];
                 top_panel(top);

                 update_panels();
                 doupdate();
              }

        After that is when I call set_sub_wnd() via w2:

              void set_sub_wnd()
              {
                 localsub = derwin(this->getwindow(), 15, 50, 40, 1);
                 mvwprintw(localsub, 2, 0, "%s", "Subwindow");
                 touchwin(this->getwindow());
                 update_panels();
                 doupdate();
              }

        I expect to see, on the panel with w2, a subwindow below the form 
that's 
on there.  Is there anything wrong with my code?  Am I not able to put a 
subwindow 
onto a window that has a form on it? I've tried other subwindow code on the web 
and they all work.  Thanks.

-- 
VR~
        TW
        Email: address@hidden
        "Knowledge Is Power"




reply via email to

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