Important information: Google announced that, from September 2026, Android devices will require ALL apps to be signed by Google, effectively leading to an iOS situation. Value your right to a computer that does what you want; do not tolerate this monopolistic practice! Contact me if you don't understand why it is bad. Click to learn more.

 __init__.py

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