Files
Python-With-Gtk-Template/plugins/template/plugin.py

36 lines
787 B
Python
Raw Normal View History

2022-09-05 18:01:39 -05:00
# Python imports
# Lib imports
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
# Application imports
from plugins.plugin_base import PluginBase
2022-09-05 18:01:39 -05:00
2023-01-29 00:06:52 -06:00
class Plugin(PluginBase):
2022-09-05 18:01:39 -05:00
def __init__(self):
super().__init__()
2022-09-05 18:01:39 -05:00
def load(self):
ui_element = self.requests_ui_element("plugin_control_list")
ui_element.add( self.generate_plugin_element() )
2022-09-05 18:01:39 -05:00
def run(self):
...
def generate_plugin_element(self):
button = Gtk.Button(label = self.name)
button.connect("button-release-event", self.send_message)
button.show()
return button
2022-09-05 18:01:39 -05:00
def send_message(self, widget = None, eve = None):
2022-09-05 18:01:39 -05:00
message = "Hello, World!"
self.emit("display_message", ("warning", message, None))