@@ -360,12 +360,6 @@ class FSTop(FSTopBase):
360360 # requested it will raise an exception
361361 pass
362362
363- # Check the window size before creating the pad. For large windows,
364- # PAD_WIDTH = window width.
365- h , w = self .stdscr .getmaxyx ()
366- if (w > DEFAULT_PAD_WIDTH ):
367- self .PAD_WIDTH = w
368- self .fstop_pad = curses .newpad (self .PAD_HEIGHT , self .PAD_WIDTH )
369363 self .run_all_display ()
370364
371365 def display_fs_menu (self , stdscr , selected_row_idx ):
@@ -964,8 +958,13 @@ class FSTop(FSTopBase):
964958 top , left = 0 , 0 # where to place pad
965959 vscrollOffset , hscrollOffset = 0 , 0 # scroll offsets
966960
967- # calculate the initial viewport height and width
961+ # Check the window size before creating the pad. For large windows, PAD_WIDTH=window width.
968962 windowsize = self .stdscr .getmaxyx ()
963+ if (windowsize [1 ] > DEFAULT_PAD_WIDTH ):
964+ self .PAD_WIDTH = windowsize [1 ]
965+ self .fstop_pad = curses .newpad (self .PAD_HEIGHT , self .PAD_WIDTH )
966+
967+ # calculate the initial viewport height and width
969968 self .viewportHeight , self .viewportWidth = windowsize [0 ] - 1 , windowsize [1 ] - 1
970969
971970 # create header subpad
@@ -1098,8 +1097,13 @@ class FSTop(FSTopBase):
10981097 top , left = 0 , 0 # where to place pad
10991098 vscrollOffset , hscrollOffset = 0 , 0 # scroll offsets
11001099
1101- # calculate the initial viewport height and width
1100+ # Check the window size before creating the pad. For large windows, PAD_WIDTH=window width.
11021101 windowsize = self .stdscr .getmaxyx ()
1102+ if (windowsize [1 ] > DEFAULT_PAD_WIDTH ):
1103+ self .PAD_WIDTH = windowsize [1 ]
1104+ self .fstop_pad = curses .newpad (self .PAD_HEIGHT , self .PAD_WIDTH )
1105+
1106+ # calculate the initial viewport height and width
11031107 self .viewportHeight , self .viewportWidth = windowsize [0 ] - 1 , windowsize [1 ] - 1
11041108
11051109 # create header subpad
0 commit comments