Jump to content
  • Advertisement
Sign in to follow this  

Rightside window alignment[curses]

This topic is 1869 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is an edit to a previous post I had up here asking for help on this topic.  Since I figured out what the hell was up I thought I'd share my finding in hopes of providing an obvious and straight-forward approach for some other frustrated soul.  After a weeks worth of a headache, the answer to right side alignment was to calculate the max x coordinate minus the window size. In my case, window size was 25, in turn the drawn window overshot the standard screen by 25 ich happens with (n, PD)curses, you can try bitshifting to some degree of success but it depends on what you're trying to accomplish. I needed a very specific sized window with specific placement. So, I had to take a step back and find a second obvious approach. Here's the function as it stands now:


void eventfeed(void)
    int maxy, maxx, newx;

    getmaxyx(stdscr, maxy, maxx);

    newx = maxx - 25;

    WINDOW *feed;
    feed = newwin(0, 25, 0, realx);

    box(feed, 0, 0);


This aligns a 25 character window to the right side of a curses terminal, God speed.

Edited by iGoogleThis

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!