Python Forum
[XFce]i am again looking for sample menu code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[XFce]i am again looking for sample menu code
#1
i am, again, looking for sample menu code. an idea case would be code that reads a config file that describes the menu layout, what to show at each item, and a command to execute if that one is selected.

something that can add itself to the Xfce panel would be extra great.

Python3 preferred, but Python2 can be OK.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
which GUI framework so the thread can be prefixed appropriately?
Reply
#3
anything that works in Xfce.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#4
No idea what that is ?
Reply
#5
xfce is a Window Manager in Ubuntu / Linux Mint.

(Jul-03-2019, 11:08 PM)Skaperen Wrote: something that can add itself to the Xfce panel would be extra great.

Here's a simple systray example

#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
from PyQt5.QtWidgets import QApplication, QSystemTrayIcon, QDialog, QMenu, QMessageBox, QWidget
from PyQt5.QtGui import QIcon

class theTray(QWidget):
    def __init__(self, parent=None):
        super(theTray, self).__init__(parent)
        icon = QIcon.fromTheme("python")
        menu = QMenu()
        messageAction = menu.addAction(QIcon.fromTheme("help-info"), "show Message")
        messageAction.triggered.connect(self.message)
        exitAction = menu.addAction(QIcon.fromTheme("application-exit"), "exit")
        exitAction.triggered.connect(self.exitApp)
    
        self.tray = QSystemTrayIcon()
        self.tray.setIcon(icon)
        self.tray.setContextMenu(menu)
        self.tray.show()
        self.tray.setToolTip("click me (right)")
        self.tray.showMessage("SysTray", "Example")

    def message(self):
        QMessageBox.information(
                None, 'Systray', 'Hell World')

    def exitApp(self):
        sys.exit()

if __name__ == "__main__":
    app = QApplication(sys.argv)
    myapp = theTray()
    myapp.show()
    sys.exit(app.exec_())
Reply
#6
do we still need # -*- coding: utf-8 -*- in python3 since it defaults to that?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#7
i got some sample code that is in C and uses GTK. this should be translatable to Python?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Which lib to learn for Xfce Skaperen 0 1,855 Jan-07-2019, 09:30 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020