In comp.sys.raspberry-pi, R.Wieser wrote:
> And thats another. What does such a framework *do* for me that I can't do
> (read: write) myself ? I mean, if some already existing program on my PI
> can display a window with a button, whats than the problem with me calling
> the same (library) functions ? What do I need such a framework for ?
The framework provides a lot of the tedious code already done for you.
When you draw a window on the screen, say, 400 pixels wide by 300 pixels
tall, with the words "Hello, click my button" and a button 70 pixels
wide by 50 pixels tall that says "HERE", do you want to think about all
12,000 pixels that were just drawn? Do you want do deal with re-drawing
the parts that get covered and then uncovered by another program? Do you
want to parse font files yourself for drawing the letters? Do you want
to draw the curve of the button corners and the shadow, and design the
look of clicking on the button?
Chance are, no. You want an interface that says "draw me a 400x300
window, give it the text "Hello, click my button" in the main text area,
and put a button in the usual location with the word "HERE". When
someone clicks the button, call this function. That's what a framework
gives you, and different frameworks will have different looks and
libraries of basic windows. Plus widgets for making non-basic windows
with more sophisticated interfaces.
> And before you wonder, I've been programming Windows dialogs/windows that
> way. Without a framework, just calling the - already existing in the basic
> OS - DLL functions. Doesn't Linux have something comparable ?
Use the Xt interface for a very basic way in. The X11 source code has
examples. Things like xclock, xeyes, xcalc, xev, those sorts of programs.
It's a strange world down there. It's object oriented code written in C,
and predating C++. Learning that makes it very easy to see how C++
evolved from a C preprocessor.
Elijah
------
hasn't written Xt code in a long time
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|