🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Kevin Davidson Mon, 16 Nov 1992 11:21
Dragging mode line - request
#385
Author: Kevin Davidson
Date: Mon, 16 Nov 1992 11:21
13 lines
944 bytes
Ages ago I used Epoch 3.x and had a handy lisp file that let me drag the mode
line up and down with the mouse.

In the many moves between systems - some without X, I've lost this.
Does anybody have something like this ?

Ta,

-- 
____________________Kevin______________________________________________________
Kevin Davidson                       | tkld@cogsci.ed.ac.uk
Centre for Cognitive Science/HCRC,   | Kevin.Davidson@edinburgh.ac.uk
2 Buccleuch Place.                   | +44 31 650 4447 (temporarily)
Dragging mode line - request
#394
Author: Marc Andreessen
Date: Tue, 17 Nov 1992 11:32
72 lines
3331 bytes
Try this......... (you might have to have a few things from the imouse
package also; see the FAQ).

Marc

;;; Modeline drag support, extracted from Imouse package.

(require 'cl)
(require 'motion)
(require 'drag)

(defvar simplemouse::drag-scroll-start nil
  "Where mouse-drag-scroll started.")
(defvar simplemouse::drag-scroll-win nil
  "The window where mouse-drag-scroll started.")
(defvar simplemouse::drag-scroll-crs nil
  "The cursor used before mouse-drag-scroll started.")

(defvar drag-modeline-glyph 116
  "*The cursor glyph used to indicate drag scrolling.")

(defun eval-in-window (window &rest forms)
  "Switch to WINDOW, evaluate FORMS, return to original window."
  (` (let ((OriginallySelectedWindow (selected-window)))
       (unwind-protect
           (progn
             (select-window (, window))
             (,@ forms))
         (select-window OriginallySelectedWindow)))))
(put 'eval-in-window 'lisp-indent-hook 1)

(defun mouse-move-modeline (mdata)
  "Shrink or stretch a window by dragging its modeline."
  (setq mouse::downp nil) 
  (setq simplemouse::drag-scroll-win (nth 2 mdata))
  (setq simplemouse::drag-scroll-crs (epoch::cursor-glyph nil))
  (let ((modeline (nth 3 (window-pixedges simplemouse::drag-scroll-win))))
    (epoch::warp-pointer (/ (window-pixwidth simplemouse::drag-scroll-win) 2)
			 (- modeline 3)))
  (setq simplemouse::drag-scroll-start (epoch::query-pointer))
  (epoch::cursor-glyph drag-modeline-glyph)
  (message "Hold button down to shrink or stretch window, release it when done."))

(defun mouse-move-modeline-terminate (mdata)
  "The up click handler that goes with mouse-move-modeline.
This actually resizes the window in one fell swoop"
  (unwind-protect
      (let* ((drag-scroll-end   (epoch::query-pointer))
	     (delta-y	    (- (nth 1 simplemouse::drag-scroll-start)
			       (nth 1 drag-scroll-end)))
	     (pixheight	    (window-pixheight simplemouse::drag-scroll-win))
	     (height	    (window-height simplemouse::drag-scroll-win)))
	(unless (< (abs delta-y) 2)
	  (eval-in-window simplemouse::drag-scroll-win
	    (move-modeline-up (/ (* delta-y height) pixheight)))))
    ;; Restore normal environment.
    (epoch::cursor-glyph simplemouse::drag-scroll-crs)
    (message "width: %d, height: %d"
	     (window-width simplemouse::drag-scroll-win)
	     (window-height simplemouse::drag-scroll-win)))
  )

(defun simplemouse-do-bindings ()
  "Bind the mouse keys according to Simplemouse's preferences."
  (let ((MODE-MODIFY  (+ mouse-middle mouse-mode -1))
	(DOWN	      mouse-down)
	(UP	      mouse-up))
    (global-set-mouse MODE-MODIFY DOWN	'mouse-move-modeline)
    (global-set-mouse MODE-MODIFY UP	'mouse-move-modeline-terminate)
    ))

(simplemouse-do-bindings)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads