]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - panel/p_bottom.c
ncurses 5.1
[ncurses.git] / panel / p_bottom.c
index 4e6e11d183b3a1d8a823b1d49ffdc6dbb2b6f722..f671864231db6e74bcedf10dedb9de265aa94a38 100644 (file)
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_bottom.c,v 1.5 1999/09/29 15:22:32 juergen Exp $")
-
-/*+-------------------------------------------------------------------------
-       __panel_link_bottom(pan) - link panel into stack at bottom
---------------------------------------------------------------------------*/
-static void
-panel_link_bottom(PANEL *pan)
-{
-#ifdef TRACE
-  dStack("<lb%d>",1,pan);
-  if(_nc_panel_is_linked(pan))
-    return;
-#endif
-  
-  pan->above = (PANEL *)0;
-  pan->below = (PANEL *)0;
-  
-  assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel);
-
-  pan->below = _nc_bottom_panel;
-  pan->above = _nc_bottom_panel->above;
-  if (pan->above)
-    pan->above->below = pan;
-  _nc_bottom_panel->above = pan;
-    
-  dStack("<lb%d>",9,pan);
-}
+MODULE_ID("$Id: p_bottom.c,v 1.7 1999/11/25 13:49:26 juergen Exp $")
 
 int
 bottom_panel(PANEL *pan)
 {
-  if(!pan)
-    return(ERR);
-  if(Is_Bottom(pan))
-    return(OK);
-  dBug(("--> bottom_panel %s", USER_PTR(pan->user)));
-  if(_nc_panel_is_linked(pan))
-    (void)hide_panel(pan);
-  panel_link_bottom(pan);
-  return(OK);
+  int err = OK;
+
+  if (pan) {
+
+    if(!Is_Bottom(pan)) {
+      
+      dBug(("--> bottom_panel %s", USER_PTR(pan->user)));
+     
+      HIDE_PANEL(pan,err,FALSE);
+      assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel);
+      
+      dStack("<lb%d>",1,pan);      
+      
+      pan->below = _nc_bottom_panel;
+      pan->above = _nc_bottom_panel->above;
+      if (pan->above)
+       pan->above->below = pan;
+      _nc_bottom_panel->above = pan;
+      
+      dStack("<lb%d>",9,pan);
+    }
+  }
+  else
+    err = ERR;
+  
+  return(err);
 }