From 421d365d8df71cd2ec3782d13f47750e9db598d0 Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Sun, 3 May 2020 11:21:11 +0200 Subject: [PATCH] [doc] slightly extend HOWTO_MODULE --- doc/HOWTO_MODULE.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/HOWTO_MODULE.md b/doc/HOWTO_MODULE.md index 1998e10..8ef08f2 100644 --- a/doc/HOWTO_MODULE.md +++ b/doc/HOWTO_MODULE.md @@ -10,6 +10,7 @@ Adding a new module to `bumblebee-status` is straight-forward: - See below for how to actually write the module - Test (run `bumblebee-status` in the CLI) - Make sure your changes don't break anything: `./coverage.sh` +- If you want to do me favour, run your module through `black -t py34` before submitting ## Pull requests The project **gladly** accepts PRs for bugfixes, new functionality, new @@ -56,6 +57,14 @@ Otherwise, you have a number of ways to handle widgets: - During runtime, you can set a new list of widgets by using the `self.widgets()` method of the module +## Adding widgets at runtime +If you want to add widgets during runtime, please use the `add_widget()` method of the module: + +``` +def do_something(self): + self.add_widget(full_text="my sample text", name="") +``` + TODO: expand on this ## Periodic updates