diff options
Diffstat (limited to 'Userland/Applications/Calculator/CalculatorWidget.cpp')
-rw-r--r-- | Userland/Applications/Calculator/CalculatorWidget.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Userland/Applications/Calculator/CalculatorWidget.cpp b/Userland/Applications/Calculator/CalculatorWidget.cpp index df648640a0..f2ae66413a 100644 --- a/Userland/Applications/Calculator/CalculatorWidget.cpp +++ b/Userland/Applications/Calculator/CalculatorWidget.cpp @@ -147,6 +147,17 @@ void CalculatorWidget::add_digit_button(GUI::Button& button, int digit) }; } +String CalculatorWidget::get_entry() +{ + return m_entry->text(); +} + +void CalculatorWidget::set_entry(double value) +{ + m_keypad.set_value(value); + update_display(); +} + void CalculatorWidget::update_display() { m_entry->set_text(m_keypad.to_string()); |