summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkScroll.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/ttk/ttkScroll.c')
-rw-r--r--generic/ttk/ttkScroll.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/generic/ttk/ttkScroll.c b/generic/ttk/ttkScroll.c
index 6e8c2e3..5615eef 100644
--- a/generic/ttk/ttkScroll.c
+++ b/generic/ttk/ttkScroll.c
@@ -7,7 +7,7 @@
*
* Scrollable interface:
*
- * + 'first' is controlled by [xy]view widget command
+ * + 'first' is controlled by [xy]view widget command
* and other scrolling commands like 'see';
* + 'total' depends on widget contents;
* + 'last' depends on first, total, and widget size.
@@ -16,15 +16,15 @@
*
* 1. User adjusts scrollbar, scrollbar widget calls its -command
* 2. Scrollbar -command invokes the scrollee [xy]view widget method
- * 3. TtkScrollviewCommand calls TtkScrollTo(), which updates
+ * 3. TtkScrollviewCommand calls TtkScrollTo(), which updates
* 'first' and schedules a redisplay.
- * 4. Once the scrollee knows 'total' and 'last' (typically in
- * the LayoutProc), call TtkScrolled(h,first,last,total) to
+ * 4. Once the scrollee knows 'total' and 'last' (typically in
+ * the LayoutProc), call TtkScrolled(h,first,last,total) to
* synchronize the scrollbar.
* 5. The scrollee -[xy]scrollcommand is called (in an idle callback)
* 6. Which calls the scrollbar 'set' method and redisplays the scrollbar.
*
- * If the scrollee has internal scrolling (e.g., a 'see' method),
+ * If the scrollee has internal scrolling (e.g., a 'see' method),
* it should TtkScrollTo() directly (step 2).
*
* If the widget value changes, it should call TtkScrolled() (step 4).
@@ -34,10 +34,9 @@
* TtkScrollbarUpdateRequired, which will invoke step (5) (@@@ Fix this)
*/
-#include <tk.h>
+#include <tkInt.h>
#include "ttkTheme.h"
#include "ttkWidget.h"
-#include <string.h>
/* Private data:
*/
@@ -56,7 +55,7 @@ struct ScrollHandleRec
*/
ScrollHandle TtkCreateScrollHandle(WidgetCore *corePtr, Scrollable *scrollPtr)
{
- ScrollHandle h = ckalloc(sizeof(*h));
+ ScrollHandle h = (ScrollHandle)ckalloc(sizeof(*h));
h->flags = 0;
h->corePtr = corePtr;
@@ -131,7 +130,7 @@ static void UpdateScrollbarBG(ClientData clientData)
Tcl_Preserve((ClientData) interp);
code = UpdateScrollbar(interp, h);
if (code == TCL_ERROR && !Tcl_InterpDeleted(interp)) {
- Tcl_BackgroundException(interp, code);
+ Tcl_BackgroundError(interp);
}
Tcl_Release((ClientData) interp);
}
@@ -142,7 +141,7 @@ static void UpdateScrollbarBG(ClientData clientData)
void TtkScrolled(ScrollHandle h, int first, int last, int total)
{
Scrollable *s = h->scrollPtr;
-
+
/* Sanity-check inputs:
*/
if (total <= 0) {
@@ -257,6 +256,6 @@ void TtkFreeScrollHandle(ScrollHandle h)
if (h->flags & SCROLL_UPDATE_PENDING) {
Tcl_CancelIdleCall(UpdateScrollbarBG, (ClientData)h);
}
- ckfree(h);
+ ckfree((ClientData)h);
}