[gtk-server] Re: clisp, gtk-server & glade-2.10

  • From: Jim Bailey <sleepydgym@xxxxxxxxx>
  • To: gtk-server@xxxxxxxxxxxxx
  • Date: Fri, 5 May 2006 09:39:38 -0700 (PDT)

Hi Peter, hi Alain.

Sorry for taking so long to step in, I'm travelling
around on holiday at the moment and internet access
and time have been scarce.

It has been a very long while since I looked at the
clisp-gtk2 stuff as I never actually found a use for
it myself, so I am a bit rusty on what I did.
gtk-server looks like it has come on leaps and bounds
since then, great work Peter. What you say about the
floating types is interesting, if gtk1 uses
single-floats exclusively and gtk2 uses double-floats
then my gtk.lisp needs to be updated.

The simplest fix (if you know you are going to use
gtk2, which is the sort of thing you should know up
front really) is to change the type conversion in
(read-gtk-server-cfg) so that float is mapped onto
'double-float.

If you then coerce gtk_hscale_new_with_range's
parameters to 'double-float everything seems to work
as  it should.

I hope that helps, if not, give me a shout.

Cheers,
Jim


--- Peter van Eerten <administrator@xxxxxxxxxxxxxx>
wrote:

> Hi,
> 
> This line with GtkScript actually does create a
> scale with float intervals:
> 
> range$ = gtk_hscale_new_with_range(0.5, 1.5, 0.1)
> 
> Or with newLISP:
> 
> (set 'range (gtk "gtk_hscale_new_with_range" 0.5 1.5
> 0.1))
> 
> 
> The range appears without any problem, and has float
> intervals with a step of
> 0.1. Attached a screenshot. Therefore I think your
> issue is not GTK-server
> related but CLisp related. Please verify that CLisp
> really is sending float
> values, and not strings or integers.
> 
> (Unfortunately I am not sure how this works in
> CLisp. Maybe you better contact
> the original author of the CLisp GTK package you are
> using, which is Jim
> Bailey.)
> 
> Regards
> Peter
> 
> 
> Citeren CLisp <card.lemoine@xxxxxxxxxx>:
> 
> > Thank you.
> >
> > Le Mardi 2 Mai 2006 08:41, Peter van Eerten a
> écrit :
> > > Hi,
> > >
> > > The function "gtk_hscale_new_with_range ()" is
> defined in the example
> > > gtk-server configfile which is shipped by the
> package.
> >
> > Indeed it is, I don't know where to put myself. I
> must have downloaded many
> > config files at the beginning of my interest for
> gtk-server and not installed
> > the one which belongs to this package. Anyway the
> line is correct. I put my
> > ".gtk-server.cfg" file in attachment.
> > >
> > > When you define to read GTK 1.x libraries, the
> FLOAT keyword in the
> > > configfile will be interpreted as a single
> float, since GTK 1 uses single
> > > floats solely.
> > >
> > > When you define the configfile to read GTK 2.x
> libraries, the FLOAT keyword
> > > is interpreted to a double float.
> > OK
> > >
> > > So it should be working out of the box. So which
> libraries did you define
> > > exactly?
> > >
> > GTK_LIB_NAME = libgtk-x11-2.0.so
> > GDK_LIB_NAME = libgdk-x11-2.0.so
> > GLIB_LIB_NAME = libglib-2.0.so
> > GTK_LIB_EXTRA = libgdk_pixbuf_xlib.so
> > > Also, could you provide me the following:
> > >
> > > 1) your definitions in the configfile
> > > 2) the LISP code which does not seem to work
> correctly.
> > Here is the code I thought to have to add (Please
> keep in mind that I'm a new
> > comer in lisp) :
> > In the (case clas ... :
> > <<
> >       (|GtkHScale|
> >        (let ((adjust
> >               (get-mult-prop-values
> >                (get-strm-mult-prop "adjustment" props) ())))
> >          (setq new-widget
> >                (gtk_hscale_new_with_range
> >                 (coerce (cadr adjust) 'float)
> >                 (coerce (caddr adjust) 'float)
> >                 (coerce (cadddr adjust) 'float)))))
> > >>
> > In the early defuns section :
> > <<
> > (defun get-strm-mult-prop (prop-name props)
> >   (setq strm-prop (make-string-input-stream
> >                 (gethash prop-name props 0))))
> >
> > (defun get-mult-prop-values (strm-prop list-prop)
> >       (if (not (listen strm-prop))
> >       list-prop
> >       (get-mult-prop-values
> >        strm-prop (cons (read strm-prop)
> list-prop))))
> >
> > Please find the concerned files in the tarbal
> attached
> > Regards
> > >>
> > > Thanks,
> > > Peter
> > >
> > > Citeren CLisp <card.lemoine@xxxxxxxxxx>:
> > > > Hello,
> > > >
> > > > I have tried the Jim Bailey's package that is
> mentionned at the end of
> > > > the Mac Carter documentation page which is
> devoted to gtk-server and
> > >>>>>>>>>>>>>>>...
> >
> 
> 
> -- 
> http://www.gtk-server.org


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Other related posts: