relative sizes in gs-commandos

Guiserver, GTK-server, OpenGL, PostScript,
HTML 5, MIDI, IDE
Locked
didi
Posts: 166
Joined: Fri May 04, 2007 8:24 pm
Location: Germany

relative sizes in gs-commandos

Post by didi »

It's real fun to program with the newLISP-gui-server :-) and the resulting source is really short . I would get rid of some ugly lines with a construct like this:
( gs:myframe xorg 10% yorg 10% xwidth 80% yheight 80% )

Instead of absolut-graphic-sizes relative sizes would be great .
eg. here relative to the screen, but relative to the canvas and so on would also be helpful ...
I think this could be my first case for a macro - the % sign is a bit luxury but easier to understand - don't know if it will cost too much .
Is it possible to make gs:xxxx macros ?

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Yes, of course you can make macros from gs:xxx functions, just like you would with any other function. In some cases you may even want to modify/extend/rewrite an exisiting gs:xxx function to your own purpose.

Look into the source of guiserve.lsp and you will see that the guiserver.lsp layer is just a very thin wrapper to hide network communications from the user.

When you use 'map' or 'apply' on a gs:xxx function always prefix it with a quote, like in (apply 'gs:button ParamList). In most cases omitting the quote will do no harm, but if symbol translation/creation is performed this makes sure that the applied or mapped gs:xxx function gets executed inside the gs context.

Lutz

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

I would love to see what you and others are programming with guiserver. Perhaps you can post some screen shots for everybody to look at (or even some code?) ;-)

Lutz

didi
Posts: 166
Joined: Fri May 04, 2007 8:24 pm
Location: Germany

Post by didi »

Thanks Lutz for your fast answer and help !

Sure i'd be happy to show the code and pictures .
.. in a few days , i don't want to blame me ;-)

BTW:
It seems that the newlisp-edit files are non-standard text now - or is there an option save-as *.txt ?

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

It seems that the newlisp-edit files are non-standard text now - or is there an option save-as *.txt
When I save a test-file I get a standard text file.
So what is non-standard?
Hans-Peter

didi
Posts: 166
Joined: Fri May 04, 2007 8:24 pm
Location: Germany

Post by didi »

When i open it with Word it's ok , when i open it with notepad.exe there are no lines , all is in one line and the cr-lf are shown as squares .
Older files do not have this.

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

the current version writes back line-feed only as line terminators (like on Mac OX X and other UNIX). The next version will again add the carriage returns on output when on Win32, and has also some remarks about the whole LF-CR thing in the changes notes.


Lutz

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

... all should be fine in today's released development version 9.1.9 (guiserver v0997)

Lutz

Locked