Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#67 init_color does not initialize the color (without fail)

open-accepted
None
5
2009-09-08
2009-08-22
Bmauet
No

OS : Windows 7 RC
version : pdcurses 3.4 with unicode support

When try I to init a color with init_color, the color does not change. The test given with source code (testcurs.c) do'nt work too.
With the uploaded file, I've the ouput :
"<default colors>
Has colors : yes, can change color : yes, COLORS : 16, COLOR_PAIRS : 256
COLOR_RED : 502, 0, 0</>
<red>Red</>
<red/same line>yet green</>"

Discussion

  • Bmauet
    Bmauet
    2009-08-22

    A test for init_color

     
    Attachments
  • For Win32, init_color() uses an undocumented API. It's not too surprising that it would break in Win 7. It could take a long time to fix this, if ever -- so far I haven't found any info on the right way to do it in Win 7, assuming that one even exists.

    Sorry for the delay in replying. I thought this thing was supposed to email me when a new bug was entered.

     
    • assigned_to: nobody --> wmcbrine
    • status: open --> open-accepted
     
  • Mark Hessling
    Mark Hessling
    2011-05-25

    This also fails on Windows XP with service pack 3.

     
  • Didrole
    Didrole
    2012-02-16

    The couple of functions GetConsoleScreenBufferInfoEx / SetConsoleWindowInfo provide the needed functionalities on Vista and upper.
    Here is a patch: http://didrole.com/pdcscrn.c.diff