relative sizes in gs-commandos

Started by didi, July 18, 2007, 11:18:33 AM

Previous topic - Next topic

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

#1
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

#2
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

#3
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

#4
QuoteIt 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

#5
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

#6
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

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



Lutz