MakeIcon.module written by Bruce Steers
Have your gambas application create it's own launcher icon as either a desktop launcher or
a menu entry.
Simply add (Import) the MakeIcon.module to your app then you can use the following command...
# MakeIcon.MakeMe(Name, Icon Image, Comment, MenuCats, Prefix, UseRoot)
'Name' is the desktop icon name or the menu entry text and is optional,
Defaults to Application.Name
'Icon Image' is the icon 'Image' to use, must be a loaded Image object not just a filepath.
Defaults to the Applications main form icon.
'Comment' is the tooltip shown. Defaults to Application.Name
'MenuCats' Semicolon separated list of categories that define where the menu entry appears
Eg. Application;AudioVideo;Video
This property acts as a switch, if supplied it makes a menu entry, if ommited it makes
a desktop launcher.
Use the word 'choose' to pop a requester to ask the user to choose categories.
'Prefix' any text to prefix your launcher command, Ie 'pkexec gbr3'
Defaults to 'gbr3'
'UseRoot', Boolean toggle , If True and your app is running as root the launcher will be added to 'roots'
desktop or menu. By default the launcher will add to default Users home not root.
Example Usage...
Code: Select all
MakeIcon.MakeMe(File.BaseName(Application.Name), FMain.Icon.Image, "MediaPlay TVShow Player")
Code: Select all
MakeIcon.MakeMe(,, "MediaPlay TVShow Player", "Application;GNOME;AudioVideo;Video")
Code: Select all
MakeIcon.MakeMe(,, "MediaPlay TVShow Player", "choose")
Code: Select all
MakeIcon.MakeMe(, Image.Load("./FunkyIcon.png"))
Code: Select all
MakeIcon.MakeMe()
Tested on latest Debian / Ubuntu / Mint