PDA

View Full Version : Windowlist, creating a "window" on initialization?



celestian
November 21st, 2020, 07:19
What would cause a windowlist to create a object on initializations?

The one thing I could think of would be <createonempty /> but that is not in the windowlist. This windowlist does not have a database/datasource.

Not sure how useful this will be but here is the entry.



<windowlist name="filterlist" >
<anchored>
<top anchor="top" offset="25" />
<left anchor="left" offset="5" />
<right offset="-20" />
<bottom anchor="bottom" offset="-25" />
</anchored>
<frame name="sheetgroup" offset="2,2,2,2" />
<child></child>
<child><backcolor>4040301E</backcolor></child>
<allowcreate />
<allowdelete />
<empty font="list-empty" gmtextres="filter_npc_emptylist" />
<class>safari_filter_item</class>
<sortby><control>filtertype</control></sortby>
</windowlist>


This seems to create a item in the windowlist. The only "createWindow()" for this windowlist is a button press, not an onInit.

For completeness here is the button.



<button_text_sm name="addfilter">
<anchored width="60">
<top anchor="top" offset="5" />
<left anchor="left" offset="5" />
</anchored>
<state textres="button_addfilter_text" />
<tooltip textres="button_addfilter_tooltip" />
<script>
function onButtonPress()
local win = window.filterlist.createWindow();
local aTypes = ManagerSafari.getKeys(win.filtertype.getItems());
win.filtertype.setValue(aTypes[1])
end
</script>
</button_text_sm>

Moon Wizard
November 22nd, 2020, 00:29
Non-database-bound window lists automatically create an empty entry unless you specify the "<skipempty />" tag.

Regards,
JPG

celestian
November 22nd, 2020, 00:51
Non-database-bound window lists automatically create an empty entry unless you specify the "<skipempty />" tag.

Regards,
JPG

Ah! Thanks, I was hoping I had missed something.