ID:273445
![]() May 6 2010, 12:51 am
|
|
I was wondering if it would be possible to display checkboxes in a grid. Say for example, I want to display all my inventory in a grid, with a checkbox assigned to each of them. Then have a button that will delete all of the checked items from my inventory.
|
I just got around to trying out this method, and I quite like it. One issue I am having just now though is that the icon_state of the selection object does not display in the grid without updating the entire grid, thus resetting your selections.
|
Oh, right. You shouldn't need to update the entire thing, just give each selection obj some variables that tell it where in the grid it is (a text string should work), and update that cell in its Click() proc.
|
A better option is to just have a "selection" object, like so:
So, the 'selection.dmi' would just have either a border or a background that would toggle between, say, black ("unselected") and green ("selected"). You would call start_selection() on some list (like start_selection(contents)) and then end_selection() when the player is finished, which will give you a list of the objs they selected.