Computer Science Canada

How can I put in a vertical scrollbar into my program?

Author:  Angel [ Mon Jan 05, 2004 10:57 pm ]
Post subject:  How can I put in a vertical scrollbar into my program?

I tried putting in a scrollbar into my program using this GUI code:

code:
% The "GUI.CreateVerticalScrollBar Example" program.

import GUI

View.Set ("graphics:100;230,nobuttonbar")

var scrollBar : int

procedure ScrollBarMoved (value : int)
    Text.Locate (9, 7)
    put "Scroll"
    Text.Locate (10, 8)
    put "Bar"
    Text.Locate (11, 8)
    put value : 3
end ScrollBarMoved

scrollBar := GUI.CreateVerticalScrollBar (10, 10, 180, 50, 150, 50,
    ScrollBarMoved)
loop
    exit when GUI.ProcessEvent
end loop


The code works on its own, but not in my program. Does anyone know of any other ways I can put in a scrollbar?

Author:  Tony [ Mon Jan 05, 2004 10:59 pm ]
Post subject: 

my guess is that you're placing your GUI.ProcessEvent loop in the wrong place. It should be at the end...

Author:  Angel [ Mon Jan 05, 2004 11:09 pm ]
Post subject: 

I tried that. I pasted my full program in the other post so maybe you can try the code on your computer or something. I put it at the beginning of the program (the whole code) and I also tried to do what you did and it still gives me a whole bunch of errors.


: