IBM developerWorks: Creating KParts Components

Following the first introduction to KParts on IBM developerWorks, David Faure now goes on to show developers how to create KParts components (free registration) in the first part of this tutorial series. You'll get an introduction to the core KParts concepts of read-only and read-write parts and network transparency. You'll learn how to create a read-only component, and then modify it to be a read-write component. You'll also learn how to deploy the component so that Konqueror can use it.

Note from David: This tutorial also demonstrates how KDE3 simplifies component programming, so check it out even if you are familiar with KParts in KDE2. ;-) Registration is required, but that's fairly quick to get through, and you can then save the whole tutorial as a .zip and read it offline.



By fault at Fri, 2002/05/24 - 5:00am

Yeah, I know I've bashed kde on more than a few occasions, but kparts is probably the best thing yet. And, David, great job on all your tutorials!

And, for a little more gratitude, here's some opinions as to how one might extend the kparts area..... (feel free to flame me if you think these are stupid ideas :P )

1) Extend the xml so that instead of using the kparts framework, use the XML to define a language-independent model for using kparts. IIRC, kparts uses a "KPartsManager" or the like, which may or may not depend on dcop (can't recall :P ). So, if you were to use a form of dcop to coordinate/manage kparts, you can use sockets/sharedmem and a C structure in order to allow say, GNOME apps or other apps to use kparts. That way, one can mix and match parts from different interfaces and still get a clean app.

2) There isn't a #2 (or 3 or 4) :P

Just an idea :)

Justin Hibbits

By Justin Hibbits at Fri, 2002/05/24 - 5:00am

I believe this is what XParts is all about.
Alt-F2, ggl:XPart ;)

By David Faure at Fri, 2002/05/24 - 5:00am

yeah, I know XParts is similar, but what I'm thinking of is the opposite (embedding kparts in OTHER apps, not just kde apps). maybe I confused you :P

(Yes, I know the title is kinda lame, but, couldn't think of a better one :P )

Justin Hibbits

By Justin Hibbits at Fri, 2002/05/24 - 5:00am

Why not use the right tool for the right job? Use XParts when you want to embed KDE components in OTHER apps or OTHER app-components into KDE.

Use KParts when you want to embed KDE components within KDE components.


By ac at Fri, 2002/05/24 - 5:00am

Why do they these big companies SUN/IBM insist on requiring registration.
Do they want people to read it or just collect statistics?

By Fredrik C at Fri, 2002/05/24 - 5:00am

KDE tutorial should be found on KDE web sites.

By Mathieu Jobin at Fri, 2002/05/24 - 5:00am

I felt like skimming the document, but was put of by the registration. Sure, if I really _needed_ the doc I could register... but I feel I shouldn't have to.

By ac at Sat, 2002/05/25 - 5:00am

You just need to give a username and password, it doesn't care to verify the email address.

By dc at Sat, 2002/05/25 - 5:00am

Lame is that this KDE documentation is being withheld from KDE developers.

By Neil Stevens at Tue, 2002/05/28 - 5:00am

So, can someone who trusts javascript grab a copy of that and stick it on please?

By Neil Stevens at Sat, 2002/05/25 - 5:00am

Either you are paranoid or you are extremely lazy.

Either way, this is lame.

By Mark at Mon, 2002/05/27 - 5:00am

...this whole don't-make-me-register thing is pretty ridiculous. I registered with IBM a year ago, and got nothing from them. In fact, I think they have an opt-IN policy with regard to spam.

Jeez lads, its well worth it, and it's not like they're asking for a pint of blood or anything.

By Bryan Feeney at Sat, 2002/05/25 - 5:00am