home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / gnu / g / help / 1654 < prev    next >
Encoding:
Text File  |  1993-01-10  |  2.7 KB  |  93 lines

  1. Newsgroups: gnu.g++.help
  2. Path: sparky!uunet!stanford.edu!ames!sun-barr!cs.utexas.edu!mercury.unt.edu!sol!amos
  3. From: amos@sol.acs.unt.edu (Amos A. Gouaux)
  4. Subject: CursesWindow in libg++-2.3 using gcc-2.3.3
  5. Message-ID: <amos.726689778@sol>
  6. Sender: usenet@mercury.unt.edu (UNT USENet Adminstrator)
  7. Organization: University of North Texas
  8. Date: Sun, 10 Jan 1993 18:16:18 GMT
  9. Lines: 82
  10.  
  11.  
  12. machine: solbourne series 5e/902 (sun sparc compatible)
  13. system: os/mp 4.1A.3 (based on sunos4.1.1)
  14.  
  15. i was able to build gcc-2.3.3 without any problems.  i was also able
  16. to build libg++-2.3 equally error free.  all the libg++ tests seem to
  17. have run just fine.  however, when i tried to run "tCurses" down in
  18. the tests directory, i discovered that certain output was missing.
  19. in particular, the format strings for the *print* methods were never
  20. displayed, not in any form.  for example, the following text was
  21. missing from the output.
  22.  
  23.      begx=0,maxx=79,begy=0,maxy=23,height=24,width=80
  24.      printw test:13, A, Cstar, -1, 3.141593, 3.183099
  25.      enter an int:
  26.      number = 
  27.      enter a char:
  28.      char = 
  29.  
  30. yet "123" and "a" _did_ appear.  most peculiar.  with gcc-2.2.2 and
  31. libg++-2.2, i was able to produce this output from the very same source
  32. file, which i have included below.  this source file is merely a simplified
  33. version of tCurses.cc.
  34.  
  35. can someone tell me the reason for the above behavior?  is there
  36. something that i'm doing wrong?  is this a bug with one of the packages?
  37.  
  38. amos
  39.  
  40.  
  41. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  42. #include <CursesW.h>
  43.  
  44. // a simple test/demo for CursesWindow.  with gcc-2.3.3 and libg++-2.3,
  45. // none of the lines ending with "//**" produce the desired output strings.
  46.  
  47. int main
  48. (void)
  49. {
  50. CursesWindow big(23, 79, 0, 0);
  51.  
  52. int i;
  53. char c='A';
  54.  
  55. big.box('B','B');
  56.  
  57. big.refresh();
  58.  
  59. big.mvprintw(0,0,"begx=%d,maxx=%d,begy=%d,maxy=%d,height=%d,width=%d", //**
  60.              big.begx(), big.maxx(), big.begy(), big.maxy(),
  61.              big.height(), big.width());
  62. big.refresh();
  63.  
  64. i=13;
  65. const char * cptr = "Cstar";
  66.  
  67. long l = 0xffffffff;
  68. double d= 3.1415926;
  69. float f= 10.0/d;
  70.  
  71. big.mvprintw(2,2,"printw test:%d, %c, %s, %ld, %lf, %f\n",i,c,cptr,l,d,f); //**
  72. big.refresh();
  73.  
  74. big.mvprintw(5,20,"enter an int:"); //**
  75. big.refresh();
  76. big.scanw("%d",&i);
  77. big.move(6,20);
  78. big.printw("number = %d\n",i); //**
  79. big.refresh();
  80.  
  81. big.mvprintw(20,20,"enter a char:"); //**
  82. big.refresh();
  83. big.scanw("%c",&c);
  84. big.move(21,20);
  85. big.printw("char = %c\n",c); //**
  86. big.refresh();
  87. }
  88.  
  89. //_____________________________________________________________________________
  90. -- 
  91. amos@unt.edu                   Amos A. Gouaux                   (817) 565-4161
  92. -= Academic Computing Services, University of North Texas, Denton, TX, USA. =-
  93.