|
|
@ -21,15 +21,16 @@ type Screen struct { |
|
|
|
pausedAt *time.Time // Timestamp of the pause request or nil if none.
|
|
|
|
pausedAt *time.Time // Timestamp of the pause request or nil if none.
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Initialize loads the Termbox, allocates and initializes layout and markup,
|
|
|
|
// Initializes Termbox, creates screen along with layout and markup, and
|
|
|
|
// and calculates current screen dimensions. Once initialized the screen is
|
|
|
|
// calculates current screen dimensions. Once initialized the screen is
|
|
|
|
// ready for display.
|
|
|
|
// ready for display.
|
|
|
|
func (screen *Screen) Initialize() *Screen { |
|
|
|
func NewScreen() *Screen { |
|
|
|
if err := termbox.Init(); err != nil { |
|
|
|
if err := termbox.Init(); err != nil { |
|
|
|
panic(err) |
|
|
|
panic(err) |
|
|
|
} |
|
|
|
} |
|
|
|
screen.layout = new(Layout).Initialize() |
|
|
|
screen := &Screen{} |
|
|
|
screen.markup = new(Markup).Initialize() |
|
|
|
screen.layout = NewLayout() |
|
|
|
|
|
|
|
screen.markup = NewMarkup() |
|
|
|
|
|
|
|
|
|
|
|
return screen.Resize() |
|
|
|
return screen.Resize() |
|
|
|
} |
|
|
|
} |
|
|
|