#54 wbkgd() only changes attributes of some cells

closed-wont-fix
None
5
2007-05-04
2007-04-23
No

A window created with subwin/derwin doesn't draw (even calling touchwin before) when calling wrefresh. I don't know if it could be a bug or no, but, on ncurses it worked fine.

Discussion

  • Davi R. Tavares

    Davi R. Tavares - 2007-04-23

    An example of the problem...

     
  • William McBrine

    William McBrine - 2007-04-23

    Logged In: YES
    user_id=27933
    Originator: NO

    It does draw -- in the example program, try printing some text to w1 before the refresh. It seems to be wbkgd() that's behaving differently. I'll look into it further.

     
  • William McBrine

    William McBrine - 2007-04-23

    Logged In: YES
    user_id=27933
    Originator: NO

    P.S. For now, a "werase(w1)" before the refresh will help.

     
  • William McBrine

    William McBrine - 2007-04-23

    Logged In: YES
    user_id=27933
    Originator: NO

    OK, if you move the wbkgd() call for w2 to before the derwin() call, you'll get the effect you want, without having to call werase().

    What's happening here is that wbkgd() only changes the attributes for cells that already have the old background attribute. At the time of the derwin() call in test.c, the background for w2 is still 0; so when wbkgd() is called for w1, it compares against 0, finds that the cells aren't that color, and doesn't recolor them.

    ncurses, on the other hand, recolors all the cells, not just the cells that match the background. According to my reading of the X/Open standard, that's actually the correct behavior. I ran into this shortly after I took over PDCurses, but at that time, I decided _not_ to fix it, because I liked PDCurses' behavior better. It's the only time I've done that, and I may have to revisit that decision.

     
  • William McBrine

    William McBrine - 2007-04-23
    • assigned_to: nobody --> wmcbrine
    • summary: A window create with subwin doesn't draw --> wbkgd() only changes attributes of some cells
    • status: open --> open-later
     
  • William McBrine

    William McBrine - 2007-05-03

    Logged In: YES
    user_id=27933
    Originator: NO

    My reading of the Solaris source code seems to indicate the same behavior, although I can't test it at the moment.

     
  • William McBrine

    William McBrine - 2007-05-03
    • status: open-later --> pending-wont-fix
     
  • William McBrine

    William McBrine - 2007-05-04
    • status: pending-wont-fix --> closed-wont-fix
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks