Skip to content

Instantly share code, notes, and snippets.

@sakex
Created June 23, 2020 18:18
Show Gist options
  • Select an option

  • Save sakex/7fe021189d333b587fb049c2423af91d to your computer and use it in GitHub Desktop.

Select an option

Save sakex/7fe021189d333b587fb049c2423af91d to your computer and use it in GitHub Desktop.
// CounterButton.hpp
#ifndef MEDIUM_COUNTERBUTTON_HPP
#define MEDIUM_COUNTERBUTTON_HPP
#include <GUI/AbstractButton.hpp>
class CounterButton: public AbstractButton {
public:
CounterButton(): count(0) {
}
void click() override {
count++;
}
std::string innerText() override {
return "Count: " + std::to_string(count);
}
private:
int count;
};
#endif //MEDIUM_COUNTERBUTTON_HPP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment