Welcome plasmoid pre-1-ruby

0xDeadC0de roguestar191 at comcast.net
Tue Jan 6 02:31:37 CET 2009


Now that I think about it (After I wrote the rest of this), I did have
one problem which may have been fixed (I'm using Beta2 for development),
I couldn't make a Plasma::Meter.. not sure why.

> It's nice to see a reasonably large Ruby plasmoid. You haven't
> mentioned any problems you've had with the ruby bindings, but I'd be
> interested to hear of anything. I noticed you have a lot of event
> handling code commented out - is that because it didn't work?

Some didn't work, some things I changed, and when I make a change I
typically don't erase the old stuff until I'm sure the new stuff is
working (especially when the old stuff worked). 
I've had a fair share of problems that I've worked through on this, but
so far none with the bindings themselves, usually due to my
unfamiliarity with the language and API's.  
It would be nice if Marshal were able to (re)store Qt or plasma objects
(or both would be spiffy). 


> You say this in you comment at the top of main.rb:
> 
> # The base is PlasmaScripting::Applet. On top of that is my applet -
> which draws it's text to the applet
> # What a pain in the ass
> 
Ahh, this comment is old, I really should have removed it.. the reason
it's there is from when I started this project. I copied the Ruby Cpu
Frequency Scaler that I made (that's on kde-look) to start out with,
which does draw text directly to the applet now (So that it can be put
in the launcher bar and looks something like the clock applets)

> Did you try something simpler which didn't work? Would your problem be
> the same in C++?
> 
Naw this is how it's done afaik to get text on the applet that resizes
to the applets size "properly"

> -- Richard 


Note, the version I sent to the mailing list... had problems. The
version I have still does, I can't get any zorder's to be respected and
randomly(near it's a computer I know nothing is really random in them)
the combo box's will be behind or in front of things.  the Qt guys say
"Shouldn't do that with proper parenting", Aaron said "Try raising z
values". I tried both, separately, and together, just get bad or no
results. I'm new to Qt too though so it very well could be my fault,
although I have it on good authority it's likely a Qt bug.

I applied for KDE svn, will put the "fixed" version that I have (still
has the zorder bug...) as soon as I get accepted. Other than that thing,
it's all working for me. Final note, I'm new to ruby, so I apologize if
there are memory problems.. memory bugs were the hardest for me to grasp
and understand in c++ - and i really haven't even looked at how ruby
handles memory yet (erm... my bad), and if there's a way to call
"delete" on c++ pointers passed down to ruby scripts, or if that's even
needed. 
(Say I remove an item from a qt list, the qt list has removeAt or
something like that which returns the still active pointer to the item
that it removed from the list and must be deleted manually, not sure
what to do in ruby if anything...)
new version also has the slier
-- Matthew




More information about the Plasma-devel mailing list