simple k-project

Dave Robbins dmrobbin at mindspring.com
Wed Jul 21 18:35:52 UTC 1999


Hi Jan,
I think I can help you out a little.
Go to

ftp://ftp.mindspring.com/users/dmrobbin

and get a file called test.tar.gz
It's a little test app I started playing with
It shows how to make a drawing widget for the window and draw a sin wave in it.
it also shows how to grab a html file off the net.
This is the beginning of an app to grab some stock market data of the net and graph it and do some other stuff th help move $ from wall street to my street. (he he)

also look at this site

(man I'm sorry, the site I was going to send you to is down right now)
(try looking at http://devcentral.iftech.com/ in the future,
they have a bunch of tutorials on a lot of stuff that is real good, in particular the tutorial on the doc/view programing model is good for people starting with kdevelop)

It describes the document/view programming paradigm which kdevelop uses.
If you've ever done any M$ VC++ work you'll recognize it as very similar.
The framework set up by kdevelop for a project called "test" consists of a file called main.cpp
this just creates your application object which is an instance of KApplication.
It gives your program the ability to talk to KDE and the operating system
in basic programs you won't need to mess with this.
The next file is test.cpp, it sets up your main window and its tool bar and main menu.
you play with this to modify these thigs for your needs.
The next two files, testview.cpp and testdoc.cpp are the meat of things.
testdoc.cpp gives you a place to keep and manage all the data for your application
testview.cpp is where you manage the display in your window (or windows)
so this approach kinda breaks your program into an object that communicates with the operating system
an object that handles the main frame of your window, an object that handles all your data, and one that handles what yor draw or display in that window. This is kinda a standard approach for basic frameworks for programs that works for most things that most people
want to do.
create a app of your own and look at the difference between the basic framework and what I've done.
My stuff is pretty basic but it gives you something to look at.
You may not be able to compile and run my app because it may look for the header files and libraries in the wrong place for your machine. just look at the code and when you want to run the app you might have to do it from a console windows.
This is caused by my recent shitch from Redhat 5.2 with KDE compiled and installed by hand to RH 6.0 with KDE installed from rpm's. My recomendation is to stick with compiling and installing everthing by hand, this new installation has caused me a world of grief! Oh,
by the way, put test.tar.gz in a temp file before you unzip it.

You might also want to look at kedit.tgz at my ftp sight.
I took the code for the kedit program that comes with KDE and added some dialog boxes to it so it can act as an editor for the excellent ray tracing program POVRay. It's still a work in progress but it shows you how to add dialog boxes and stuff.
I did this before kdevelop had a dialog editor, but it's pretty much the same as doing things with the current version of kdevelop.

Anyway, this gives you a little code to look over, I'm not the most elegent programer around but I can get stuff to work.
On the other hand the KDE development team are masters of the realm and I salute them all.

Have fun!!
Dave


Jan W. Zumwalt wrote:

> I have had difficulty getting of the ground with a C++ Kdev project. Would some kind soul be willing to send me a ***complete*** project where all they have done is open up a list box, text box, radio button or something simple like that so that I may diasect it!
>
> I have read the excellent tutorials but none give a complete snapshot in the Kdev environment.
>
> Thanks so much!
> ---
> Jan W.Zumwalt
> Computer Electronics
> 717 Northway Drive.
> Anchorage, Ak 99508
> V-907-258-1002
> F-907-258-9006
> jan99508 at zdnetmail.com
>
> Free web-based email, anytime, anywhere!
> ZDNet Mail - http://www.zdnetmail.com






More information about the KDevelop mailing list