<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Probleme mit wgetch(win)]]></title><description><![CDATA[<p>Guten Abend und ein frohes rest Fest erstmal.</p>
<p>Ich bin dabei eine Oberfläche zuschreiben, in der später auch eine Steuerung für eine Platine eingebaut wird.<br />
Mein Problem zurzeit ist das ich ein zusatz Fenster öffne , in diesem Fall Jalousie<br />
und ich da weiter Auswahlen habe.<br />
Aber z.b soll mit der ESC-taste erst die Oberfläche beendet werden wenn nur das hauptfenster noch da ist. Aber wgetch(wha) reaagiert auch wenn das Fenszer für Jaloussie auf ist wgecth(wja).<br />
Kann mir jemand da etwas helfen ?</p>
<p>Mfg Michael</p>
<pre><code class="language-cpp">//*******  g++ -Wall -lncurses -lpanel -o menu menu.cc
#include &lt;panel.h&gt;
#include &lt;curses.h&gt;
#include &lt;iostream&gt;
#include &lt;stdlib.h&gt;
#include &lt;ctime&gt;
//#include &lt;bwctmb/bwctmb.h&gt;

using namespace std;

//******** speicherfrage der panel/fenster ********
WINDOW *whaupt, *wjalousie, *whinter, *win4, *win5;
PANEL  *phaupt, *pjalousie, *phinter, *pan4, *pan5;

void ende()
{
	del_panel(phaupt);
	del_panel(phinter);
	delwin(whaupt);
	delwin(whinter);
	endwin();
	cout &lt;&lt;&quot;Programm Beemdet durch Benutzer\n&quot;;
}

//********************** Zeitabfrage und umwandeln ************************
void uhrzeit()
{
	time_t zeit = time(NULL);
	tm *p_zeit = localtime(&amp;zeit);
	char lzeit[80]; //stellt lzeit 80 zeichen zu verfügung
	strftime (lzeit, sizeof(lzeit),
	&quot;Es ist der %d %b %Y und %H:%M:%S&quot;,p_zeit); //schreibt string in lzeit
	mvwaddstr (whinter, 23, 44, lzeit);  
}
//************************** Hauptmenue ************************************ 
void haupt ()
{
	whaupt = newwin (20, 79, 2, 0);
	box(whaupt, ACS_VLINE, ACS_HLINE);
	phaupt = new_panel(whaupt);
	keypad(whaupt, TRUE);
	nodelay(whaupt, TRUE);
	wbkgd(whaupt, COLOR_PAIR(3));
	mvwaddstr(whaupt, 1, 5, &quot;1 = Jalousiesteuerung&quot;);
	mvwaddstr(whaupt, 2, 5, &quot;2 = Heizungssteuerung&quot;);
	mvwaddstr(whaupt, 3, 5, &quot;3 = Lichtsteuerung&quot;);
	mvwaddstr(whaupt, 4, 5, &quot;4 = Steckdosensteuerung&quot;);
	mvwaddstr(whaupt, 5, 5, &quot;5 = Gartenbewaesserung&quot;);
	mvwaddstr(whaupt, 6, 5, &quot;6 = Aussenbeleuchtung&quot;);
	update_panels();
	doupdate();
}

//************************** Jalousiemenue *********************************
void jalousie ()
{
	wjalousie = newwin (12, 30, 3, 40);//****** 10 Zeilen, 30 Spalten, y, x ******
	box(wjalousie, ACS_VLINE, ACS_HLINE);//**** Zeichnet Box um Win ******
	pjalousie = new_panel(wjalousie);
	wbkgd(wjalousie, COLOR_PAIR(2));
	keypad(wjalousie, TRUE); //*** Kursor-Funktion-Sondertasten ein
	nodelay(wjalousie, TRUE); //*** wgetch ERR ein wenn kein Zeichen anliegt
	mvwaddstr(wjalousie, 1, 2, &quot;1 = Jalousie Schlafzimmer&quot;);
	mvwaddstr(wjalousie, 2, 2, &quot;2 = Jalousie Wohnzimmer&quot;);
	mvwaddstr(wjalousie, 3, 2, &quot;3 = Jalousie Badezimmer&quot;);
	mvwaddstr(wjalousie, 4, 2, &quot;4 = Jalousie Flur oben&quot;);
	mvwaddstr(wjalousie, 5, 2, &quot;5 = Jalousie Flur unten&quot;);
	mvwaddstr(wjalousie, 6, 2, &quot;6 = Jalousie Buero&quot;);
	mvwaddstr(wjalousie, 7, 2, &quot;7 = Jalousie Kueche&quot;);
	mvwaddstr(wjalousie, 8, 2, &quot;8 = Jalousie allgemein&quot;);
	mvwaddstr(wjalousie, 10, 2, &quot;Enter = Fenster schliesen&quot;);
}

//****************************** Auswahl *****************************
void auswahl()
{	

	int wha, wja;
	while (1)
	{
	 wja = wgetch(wjalousie);
	 wha = wgetch(whaupt);
	 if (wha == 27) break; //ESC-taste
	 if (wha == 49) {jalousie();}
	 if (wja == '\n') {del_panel(pjalousie); delwin(wjalousie);}
	 if (wja == 49) {mvwaddstr(whaupt, 15, 2, &quot;Taste1&quot;);}
	 if (wja == 50) {mvwaddstr(whaupt, 15, 2, &quot;Taste2&quot;);}

	 uhrzeit();
//	 update_panels();
//	 doupdate();
	}
}

int main()
{
	initscr();
	timeout(0);
	atexit(ende); // ausgang
	clear();
	noecho();
	curs_set(0); // cursor ausschalten
	cbreak();
	start_color();
	init_pair(1, COLOR_BLUE, COLOR_BLACK); // Schrift Blau/Hintergund Schwarz
	init_pair(2, COLOR_GREEN, COLOR_BLACK);
	init_pair(3, COLOR_YELLOW, COLOR_BLACK); 

	whinter = newwin (24,79,0,0);
	phinter = new_panel(whinter);
	keypad(whinter, TRUE);
	nodelay(whinter, TRUE);
	wbkgd(whinter, COLOR_PAIR(1));
	wattrset (whinter, A_BOLD);
	mvwaddstr(whinter, 0, 24, &quot;Steuerungsmenue / Homecontroll&quot;);
	mvwaddstr(whinter, 23, 0, &quot;ESC um Oberflaeche zu beenden&quot;);
	haupt();
	auswahl();
	return (0);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/201187/probleme-mit-wgetch-win</link><generator>RSS for Node</generator><lastBuildDate>Mon, 05 Oct 2026 18:37:40 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/201187.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 25 Dec 2007 22:16:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Probleme mit wgetch(win) on Tue, 25 Dec 2007 22:16:35 GMT]]></title><description><![CDATA[<p>Guten Abend und ein frohes rest Fest erstmal.</p>
<p>Ich bin dabei eine Oberfläche zuschreiben, in der später auch eine Steuerung für eine Platine eingebaut wird.<br />
Mein Problem zurzeit ist das ich ein zusatz Fenster öffne , in diesem Fall Jalousie<br />
und ich da weiter Auswahlen habe.<br />
Aber z.b soll mit der ESC-taste erst die Oberfläche beendet werden wenn nur das hauptfenster noch da ist. Aber wgetch(wha) reaagiert auch wenn das Fenszer für Jaloussie auf ist wgecth(wja).<br />
Kann mir jemand da etwas helfen ?</p>
<p>Mfg Michael</p>
<pre><code class="language-cpp">//*******  g++ -Wall -lncurses -lpanel -o menu menu.cc
#include &lt;panel.h&gt;
#include &lt;curses.h&gt;
#include &lt;iostream&gt;
#include &lt;stdlib.h&gt;
#include &lt;ctime&gt;
//#include &lt;bwctmb/bwctmb.h&gt;

using namespace std;

//******** speicherfrage der panel/fenster ********
WINDOW *whaupt, *wjalousie, *whinter, *win4, *win5;
PANEL  *phaupt, *pjalousie, *phinter, *pan4, *pan5;

void ende()
{
	del_panel(phaupt);
	del_panel(phinter);
	delwin(whaupt);
	delwin(whinter);
	endwin();
	cout &lt;&lt;&quot;Programm Beemdet durch Benutzer\n&quot;;
}

//********************** Zeitabfrage und umwandeln ************************
void uhrzeit()
{
	time_t zeit = time(NULL);
	tm *p_zeit = localtime(&amp;zeit);
	char lzeit[80]; //stellt lzeit 80 zeichen zu verfügung
	strftime (lzeit, sizeof(lzeit),
	&quot;Es ist der %d %b %Y und %H:%M:%S&quot;,p_zeit); //schreibt string in lzeit
	mvwaddstr (whinter, 23, 44, lzeit);  
}
//************************** Hauptmenue ************************************ 
void haupt ()
{
	whaupt = newwin (20, 79, 2, 0);
	box(whaupt, ACS_VLINE, ACS_HLINE);
	phaupt = new_panel(whaupt);
	keypad(whaupt, TRUE);
	nodelay(whaupt, TRUE);
	wbkgd(whaupt, COLOR_PAIR(3));
	mvwaddstr(whaupt, 1, 5, &quot;1 = Jalousiesteuerung&quot;);
	mvwaddstr(whaupt, 2, 5, &quot;2 = Heizungssteuerung&quot;);
	mvwaddstr(whaupt, 3, 5, &quot;3 = Lichtsteuerung&quot;);
	mvwaddstr(whaupt, 4, 5, &quot;4 = Steckdosensteuerung&quot;);
	mvwaddstr(whaupt, 5, 5, &quot;5 = Gartenbewaesserung&quot;);
	mvwaddstr(whaupt, 6, 5, &quot;6 = Aussenbeleuchtung&quot;);
	update_panels();
	doupdate();
}

//************************** Jalousiemenue *********************************
void jalousie ()
{
	wjalousie = newwin (12, 30, 3, 40);//****** 10 Zeilen, 30 Spalten, y, x ******
	box(wjalousie, ACS_VLINE, ACS_HLINE);//**** Zeichnet Box um Win ******
	pjalousie = new_panel(wjalousie);
	wbkgd(wjalousie, COLOR_PAIR(2));
	keypad(wjalousie, TRUE); //*** Kursor-Funktion-Sondertasten ein
	nodelay(wjalousie, TRUE); //*** wgetch ERR ein wenn kein Zeichen anliegt
	mvwaddstr(wjalousie, 1, 2, &quot;1 = Jalousie Schlafzimmer&quot;);
	mvwaddstr(wjalousie, 2, 2, &quot;2 = Jalousie Wohnzimmer&quot;);
	mvwaddstr(wjalousie, 3, 2, &quot;3 = Jalousie Badezimmer&quot;);
	mvwaddstr(wjalousie, 4, 2, &quot;4 = Jalousie Flur oben&quot;);
	mvwaddstr(wjalousie, 5, 2, &quot;5 = Jalousie Flur unten&quot;);
	mvwaddstr(wjalousie, 6, 2, &quot;6 = Jalousie Buero&quot;);
	mvwaddstr(wjalousie, 7, 2, &quot;7 = Jalousie Kueche&quot;);
	mvwaddstr(wjalousie, 8, 2, &quot;8 = Jalousie allgemein&quot;);
	mvwaddstr(wjalousie, 10, 2, &quot;Enter = Fenster schliesen&quot;);
}

//****************************** Auswahl *****************************
void auswahl()
{	

	int wha, wja;
	while (1)
	{
	 wja = wgetch(wjalousie);
	 wha = wgetch(whaupt);
	 if (wha == 27) break; //ESC-taste
	 if (wha == 49) {jalousie();}
	 if (wja == '\n') {del_panel(pjalousie); delwin(wjalousie);}
	 if (wja == 49) {mvwaddstr(whaupt, 15, 2, &quot;Taste1&quot;);}
	 if (wja == 50) {mvwaddstr(whaupt, 15, 2, &quot;Taste2&quot;);}

	 uhrzeit();
//	 update_panels();
//	 doupdate();
	}
}

int main()
{
	initscr();
	timeout(0);
	atexit(ende); // ausgang
	clear();
	noecho();
	curs_set(0); // cursor ausschalten
	cbreak();
	start_color();
	init_pair(1, COLOR_BLUE, COLOR_BLACK); // Schrift Blau/Hintergund Schwarz
	init_pair(2, COLOR_GREEN, COLOR_BLACK);
	init_pair(3, COLOR_YELLOW, COLOR_BLACK); 

	whinter = newwin (24,79,0,0);
	phinter = new_panel(whinter);
	keypad(whinter, TRUE);
	nodelay(whinter, TRUE);
	wbkgd(whinter, COLOR_PAIR(1));
	wattrset (whinter, A_BOLD);
	mvwaddstr(whinter, 0, 24, &quot;Steuerungsmenue / Homecontroll&quot;);
	mvwaddstr(whinter, 23, 0, &quot;ESC um Oberflaeche zu beenden&quot;);
	haupt();
	auswahl();
	return (0);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1426125</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1426125</guid><dc:creator><![CDATA[Brusko]]></dc:creator><pubDate>Tue, 25 Dec 2007 22:16:35 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit wgetch(win) on Wed, 26 Dec 2007 09:05:10 GMT]]></title><description><![CDATA[<p>Niemand de mir nen keinen tipp gibt ? ich möchte ja nicht gleich die Lösung haben<br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":-)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1426205</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1426205</guid><dc:creator><![CDATA[.Brusko]]></dc:creator><pubDate>Wed, 26 Dec 2007 09:05:10 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit wgetch(win) on Wed, 26 Dec 2007 09:37:43 GMT]]></title><description><![CDATA[<p>Was ist das für ein Framework? Standard C++ ist es nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1426209</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1426209</guid><dc:creator><![CDATA[Crazy Diamond]]></dc:creator><pubDate>Wed, 26 Dec 2007 09:37:43 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit wgetch(win) on Wed, 26 Dec 2007 09:49:06 GMT]]></title><description><![CDATA[<p>Nun ich bin Anfänger , werde wohl c und c++ mischen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1426210</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1426210</guid><dc:creator><![CDATA[.Brusko]]></dc:creator><pubDate>Wed, 26 Dec 2007 09:49:06 GMT</pubDate></item></channel></rss>