I am woried about "need to free the control here " warning .
It appeared after I started the code and add it to the panel .
Actually I have only 3 files . The factory file , the service file and UserMenu.py
I wanted first to see if it will run on simple basis as I am beginner programmer . Once I made a label work on mate 1.8 . But now i dunno wath is wrong .
Here is the code :
#!/usr/bin/env python3
import gi
gi.require_version("Gtk", "2.0")
gi.require_version("MatePanelApplet","4.0")
from gi.repository import Gtk
from gi.repository import MatePanelApplet
# create the applet
def applet_fill(applet):
Button = Gtk.ToggleButton("Button on panel")
applet.add(Button)
applet.show_all()
# this is called by mate-panel on applet creation
def applet_factory(applet, iid, data):
if iid != "MateUserMenuApplet":
return False
applet_fill(applet)
return True
MatePanelApplet.Applet.factory_main("MateUserMenuAppletFactory", True,
MatePanelApplet.Applet.gtype,
applet_factory, None)
#Here is the factory file -- org.mate.panel.MateUserMenuApplet.mate-panel-applet :
[Applet Factory]
Id=MateUserMenuAppletFactory
InProcess=false
Location=/usr/bin/env python3 /home/ivalin/mate-user-menu-applet/UserMenu.py
Name=MATE User Menu Applet Factory
Description=Applet to show a user menu
[MateUserMenuApplet]
Name=MATE User Menu Applet
Description=Applet to show a user menu
Icon=mate
MateComponentId=OAFIID:MATE_MateUserMenuApplet;
#Here is the service file -- org.mate.panel.applet.MateUserMenuAppletFactory.service :
[D-BUS Service]
Name=org.mate.panel.applet.MateUserMenuAppletFactory
Exec=/usr/bin/env python3 /home/ivalin/mate-user-menu-applet/UserMenu.py
END
I have a MainWindow.py that I will connect to the button but I think it is not nessecary since I did not include the module in UserMenu.py