How to delete rows,columns and table's?

Guiserver, GTK-server, OpenGL, PostScript,
HTML 5, MIDI, IDE

How to delete rows,columns and table's?

Postby fdb » Mon Dec 16, 2013 10:00 pm

How can i delete rows and/or columns in a gs:table? there seems to be only the option to add them..or am i missing something? Furthermore i cannot delete a gs:table when i try to do so with gs:dispose i get the message
dispose cannot be applied to MAIN:row-table
fdb
 
Posts: 34
Joined: Sat Nov 09, 2013 8:49 pm

Re: How to delete rows,columns and table's?

Postby Lutz » Tue Dec 17, 2013 2:47 pm

Only entire containers created with gs:window, gs:frame and gs:dialog can be used with gs:dispose - this has now been added to the documentation.

At the moment there is no API to delete table rows or columns. For other dialog components use gs:remove-from, or use gs:delete-tag to remove 2D drawn objects.

Se also: http://www.newlisp.org/guiserver/guiserver.lsp.html
Lutz
 
Posts: 5258
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: How to delete rows,columns and table's?

Postby fdb » Tue Dec 17, 2013 6:04 pm

Thx for the reply, i'll dispose the frame and rebuilt it after i've recalculated the UI.

I also saw there seemed to be no option to have a table without column headers, but you can actually achieve this with an empty string "" as the column header so
Code: Select all
(gs:table 'row-table 'gs:no-action "" "")
will give you a table with two columns but you don't see the column header.
fdb
 
Posts: 34
Joined: Sat Nov 09, 2013 8:49 pm

Re: How to delete rows,columns and table's?

Postby Lutz » Tue Dec 17, 2013 8:41 pm

Currently when adding columns using gs:table-add-column, the column number will be added as a label when specifying an empty string.

In the next version of guiserver.jar the header will be suppressed if an empty string is used with gs:table-add-column. This will make it possible to add columns to header-less tables created with a gs:table statement using empty string headers.

See: http://www.newlisp.org/downloads/develo ... nprogress/
Lutz
 
Posts: 5258
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: How to delete rows,columns and table's?

Postby fdb » Tue Dec 17, 2013 9:20 pm

Great! Are you also planning to add the ability to delete rows and columns? At the moment i dispose the frame and then recalc and recreate the frame , which doesn't matter too much because i have to recalc all the tables (6) anyway but it does of course means flickering.
fdb
 
Posts: 34
Joined: Sat Nov 09, 2013 8:49 pm

Re: How to delete rows,columns and table's?

Postby fdb » Mon Dec 23, 2013 1:05 am

Hi , i've added the ability to delete rows and columns in a table in a build i made in 10.5.4
I have added the following methods to Dispatcher.java:
Code: Select all
methods.put("table-remove-row", "tableRemoveRow"); //deleting of a row
methods.put("table-set-column-name", "tableSetColumnIdentifiers");//add/delete/update
methods.put("table-set-rows", "tableSetRowCount"); //adding /deleting rows

and implemented them in TableWidget.java.

Then i've coded the new functions in newlisp in guiserver.lsp.
After compiling the java stuff and make /make build, everything seems to work!

I was surprised how easy this was and am very impressed by the documentation and the clean code, everything 'just works' ;-)

Be aware that i'm not a professional programmer so who knows what errors I made but if Lutz is interested i'll be more then happy to share my code to include this in future versions.
fdb
 
Posts: 34
Joined: Sat Nov 09, 2013 8:49 pm

Re: How to delete rows,columns and table's?

Postby Lutz » Mon Dec 23, 2013 2:51 pm

Thanks very much fdb.

You can package TableWidget.java, guiserver.lsp and table-demo.lsp into a .zip or a .tgz file and mail it to me at lutz@nuevatec.com or publish the files else if you prefer.

Keep the description in guiserver.lsp short but add buttons and input to table-demo.lsp showing the new functionality. This way people have an example to work off and it also can be used to test the new functionality.
Lutz
 
Posts: 5258
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California

Re: How to delete rows,columns and table's?

Postby abaddon1234 » Wed Feb 24, 2016 8:21 am

abaddon1234
 
Posts: 21
Joined: Mon Sep 14, 2015 3:09 am


Return to newLISP Graphics & Sound

Who is online

Users browsing this forum: No registered users and 3 guests

cron