473,320 Members | 2,109 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How strongly are ncurses incompatible with signals?

Hi,
I'm using g++ 4.1.2 and ncurses 5.6.

Following simple code correctly displays dimensions of an xterm while one
resizes it's window. I thought that uncommenting wouldn't change anything
in a behaviour of this program. However, it does change - on execution
program correctly displays xterm dimensions, but after changing size of a
window it still shows old dimensions.

What should I think about it?

---
#include <ncurses.h>
#include <iostream.h>
#include <signal.h>
void handler(int sig){};

main() {
// signal(SIGWINCH,handler);
initscr();
int X,Y;
char msg[10];
for(;;){
getmaxyx(stdscr,Y,X);
clear();
sprintf(msg,"%d, %d",X,Y);
addstr(msg);
refresh();
usleep(400);
}
}

---

Aug 31 '07 #1
3 1935
sirix wrote:
Hi,
I'm using g++ 4.1.2 and ncurses 5.6.
Best to ask on comp.unix.programmer.

--
Ian Collins.
Aug 31 '07 #2
Ian Collins (Sat, 01 Sep 2007 11:19:08 +1200):
sirix wrote:
>Hi,
I'm using g++ 4.1.2 and ncurses 5.6.
Best to ask on comp.unix.programmer.
Thanks.
Aug 31 '07 #3

sirix <si***@poczta.onet.plwrote in message...
Hi,
I'm using g++ 4.1.2 and ncurses 5.6.

Following simple code correctly displays dimensions of an xterm while one
resizes it's window. I thought that uncommenting wouldn't change anything
in a behaviour of this program. However, it does change - on execution
program correctly displays xterm dimensions, but after changing size of a
window it still shows old dimensions.

What should I think about it?

---
#include <ncurses.h>
#include <iostream.h>
#include <signal.h>
void handler(int sig){};

main() {
// signal(SIGWINCH,handler);
initscr();
int X,Y;
char msg[10];
for(;;){
getmaxyx(stdscr,Y,X);
clear();
sprintf(msg,"%d, %d",X,Y);
addstr(msg);
refresh();
usleep(400);
}
// ???
getmaxyx(stdscr,Y,X);
sprintf(msg,"%d, %d",X,Y);
}
You should think, "Oh my gosh, how does something that does NOT exist in C++
work?".

// #include <iostream.h>
#include <iostream>
// main() {
int main(){} // ALWAYS!!

Then think, "I should check the FAQ for this group to see if 'ncurses' is
on-topic!".

FAQ http://www.parashift.com/c++-faq-lite

Then think, "That BadBob is sure a jerk!".

Hey, I resemble that remark!! <G>

Might check the docs for 'ncurses'.

--
Bob R
POVrookie
Sep 1 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Nick R | last post by:
I know, my title really sucks. How do you draw an individual pixel with ncurses?
9
by: Sinan Nalkaya | last post by:
hi, i want to use ncurses library in python i`ve found proper library for that, PyNcurses. then i searched for some documentation about ncurses programming, i only found that web site ;...
5
by: arve.knudsen | last post by:
Hi I'm trying to build a Python package that I can use on different Linux setups, for this purpose it would be nice to weld external dependencies (libraries) into Python itself. So far I've...
20
by: Dennis | last post by:
I use the following code for a strongly typed arraylist and it works great. However, I was wondering if this is the proper way to do it. I realize that if I want to implement sorting of the...
2
by: mark.e.nelson | last post by:
Hi, I am trying to pass a pointer to a struct to a function that uses the data in the struct, and also happens to use ncurses. I always get a segmentation violation when the program exits. I...
6
by: dimitris.papastamos | last post by:
Hello everyone, I've been working on a simple editor myself and I seem to be having some problems with ncurses or so. I have been debugging this program quite a lot trying to detect where the bug...
2
by: =?ISO-8859-2?Q?Miros=B3aw?= Makowiecki | last post by:
Is it a library at C++ by means of library of ncurses at linux,that it implement library of ncurses but by means language of C++,it is by means of class,struct and other? if yes is it any?
1
by: ChuckB | last post by:
Ok, I'm trying to create a GTK+ application that scrolls Hs across the screen until you press q or Q. I've got it working in console wise using ncurses. What I'm trying to do now is make a full...
11
by: vippstar | last post by:
What is the purpose of signals and why do they exist in C? thanks in advance
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.