slang-users mailing list

[2005 Date Index] [2005 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [slang-users] Major Milestone and some QUESTIONS ......


Ben Duncan <ben@xxxxxxxxxxxxxxxxxx> wrote:
>S-lang has "SLsmg_set_screen_start" which would set a "virtual screen" inside
>of the physical screen. What If I need to a display ( A selection box for
>  example)
>out side of that virtual area? And what If I need several "Virtual" display's
>all at once? How would you go about keeping track of all this?

All the SLsmg_set_screen_start function does is set the origin for the
upper-left corner of the physical display.  This has the effect of
allowing the application to pan.  For example, suppose this function
is used to give the upper-left corner the (logical) coordinate
row=0,col=40 as follows:

   int r0=0, c0=40;
   SLsmg_set_screen_start (&r0,&c0);
   SLsmg_gotorc (0,0);
   SLsmg_write_string ("01234567891123456789212345678931234567894abcedf");

This will cause the just the "abcdef" portion of the string to be
displayed because only those characters in the string will be have
logical column coordinates >= 40.  The effect is that the display has
been panned to the right by 40 columns.

>Also, I have been trying to follow along the SLWDG and the NEWT method of
>running a screen, but am hopelessly lost. How does that mechanism work?
>Are you building a link list of callbacks and then running thru the callbacks?

I do not know how newt works.  The SLwidget code is written in an
object oriented style where each widget is an object that knows how to
draw itself, respond to events, etc...  Some of the widgets permit
callbacks to be registered when an event is sent to the widget.

The main event loop in called SLwdg_take_input.  What it does is very
simple.  It loops performing these actions:

    update the display
    read a keysym
    sends the keysym to the current widget (focus_proc method)

The display is updated by looping over each of the widgets redraw
methods.  The main action occurs in the currently focused widget's
focus_proc where widget specific things are performed.

I wrote the slwdg code for an internal project many years ago but that
project was cancelled and I have never touched it since.  As a result,
I do not remember many of the implementation details.  I do know
that the code worked quite well and for that reason was put into the
public domain as yet another example of using slang.

--John

_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html


[2005 date index] [2005 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]