Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - maurizio.ferreira

#1
The problem seems related to the number of items, and appears if them don't fill completely the grid or if

its number exceed the grid capacity.

It seems that the layout ignores the number of colums you specify while it respects the number of rows,

and that it adjust the number of colums so that it's able to display all the added elements.



In the following program, e.g. if you set 'number to a value below 13 or above 15, the grid becomes, rispectively of 3 * 4 and 3 * 6

If you set the number as 100, the grid becomes of 34 columns, with 2 empty cells.

If you set rows 7 and num 8, you get two columns, with the first 4 rows filled, and other 3 rows empty.



In other words it seems that cols becomes (/ (+ num rows -1 ) rows )



I'm not trying to dispraise NewLisp, (it's wonderful !)

I'm just experimenting with its layout capabilities.



Best regards.

Maurizio.




(set-locale "C")
(load (append (env "NEWLISPDIR") "/guiserver.lsp"))

(gs:init)

(gs:frame 'GridDemo 100 100 300 200 "panels in a grid")
(set 'rows 3 'cols 5 'num 16)
(gs:set-grid-layout 'GridDemo rows cols)

(dotimes (i num)
   (set 'id (sym (string "P" i)))
   (gs:panel id)
   (gs:set-background id (list (random) (random) (random)))
   (gs:add-to 'GridDemo id)
)

(gs:set-visible 'GridDemo true)
(gs:listen)