Plan 9 from Bell Labs’s /usr/web/sources/contrib/steve/root/sys/src/cmd/mothra/libpanel/scroll.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#include <u.h>
#include <libc.h>
#include <draw.h>
#include <event.h>
#include <panel.h>
#include "pldefs.h"
void plscroll(Panel *scrollee, Panel *xscroller, Panel *yscroller){
	scrollee->xscroller=xscroller;
	scrollee->yscroller=yscroller;
	if(xscroller) xscroller->scrollee=scrollee;
	if(yscroller) yscroller->scrollee=scrollee;
}
Scroll plgetscroll(Panel *p){
	return p->scr;
}
void plsetscroll(Panel *p, Scroll s){
	if(p->scroll){
		if(s.size.x) p->scroll(p, HORIZ, 2, s.pos.x, s.size.x);
		if(s.size.y) p->scroll(p, VERT, 2, s.pos.y, s.size.y);
	}
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.