X-Git-Url: https://plomlompom.com/repos/index.html?a=blobdiff_plain;f=windows.c;h=6a649a325b187894c8ddc46b6eb34b51f680f68f;hb=e1ae0a05e12a8a0aec170d9d3b795ca0dc74e6ed;hp=ff0adb2bf370bb4f5b3b32bdbe2de84c98260a29;hpb=8e65812566e9109f3d672ddfb4c4a30f042f917f;p=plomrogue
diff --git a/windows.c b/windows.c
index ff0adb2..6a649a3 100644
--- a/windows.c
+++ b/windows.c
@@ -23,7 +23,7 @@ void scroll_pad (struct WinMeta * win_meta, char dir) {
else if ('-' == dir && win_meta->pad_offset > 0)
win_meta->pad_offset--; }
-struct Win init_window (struct WinMeta * win_meta, char * title) {
+struct Win init_window (struct WinMeta * win_meta, char * title, void * data, void * func) {
// Create and populate Win struct with sane default values.
struct Win win;
win.prev = 0;
@@ -32,6 +32,8 @@ struct Win init_window (struct WinMeta * win_meta, char * title) {
win.title = title;
win.width = 20;
win.height = win_meta->height - 1;
+ win.data = data;
+ win.draw = func;
return win; }
void append_window (struct WinMeta * win_meta, struct Win * win) {
@@ -213,7 +215,7 @@ void cycle_active_window (struct WinMeta * win_meta, char dir) {
else
win_meta->active = win_meta->chain_end; } } }
-void shift_window (struct WinMeta * win_meta, char dir) {
+void shift_active_window (struct WinMeta * win_meta, char dir) {
// Move active window forward/backward in window chain. If jumping beyond start/end, move to other chain end.
if (0 != win_meta->active && win_meta->chain_start != win_meta->chain_end && (dir == 'f' || dir == 'b')) {
int i, i_max;