__init__.py
Python script, ASCII text executable
1""" 2Label applet for the Panorama panel. 3Copyright 2025, roundabout-host.com <vlad@roundabout-host.com> 4 5The main purpose of this file is a demo, as such, this file, 6and no other files unless otherwise stated, is subject to the 7following licence notice: 8 9Usage of the works is permitted provided that this instrument is 10retained with the works, so that any entity that uses the works is 11notified of this instrument. 12 13DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY. 14""" 15 16import panorama_panel 17 18import gi 19gi.require_version("Gtk", "4.0") 20 21from gi.repository import Gtk 22 23 24class LabelApplet(panorama_panel.Applet): 25name = "Label" 26description = "Show a text" 27 28def __init__(self, orientation=Gtk.Orientation.HORIZONTAL, config=None): 29super().__init__(orientation=orientation, config=config) 30if config is None: 31config = {} 32self.label = Gtk.Label() 33self.label.set_text(config.get("text", "Label")) 34self.append(self.label) 35 36def get_config(self): 37return {"text": self.label.get_text()} 38