comparison lisp/wid-edit.el @ 55984:6d619a8bd0ba

(widget-specify-button): Use hand pointer rather than mouse-face as visible mouse-over effect.
author Kim F. Storm <storm@cua.dk>
date Tue, 08 Jun 2004 09:54:59 +0000
parents 1374d9297422
children 21a47f89c6f6 4c90ffeb71c5
comparison
equal deleted inserted replaced
55983:f1ae55d0e729 55984:6d619a8bd0ba
383 (overlay-put overlay 'button widget) 383 (overlay-put overlay 'button widget)
384 (overlay-put overlay 'keymap (widget-get widget :keymap)) 384 (overlay-put overlay 'keymap (widget-get widget :keymap))
385 (overlay-put overlay 'evaporate t) 385 (overlay-put overlay 'evaporate t)
386 ;; We want to avoid the face with image buttons. 386 ;; We want to avoid the face with image buttons.
387 (unless (widget-get widget :suppress-face) 387 (unless (widget-get widget :suppress-face)
388 (overlay-put overlay 'face (widget-apply widget :button-face-get)) 388 (overlay-put overlay 'face (widget-apply widget :button-face-get)))
389 (overlay-put overlay 'mouse-face widget-mouse-face)) 389 (overlay-put overlay 'pointer 'hand)
390 (overlay-put overlay 'help-echo help-echo))) 390 (overlay-put overlay 'help-echo help-echo)))
391 391
392 (defun widget-mouse-help (window overlay point) 392 (defun widget-mouse-help (window overlay point)
393 "Help-echo callback for widgets whose :help-echo is a function." 393 "Help-echo callback for widgets whose :help-echo is a function."
394 (with-current-buffer (overlay-buffer overlay) 394 (with-current-buffer (overlay-buffer overlay)
1287 Store the newly created widget in the :children attribute. 1287 Store the newly created widget in the :children attribute.
1288 1288
1289 The value of the :type attribute should be an unconverted widget type." 1289 The value of the :type attribute should be an unconverted widget type."
1290 (let ((value (widget-get widget :value)) 1290 (let ((value (widget-get widget :value))
1291 (type (widget-get widget :type))) 1291 (type (widget-get widget :type)))
1292 (widget-put widget :children 1292 (widget-put widget :children
1293 (list (widget-create-child-value widget 1293 (list (widget-create-child-value widget
1294 (widget-convert type) 1294 (widget-convert type)
1295 value))))) 1295 value)))))
1296 1296
1297 (defun widget-type-default-get (widget) 1297 (defun widget-type-default-get (widget)
1298 "Get default value from the :type attribute of WIDGET. 1298 "Get default value from the :type attribute of WIDGET.
3310 3310
3311 Here we attempt to define my-list as a choice of either the constant 3311 Here we attempt to define my-list as a choice of either the constant
3312 nil, or a cons-cell containing a sexp and my-lisp. This will not work 3312 nil, or a cons-cell containing a sexp and my-lisp. This will not work
3313 because the `choice' widget does not allow recursion. 3313 because the `choice' widget does not allow recursion.
3314 3314
3315 Using the `lazy' widget you can overcome this problem, as in this 3315 Using the `lazy' widget you can overcome this problem, as in this
3316 example: 3316 example:
3317 3317
3318 (define-widget 'sexp-list 'lazy 3318 (define-widget 'sexp-list 'lazy
3319 \"A list of sexps.\" 3319 \"A list of sexps.\"
3320 :tag \"Sexp list\" 3320 :tag \"Sexp list\"
3321 :type '(choice (const nil) (cons :value (nil) sexp sexp-list)))" 3321 :type '(choice (const nil) (cons :value (nil) sexp sexp-list)))"
3322 :format "%{%t%}: %v" 3322 :format "%{%t%}: %v"
3323 ;; We don't convert :type because we want to allow recursive 3323 ;; We don't convert :type because we want to allow recursive
3324 ;; datastructures. This is slow, so we should not create speed 3324 ;; datastructures. This is slow, so we should not create speed
3325 ;; critical widgets by deriving from this. 3325 ;; critical widgets by deriving from this.
3326 :convert-widget 'widget-value-convert-widget 3326 :convert-widget 'widget-value-convert-widget
3327 :value-create 'widget-type-value-create 3327 :value-create 'widget-type-value-create
3328 :value-get 'widget-child-value-get 3328 :value-get 'widget-child-value-get
3329 :value-inline 'widget-child-value-inline 3329 :value-inline 'widget-child-value-inline
3330 :default-get 'widget-type-default-get 3330 :default-get 'widget-type-default-get