This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Some help building a simple Plasmoid?

Tags: None
(comma "," separated)
pagoda
Registered Member
Posts
108
Karma
1
OS
Hi everyone,
I am 6 days into using Kubuntu 11.04 as my main o/s and so far so good!
Kudos to the developers for 'integration and consistency' all-round.

I've been bitten by the plasmoid bug and found a simple example of display-image code in a magazine.
All this is designed to do is display an svg image on the desk.
I've managed to create the plasmoid and package it, but when I run it however, it's minus the image! So celebrations are currently on hold!
Can anyone assist in resolving this?
cheers
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Can you please post the code in question (including build system)?

I suspect that either a layout is not being set...


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
pagoda
Registered Member
Posts
108
Karma
1
OS
Thank you for your assistance...
As requested;
Structure
Code: Select all
mkdir -p hello-linuxpro/contents/code


metadata.desktop
Code: Select all
[Desktop Entry]
Name=Hello LinuxPro
Comment=My first plasmoid
Icon=ksnapshot

Type=Service
X-KDE-ServiceTypes=Plasma/Applet
X-Plasma-API=javascript
X-Plasma-MainScript=code/main.js
X-Plasma-DefaultSize=300,100

X-KDE-PluginInfo-Author=Marcel Gagne
X-KDE-PluginInfo-Email=marcel1@marcelgagne.com
X-KDE-PluginInfo-Name=hello-linuxpro
X-KDE-PluginInfo-Version=1.0
X-KDE-PluginInfo-Website=http://plasma.kde.org/
X-KDE-PluginInfo-Category=Examples
X-KDE-PluginInfo-Depends=
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true


main.js
Code: Select all
mainLayout = new LinearLayout(plasmoid);

svg = new PlasmaSvg('kde_logo')

plasmoid.action_myAction = function()
{
  plasmoid.update()
}

plasmoid.paintInterface = function(painter)
{
  rect = plasmoid.rect
  svg.resize(rect.width, rect.height)
  svg.paint(painter, rect.x, rect.y)
}


Installed via
Code: Select all
plasmapkg -i ~/hello-linuxpro
bulldog98
KDE Developer
Posts
17
Karma
0
OS
You have to put every image under contents/images/

Regards Jonathan


Image
pagoda
Registered Member
Posts
108
Karma
1
OS
Thank you bulldog98 but that's what I have done.

Update: It seem that the image I was using was perhaps corrupted?
A substitute image now is working!
Let the cheering begin :D :D :D

Thanks for the help everyone
dennis


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]