Lisp HUG Maillist Archive

capi:slider

I'm trying to get a capi:slider into an application, but I don't understand how to access the slider's value - the "reader" is
 
 capi:slider-show-value-p
 
but I don't know how to use that in my (simplified) example:
 
 
 
(defun remote ()
  (capi:display (make-instance 'button-test
                      :window-styles '(:always-on-top
                                       :borderless
                                       :hides-on-deactivate)
                      :x 200
                      :y 200
                      :title "Button Test")))
 
 
 
(capi:define-interface button-test ()
  ()
  (:panes
   (slider-1
    capi:slider
    :title "Distance"
    :start 0
    :end 1000)))
 

;capi:slider-show-value-p ????
 
 
 
Thanks as always for your patience!
 
Bruce.

 

Re: capi:slider

Hi Bruce,

On Dec 7, 2005, at 9:42 PM, Bruce J. Weimer, MD wrote:

> I'm trying to get a capi:slider into an application, but I don't  
> understand how to access the slider's value - the "reader" is
>
>  capi:slider-show-value-p
>
> but I don't know how to use that in my (simplified) example:


"reader" in this context means a reader for a slot value. In the  
documentation you'll also see "accessor" meaning the function is both  
a reader and can set the slot value using the same function with setf.

So capi:slider-show-value-p just returns t if you passed a non-nil  
value for the :show-value-p initarg.

What you want to look at are the superclasses of slider, in  
particular range-pane, which has functions for accessing the slider  
values and for setting up callbacks that get execute when the value  
is changed.

There is an example using a slider in examples/capi/applications/ 
maze.lisp



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


Re: capi:slider

Unable to parse email body. Email id is 4907

Re: capi:slider

Hi,

It is capi:range-slug-start.
It takes the slider pane as an argument.
Example is below:

cheers

paulm

CL-USER 4 > (capi:define-interface button-test ()
               ()
               (:panes
                (slider-1
                 capi:slider
                 :title "Distance"
                 :start 0
                 :end 1000
                 :reader slider-1)))
BUTTON-TEST

CL-USER 5 > (setf *slider* (make-instance 'button-test
                                           :window-styles '(:always-on-top
                                                            :borderless
                                                            :hides-on-deactivate)))
#<BUTTON-TEST NIL 2069A244>

CL-USER 6 > (capi::display *slider*)
#<BUTTON-TEST "Untitled LispWorks Interface - 1" 2069A244>

CL-USER 7 > (capi:range-slug-start (slider-1 *slider*))
600


At 16:10 08/12/2005, Bruce J. Weimer, MD wrote:
>John and Nick,
>
>"capi:slug-value" is kind of what I want - except I get:
>
>Error: CAPI:SLUG-VALUE does not exist at all.
>
>Then "capi:range-slug-start" looks promising, but it wants an argument - 
>and I don't know what to pass it... and it may not be the right function 
>anyway. I've looked at the maze example - but the code itself reads like a 
>maze to me...  there are functions that are defined there that don't 
>appear to be called from anywhere and yet they still seem to be invoked?!
>
>Anyway, I just want to be able to "look" at the slider and read the slug 
>value?
>
>Thanks for helping!!
>
>Bruce.
>
>(defun remote ()
>  (capi:display (make-instance 'button-test
>                      :window-styles '(:always-on-top
>                                       :borderless
>                                       :hides-on-deactivate)
>                      :x 200
>                      :y 200
>                      :title "Button Test")))
>
>
>
>(capi:define-interface button-test ()
>  ()
>  (:panes
>   (slider-1
>    capi:slider
>    :title "Distance"
>    :start 0
>    :end 1000)))



Re: capi:slider

(defun slider-value (slider)
              (capi:range-slug-start slider))

This will return the slider's current value based on 0 being the start 
and slug-end being the max.

Wade


Bruce J. Weimer, MD wrote:

> I'm trying to get a capi:slider into an application, but I don't 
> understand how to access the slider's value - the "reader" is
>  
>  capi:slider-show-value-p
>  
> but I don't know how to use that in my (simplified) example:
>  
>  
>  
> (defun remote ()
>   (capi:display (make-instance 'button-test
>                       :window-styles '(:always-on-top
>                                        :borderless
>                                        :hides-on-deactivate)
>                       :x 200
>                       :y 200
>                       :title "Button Test")))
>  
>  
>  
> (capi:define-interface button-test ()
>   ()
>   (:panes
>    (slider-1
>     capi:slider
>     :title "Distance"
>     :start 0
>     :end 1000)))
>  
>
> ;capi:slider-show-value-p ????
>  
>  
>  
> Thanks as always for your patience!
>  
> Bruce.
>
>  



Updated at: 2020-12-10 08:49 UTC