🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.interviews
Article #824

Selections

#824
From: Even Oscar Andersen
Date: Tue, 10 Nov 1992 13:11
48 lines
1900 bytes
Does it exist an example program/manual pages describing
SelectionCallback,
SelectionHandler,
SelectionManager,
SelectionManagerRep.

I'm writing an text-editor, and I have some problems with selecting/deselecting
text. Currently the document is build up of class Elements which takes an
Glyph as their body.

I defined P_Background as a Background + operation background(const Color *)
 and   const Color *background()

I defined P_Character as a Character + operation foreground(const Color *)
  and const Color *foreground()

Element is a public Monoglyph.
Element(Glyph *bd, const Color *fg, const Color *bg) {
  _pb = new P_Background(bd, bg);
  _pc = bd;

  body(_pb);
  _foreground = fg;
  _background = bg;
}

Element::select() {
  _pb->background(fg);
  _pc->foreground(bg);
  <switch bg/fg>
}


No this works if I say new Element(new P_Character(..)..);
but I'm limited to building my document using P_Character's.

Suppose a programmer using my classes would want to add a HGlue,
another cursor ...

I can make Element have an extra parameter if the Glyph *bd is a P_Character.
This will make the program work, but I still wont be able to mark Elements not
containing P_Character's as selected, and I believe there is a better way to do
this

I would also like to know how a selection can be sent to/read from X11.

Even Oscar Andersen
Technical Details
Message-ID: <1992Nov10.131115.5995@ifi.uio.no>
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!agate!doc.ic.ac.uk!uknet!mcsun!sunic!ugle.unit.no!aun.uninett.no!nuug!ifi.uio.no!evena

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!agate!doc.ic.ac.uk!uknet!mcsun!sunic!ugle.unit.no!aun.uninett.no!nuug!ifi.uio.no!evena
From: evena@ifi.uio.no (Even Oscar Andersen)
Newsgroups: comp.windows.interviews
Subject: Selections
Message-ID: <1992Nov10.131115.5995@ifi.uio.no>
Date: 10 Nov 92 13:11:15 GMT
Sender: evena@ifi.uio.no (Even Oscar Andersen)
Organization: Dept. of Informatics, University of Oslo, Norway
Lines: 48
Nntp-Posting-Host: farmaty.ifi.uio.no
Originator: evena@farmaty.ifi.uio.no