c - ncurses window resizing patterns -
i have seen other questions on dealing window resizing, e.g., ncurses - resizing glitch
the code in question has loop redraw contents of window after resize.
my question is: possible, rather reprinting window after call clear()
, before call refresh()
, have curses use text that's in output buffer?
i.e., "reflow" text, rather clear/ reprint?
i have rather complicated ncurses application multiple windows being updated multiple threads , can't see clean way this.
to directly answer question, no there no way "reflow" or have ncurses handle adjustment of text.
however use panels library (which part of ncurses) handle windows. panels can attach arbitrary user data via set_panel_userptr. use store callback function each panel can resize content.
your resize handler can loop through of panels calling resize callback.
as side note, ncurses not thread safe. make sure threads using ncurses safely.
Comments
Post a Comment