-/* $Id: macevlog.c,v 1.3 2003/02/19 01:03:47 ben Exp $ */
+/* $Id: macevlog.c,v 1.5 2003/02/23 13:00:38 ben Exp $ */
/*
* Copyright (c) 2003 Ben Harris
* All rights reserved.
static void mac_activateeventlog(WindowPtr, EventRecord *);
static void mac_groweventlog(WindowPtr, EventRecord *);
static void mac_updateeventlog(WindowPtr);
+static void mac_closeeventlog(WindowPtr);
static void mac_createeventlog(Session *s)
{
wi->activate = &mac_activateeventlog;
wi->grow = &mac_groweventlog;
wi->update = &mac_updateeventlog;
+ wi->close = &mac_closeeventlog;
SetWRefCon(s->eventlog_window, (long)wi);
GetPort(&saveport);
SetPort((GrafPtr)GetWindowPort(s->eventlog_window));
#else
(*s->eventlog)->selFlags = lExtendDrag | lNoDisjoint | lNoExtend;
#endif
- ShowWindow(s->eventlog_window);
}
void mac_freeeventlog(Session *s)
{
Terminal *term = frontend;
Session *s = term->frontend;
- ListBounds bounds;
+ ListBounds bounds, visible;
Cell cell = { 0, 0 };
if (s->eventlog == NULL)
#if TARGET_API_MAC_CARBON
GetListDataBounds(s->eventlog, &bounds);
+ GetListVisibleCells(s->eventlog, &visible);
#else
bounds = (*s->eventlog)->dataBounds;
+ visible = (*s->eventlog)->visible;
#endif
+
cell.v = bounds.bottom;
LAddRow(1, cell.v, s->eventlog);
LSetCell(str, strlen(str), cell, s->eventlog);
+ /* ">=" and "2" because there can be a blank cell below the last one. */
+ if (visible.bottom >= bounds.bottom)
+ LScroll(0, 2, s->eventlog);
}
static void mac_draweventloggrowicon(Session *s)
EndUpdate(window);
}
+static void mac_closeeventlog(WindowPtr window)
+{
+
+ HideWindow(window);
+}
+
void mac_showeventlog(Session *s)
{
+ SelectWindow(s->eventlog_window);
ShowWindow(s->eventlog_window);
}