TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: R.WIESER
from: ELI THE BEARDED
date: 2017-11-20 21:25:00
subject: Re: How to write a dialog

In comp.sys.raspberry-pi, R.Wieser  wrote:
> Hmm ...  And than how do the programs currently present on RP draw their
> windows and buttons -- without such a framework already being present (as I
> seem to need to download and install it before being able to do anything) ?
> I don't think each program will carry its own
> draw-a-button-one-pixel-at-a-time -code, do you ?

As someone whose first GUI was written in assembly on an Apple ][e, I'm
very happy to not deal with pixel placement anymore.

> ... unless that framework wishes to create its *own* style of windows and
> other controls.   But than the question remains: where are the
> standard/origional controls kept.

Under X, there are no "original" styles. But the Athena widgets in Xt
provide a baseline style. X11 provides an interface for drawing
"windows" and receiving "events" related to those windows. A button is a
window. And a mouse pointer moving onto the button is an event.
(Probably lots of events, the enter window event being first, then lots
of mouse movement events. Clicking the button will be two events, a
mouse button down and a mouse button up. But because of all those mouse
motion events, you can create "buttons" without using subwindows.)

>> Use the Xt interface for a very basic way in.
> One vote for GTX, and now yours for Xt.  Pros and cons ?

Xt is very basic. It seemed like that's what you wanted. GTX is much
more modern, and will probably have native code for things like "put a
PNG image on a button" and support for modern fonts.

> :-) Tell me about it.  My preferred language is Assembly, and I've
> disassembled enough programs to amaze myself about whats going on below the
> surface.

You can, and I have, do X11 interfaces entirely over sockets with no
direct linking to X11 code. When I did it, I used a "Pure Perl" (no
compiled parts) X11 module. I tried, but could not squeeze it into a
four line sig, instead needing five:

use X11::Protocol;$X=new X11::Protocol;END{$X->FreeGC($G);undef$X}map{$$_=$X->
new_rsrc}(W,F,G);$X->event_handler('queue');$X->CreateWindow($W,$X->root,'Inp'
.'utOutput',$D=$X->root_depth,'CopyFromParent',(0,0),300,30,4,'event_mask',01,
background_pixel=>2**$D-1);$X->CreateGC($G,$W);$X->MapWindow($W);$X->PolyText8
($W,$G,25,28,[0,'Eli the Bearded:Just Another Perl Hacker']);$X->handle_input;

That was a long time ago, and I seem to recall newer versions of X11
were unhappy with that code, but I don't recall why.

Elijah
------
had a little bit of fudge room to change code length for margin line up

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.