X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=c%2B%2B%2Fcursesapp.cc;h=81f60983ab62dea65188434022a54d641a407c00;hp=6871a69a39773d7af0ebd5dd799a8a2131a6ce00;hb=a28e782d7794ddeec23e7cb212dc455f0d93dc22;hpb=55ccd2b959766810cf7db8d1c4462f338ce0afc8 diff --git a/c++/cursesapp.cc b/c++/cursesapp.cc index 6871a69a..81f60983 100644 --- a/c++/cursesapp.cc +++ b/c++/cursesapp.cc @@ -1,6 +1,7 @@ // * this is for making emacs happy: -*-Mode: C++;-*- /**************************************************************************** - * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. * + * Copyright 2019,2020 Thomas E. Dickey * + * Copyright 1998-2007,2008 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,12 +30,13 @@ /**************************************************************************** * Author: Juergen Pfeifer, 1997 * + * and: Thomas E. Dickey * ****************************************************************************/ #include "internal.h" #include "cursesapp.h" -MODULE_ID("$Id: cursesapp.cc,v 1.13 2005/04/03 12:25:23 tom Exp $") +MODULE_ID("$Id: cursesapp.cc,v 1.18 2020/07/18 19:57:11 anonymous.maarten Exp $") void NCursesApplication::init(bool bColors) @@ -67,19 +69,33 @@ NCursesApplication* NCursesApplication::theApp = 0; NCursesWindow* NCursesApplication::titleWindow = 0; NCursesApplication::SLK_Link* NCursesApplication::slk_stack = 0; -NCursesApplication::~NCursesApplication() + +NCursesWindow *&NCursesApplication::getTitleWindow() { + return titleWindow; +} + +NCursesApplication::~NCursesApplication() THROWS(NCursesException) { Soft_Label_Key_Set* S; delete titleWindow; + titleWindow = 0; + while( (S=top()) ) { pop(); delete S; } + delete Root_Window; + Root_Window = 0; + ::endwin(); } +NCursesApplication* NCursesApplication::getApplication() { + return theApp; +} + int NCursesApplication::rinit(NCursesWindow& w) { titleWindow = &w; @@ -103,8 +119,11 @@ bool NCursesApplication::pop() SLK_Link* L = slk_stack; slk_stack = slk_stack->prev; delete L; - if (Root_Window && top()) - top()->show(); + if (Root_Window) { + Soft_Label_Key_Set* xx = top(); + if (xx != 0) + xx->show(); + } } return (slk_stack ? FALSE : TRUE); }