]> git.ozlabs.org Git - petitboot/blobdiff - ui/ncurses/nc-scr.c
ui/ncurses/menu: Allow space to select menu items
[petitboot] / ui / ncurses / nc-scr.c
index c6172e1e4c6d11e0e022d92cbc6fef9a2f7c90c8..9ad356fa179e17ae60300540210831eca55c3a3f 100644 (file)
@@ -40,6 +40,20 @@ static void nc_scr_status_draw(struct nc_scr *scr)
                scr->frame.status);
 }
 
+int nc_scr_post(struct nc_scr *scr)
+{
+       if (scr->post)
+               return scr->post(scr);
+       return 0;
+}
+
+int nc_scr_unpost(struct nc_scr *scr)
+{
+       if (scr->unpost)
+               return scr->unpost(scr);
+       return 0;
+}
+
 void nc_scr_frame_draw(struct nc_scr *scr)
 {
        int ltitle_len, rtitle_len;
@@ -114,7 +128,7 @@ int nc_scr_init(struct nc_scr *scr, enum pb_nc_sig sig, int begin_x,
 
        scr->sub_ncw = derwin(scr->main_ncw,
                LINES - nc_scr_frame_lines,
-               COLS - 1 - begin_x,
+               COLS - nc_scr_frame_cols - begin_x,
                nc_scr_pos_sub,
                begin_x);