PDA

View Full Version : Question about windowlists



rmilmine
March 15th, 2026, 18:30
I have a windowlist defined as follows:



<windowlist name="groupslist">
<anchored>
<top anchor="bottom" parent="groupslist_heading_name_label" offset="-1" />
<left anchor="left" parent="groups_label" offset="-10" />
<right anchor="right" parent="groups_label" offset="10" />
<bottom anchor="bottom" />
</anchored>
<frame name="metalplate" />
<child>
<frame name="groupbox"/>
</child>
<class>skill_main_group_item</class>
<datasource>.groupslist</datasource>
<allowcreate />
<allowdelete />
<ownedonly />
<script>
function onInit()
if super and super.onInit then
super.onInit();
end
window.update();
end

function update()
for _,w in ipairs(getWindows()) do
w.update();
end
end
</script>
</windowlist>


Everything looks fine, except when the window the windowlist is on changes size or the number of items in the list is larger than the area given to the windowlist.
If the containing window is made smaller, then the frames around the child items in the windowlist end up going outside of the window list area.
Only the frame is going outside of the normal viewing area, the other items in the child window are disappearing as they go outside the proper viewing area.

I've tried finding a question about this, but not found one. This has to have been asked before on how to fix this.

Another question. The space between list items, how do I make it smaller?

Moon Wizard
March 15th, 2026, 18:44
For the bleed over on child windows, we've seen this in some cases; but haven't been able to resolve. It appears to be related to the Unity layout code triggering after we've set clipping, even though it's not supposed to and doesn't give us any events that it has. It's because we have to do custom clipping, since the Unity clipping only supports a few levels of clipping and we need an unknown number based on ruleset definitions (up to 20+ in some situations, which Unity doesn't handle natively). Usually changing around the layout some reduces incidence.

Also, I would highly suggest using the layout templates for windows that automatically handle standard top-to-bottom layouts for top-level windows; and side-to-side layouts for list item windows. Lots of examples in CoreRPG and 5E coding. (Just search for "list_content_" in those rulesets; and look at the anchor_content_<framename>_top/anchor_content_<framename>_bottom for top-level windows and anchor_content_top/anchor_content_bottom for subwindows) Lots of templated options there allow you to just define in downward order.

For the space between windows; this is completely defined by you. There is no spacing between child windows. Try adding "border" frame to your child windows temporarily to see exactly where their edges lie. More than likely you have added extra padding at top and/or bottom of your child windows (perhaps to accomodate frames or other elements).

Regards,
JPG

rmilmine
March 15th, 2026, 19:39
I am using the npc and quest window from corerpg as the basics on how to setup the window I'm working on.

The object I want to store in the window has possible groups and subgroups. So a list of items with a name and number as data. Each group also has a possible list of subgroups with a name and number as data.

The border frame did wonders for me being able to see the space being used and it now makes more sense on what I'm seeing.

So that I understand the templates for anchors.

If I have the following window classes:

skills
skills_header
skills_main

I would put anchor_content_framename_top/anchor_content_framename_bottom on skills and anchor_content_top/anchor_content_bottom would go on the skills_main window?

I'm looking at what you suggested. Lots of dig through, but I'll keep looking till it's not mud.

Thanks for the direction.

Moon Wizard
March 16th, 2026, 00:10
Post the top level window XML first; and we can go over that.

Regards,
JPG

rmilmine
March 16th, 2026, 16:46
<windowclass name="skill" copy="record_window" />
<windowclass name="skill_header" copy="record_header" />


So there is already



<anchor_content_recordsheet_top name="contentanchor" />
<anchor_content_recordsheet_bottom name="bottomanchor" />


in the skill window class.

Moon Wizard
March 16th, 2026, 17:34
Can you post the window class for "skill_main" next?

Thanks,
JPG

rmilmine
March 16th, 2026, 18:28
skills_main



<windowclass name="skill_main">
<placement>
<size height="807" width="390" />
</placement>
<script file="campaign/scripts/skill_main.lua"/>
<sheetdata>
<anchor_content_top />
<anchor_content_bottom />
<anchor_column name="columnanchor" />
<label_column name="category_label">
<static textres="skill_main_category_label" />
<readonly />
</label_column>
<combobox_column name="category">
<frame name="fieldlight" offset="7,5,7,5" />
<parameters>
<labelsres>skill_main_category_Label_Agility|skill_main_categ ory_Label_Background|skill_main_category_Label_Com bat|skill_main_category_Label_Intellect|skill_main _category_Label_Interaction</labelsres>
<values>agility|background|combat|intellect|interaction</values>
</parameters>
<script>
function onValueChanged()
window.update();
end
</script>
</combobox_column>
<label_column name="subcategory_label">
<static textres="skill_main_subcategory_label" />
<readonly />
</label_column>
<combobox_column name="subcategory_agility">
<frame name="fieldlight" offset="7,5,7,5" />
<parameters>
<labelsres>skill_main_subcategory_Label_Familiarity|skill_mai n_subcategory_Label_Proficiency|char_label_dexteri ty</labelsres>
<values>familiarity|proficiency|dexterity</values>
</parameters>
<script>
function onValueChanged()
window.update();
end
</script>
</combobox_column>
<combobox_column name="subcategory_background">
<frame name="fieldlight" offset="7,5,7,5" />
<parameters>
<labelsres>skill_main_subcategory_Label_Characteristic|skill_ main_subcategory_Label_Grouped</labelsres>
<values>characteristic|grouped</values>
</parameters>
<script>
function onValueChanged()
window.update();
end
</script>
</combobox_column>
<combobox_column name="subcategory_intellect">
<frame name="fieldlight" offset="7,5,7,5" />
<parameters>
<labelsres>skill_main_subcategory_Label_Familiarity|skill_mai n_subcategory_Label_Proficiency|char_label_intelli gence</labelsres>
<values>familiarity|proficiency|intelligence</values>
</parameters>
<script>function onValueChanged()
window.update();
end
</script>
</combobox_column>
<combobox_column name="subcategory_interaction">
<frame name="fieldlight" offset="7,5,7,5" />
<parameters>
<labelsres>skill_main_subcategory_Label_Familiarity|skill_mai n_subcategory_Label_Proficiency|char_label_presenc e</labelsres>
<values>familiarity|proficiency|presence</values>
</parameters>
<script>function onValueChanged()
window.update();
end
</script>
</combobox_column>
<label_column name="has_subname_label">
<static textres="skill_main_has_subname_label" />
<readonly />
</label_column>
<button_checkbox_column name="has_subname" source="has_subname">
<script>
function onInit()
if super and super.onInit then
super.onInit();
end
end
function onValueChanged()
if super and super.onValueChanged then
super.onValueChanged();
end
window.update();
end
</script>
</button_checkbox_column>
<label_column name="subname_label">
<static textres="skill_main_subname_label" />
<readonly />
</label_column>
<string_column name="subname">
<controlline />
<lineoffset>-2</lineoffset>
</string_column>
<label_column name="characteristic_label">
<static textres="skill_main_subcategory_Label_Characteristic" />
<readonly />
</label_column>
<combobox_column name="characteristic">
<frame name="fieldlight" offset="7,5,7,5" />
<parameters>
<labelsres>char_label_intelligence|char_label_dexterity|char_ label_strength|char_label_presence|char_label_ego| char_label_constitution</labelsres>
<values>intelliegence|dexterity|strength|presence|ego|cons titution</values>
</parameters>
</combobox_column>
<header_column name="cost_label">
<static textres="cost_label" />
<readonly />
</header_column>
<label_column name="familiarity_cost_label">
<static textres="skill_main_subcategory_Label_Familiarity" />
<readonly />
</label_column>
<number_column name="familiarity_cost">
<min>0</min>
<default>1</default>
</number_column>
<label_column name="proficiency_cost_label">
<static textres="skill_main_subcategory_Label_Proficiency" />
<readonly />
</label_column>
<number_column name="proficiency_cost">
<min>0</min>
<default>2</default>
</number_column>
<label_column name="base_cost_label">
<static textres="skill_main_base_cost_label" />
<readonly />
</label_column>
<number_column name="base_cost">
<min>0</min>
<default>2</default>
</number_column>
<label_column name="base_increase_cost_label">
<static textres="skill_main_increase_cost_label" />
<readonly />
</label_column>
<number_column name="base_increase_cost">
<min>0</min>
<default>1</default>
</number_column>
<label_column name="characteristic_cost_label">
<static textres="skill_main_subcategory_Label_Characteristic" />
<readonly />
</label_column>
<number_column name="characteristic_cost">
<min>0</min>
<default>3</default>
</number_column>
<label_column name="characteristic_increase_cost_label">
<static textres="skill_main_increase_cost_label" />
<readonly />
</label_column>
<number_column name="characteristic_increase_cost">
<min>0</min>
<default>2</default>
</number_column>
<header_column name="groups_label">
<static textres="skill_main_groups_label" />
<readonly />
</header_column>
<button_iedit name="groupslist_iedit">
<anchored>
<top anchor="top" parent="groups_label" height="30" />
<right anchor="right" parent="groups_label" width="30" />
</anchored>
<target>groupslist</target>
<script>
function onValueChanged()
if super and super.onValueChanged then
super.onValueChanged();
end
window.update();
end

</script>
</button_iedit>
<button_iadd name="groupslist_iadd">
<anchored>
<right anchor="left" parent="groupslist_iedit" offset="-5" width="30" />
<top anchor="top" parent="groupslist_iedit" height="30" />
</anchored>
<target>groupslist</target>
</button_iadd>

<label name="groupslist_heading_name_label">
<anchored width="200">
<left parent="groups_label" offset="20" />
<top anchor="bottom" parent="groups_label" offset="12" />
</anchored>
<static textres="name_label" />
<readonly />
</label>

<label name="groupslist_heading_cost_label">
<anchored width="100">
<top parent="groups_label" anchor="bottom" offset="12" />
<right parent="groups_label" anchor="right" offset="15" />
</anchored>
<static textres="cost_label" />
<readonly />
</label>

<windowlist name="groupslist">
<anchored>
<top anchor="bottom" parent="groupslist_heading_name_label" offset="-1" />
<left anchor="left" parent="groups_label" offset="-10" />
<right anchor="right" parent="groups_label" offset="10" />
<bottom anchor="bottom" parent="bottomanchor" />
</anchored>
<frame name="border" />
<child>
<frame name="border"/>
</child>
<class>skill_main_group_item</class>
<datasource>.groupslist</datasource>
<allowcreate />
<allowdelete />
<ownedonly />
<script>
function onInit()
if super and super.onInit then
super.onInit();
end
window.update();
end

function update()
for _,w in ipairs(getWindows()) do
w.update();
end
end
</script>
</windowlist>
<scrollbar_list>
<anchored to="groupslist" />
<target>groupslist</target>
</scrollbar_list>
</sheetdata>
</windowclass>


And thanks for looking at this,
Robert

Moon Wizard
March 16th, 2026, 19:37
Some comments:

placement.size is only needed for top-level windows (i.e. "skill")
labels are readonly by default; no need to re-specify
columnanchor and templates without "*_content_*" are an older model; the new ones have more options and work better across more situations.
source attribute is not required if the same as the name attribute


Here's code using the new templates cleaned up. I wasn't able to test fully without all the pieces; so please excuse any syntax errors or XML tag errors.
Also, I guessed on the label placement over the groups list; since I usually tie those templates to the exact same templates used in the child list item window.
(You can find examples in "charsheet_inventory" window in CoreRPG; or by searching over other included rulesets.)

Regards,
JPG



<windowclass name="skill_main">
<script file="campaign/scripts/skill_main.lua"/>
<sheetdata>
<anchor_content_top />
<anchor_content_bottom />

<label_content_column name="category_label">
<static textres="skill_main_category_label" />
</label_content_column>
<combobox_content_column name="category">
<parameters>
<labelsres>skill_main_category_Label_Agility|skill_main_categ ory_Label_Background|skill_main_category_Label_Com bat|skill_main_category_Label_Intellect|skill_main _category_Label_Interaction</labelsres>
<values>agility|background|combat|intellect|interaction</values>
</parameters>
<script>
function onValueChanged()
window.update();
end
</script>
</combobox_content_column>

<label_content_column name="subcategory_label">
<static textres="skill_main_subcategory_label" />
</label_content_column>
<combobox_content_column name="subcategory_agility">
<parameters>
<labelsres>skill_main_subcategory_Label_Familiarity|skill_mai n_subcategory_Label_Proficiency|char_label_dexteri ty</labelsres>
<values>familiarity|proficiency|dexterity</values>
</parameters>
<script>
function onValueChanged()
window.update();
end
</script>
</combobox_content_column>
<combobox_content_column name="subcategory_background">
<parameters>
<labelsres>skill_main_subcategory_Label_Characteristic|skill_ main_subcategory_Label_Grouped</labelsres>
<values>characteristic|grouped</values>
</parameters>
<script>
function onValueChanged()
window.update();
end
</script>
</combobox_content_column>
<combobox_content_column name="subcategory_intellect">
<parameters>
<labelsres>skill_main_subcategory_Label_Familiarity|skill_mai n_subcategory_Label_Proficiency|char_label_intelli gence</labelsres>
<values>familiarity|proficiency|intelligence</values>
</parameters>
<script>
function onValueChanged()
window.update();
end
</script>
</combobox_content_column>
<combobox_content_column name="subcategory_interaction">
<parameters>
<labelsres>skill_main_subcategory_Label_Familiarity|skill_mai n_subcategory_Label_Proficiency|char_label_presenc e</labelsres>
<values>familiarity|proficiency|presence</values>
</parameters>
<script>
function onValueChanged()
window.update();
end
</script>
</combobox_content_column>

<label_content_column name="has_subname_label">
<static textres="skill_main_has_subname_label" />
</label_content_column>
<button_checkbox_content_column name="has_subname">
<script>
function onValueChanged()
if super and super.onValueChanged then
super.onValueChanged();
end
window.update();
end
</script>
</button_checkbox_content_column>

<label_content_column name="subname_label">
<static textres="skill_main_subname_label" />
</label_content_column>
<string_content_column name="subname" />

<label_content_column name="characteristic_label">
<static textres="skill_main_subcategory_Label_Characteristic" />
</label_content_column>
<combobox_content_column name="characteristic">
<parameters>
<labelsres>char_label_intelligence|char_label_dexterity|char_ label_strength|char_label_presence|char_label_ego| char_label_constitution</labelsres>
<values>intelliegence|dexterity|strength|presence|ego|cons titution</values>
</parameters>
</combobox_content_column>

<header_content_framed_headersimple name="cost_label">
<static textres="cost_label" />
</header_content_framed_headersimple>

<label_content_column name="familiarity_cost_label">
<static textres="skill_main_subcategory_Label_Familiarity" />
</label_content_column>
<number_content_column name="familiarity_cost">
<min>0</min>
<default>1</default>
</number_content_column>

<label_content_column name="proficiency_cost_label">
<static textres="skill_main_subcategory_Label_Proficiency" />
</label_content_column>
<number_content_column name="proficiency_cost">
<min>0</min>
<default>2</default>
</number_content_column>

<label_content_column name="base_cost_label">
<static textres="skill_main_base_cost_label" />
</label_content_column>
<number_content_column name="base_cost">
<min>0</min>
<default>2</default>
</number_content_column>

<label_content_column name="base_increase_cost_label">
<static textres="skill_main_increase_cost_label" />
</label_content_column>
<number_content_column name="base_increase_cost">
<min>0</min>
<default>1</default>
</number_content_column>

<label_content_column name="characteristic_cost_label">
<static textres="skill_main_subcategory_Label_Characteristic" />
</label_content_column>
<number_content_column name="characteristic_cost">
<min>0</min>
<default>3</default>
</number_content_column>

<label_content_column name="characteristic_increase_cost_label">
<static textres="skill_main_increase_cost_label" />
</label_content_column>
<number_content_column name="characteristic_increase_cost">
<min>0</min>
<default>2</default>
</number_content_column>

<header_content_framed_headersimple name="groups_label">
<static textres="skill_main_groups_label" />
</header_content_framed_headersimple>
<button_iedit name="groupslist_iedit">
<anchored to="groups_label" position="insidetopright" offset="-5,0" />
<target>groupslist</target>
<script>
function onValueChanged()
if super and super.onValueChanged then
super.onValueChanged();
end
window.update();
end
</script>
</button_iedit>
<button_iadd name="groupslist_iadd">
<anchored to="groupslist_iedit" position="lefthigh" offset="5,0" />
<target>groupslist</target>
</button_iadd>


<list_content_labeled_top name="groupslist">
<class>skill_main_group_item</class>
<datasource>.groupslist</datasource>
<allowcreate />
<allowdelete />
<script>
function update()
for _,w in ipairs(getWindows()) do
w.update();
end
end
</script>
</list_content_labeled_top>

<anchor_list_content_label_left />
<anchor_list_content_label_right />

<spacer_list_content_label_left>
<anchored width="20" />
</spacer_list_content_label_left>
<label_list_content_string_left name="groupslist_heading_name_label">
<anchored width="200" />
<static textres="name_label" />
</label_list_content_string_left>

<spacer_list_content_label_left>
<anchored width="15" />
</spacer_list_content_label_left>
<label_list_content_number_right name="groupslist_heading_cost_label">
<anchored width="100" />
<static textres="char_label_weighttotal" />
<tooltip textres="char_label_weighttotal_tooltip" />
</label_list_content_number_right>
</sheetdata>
</windowlist>

rmilmine
March 17th, 2026, 07:05
When I try using what you gave, only one typo to fix, there is error about anchoring to a non-existing control.

I looked for and expected template with the name in the error message, "labelleftanchor"

What I found was the following:



<template name="anchor_list_content_label_left">
<genericcontrol name="labelleftanchor">
<anchored to="list" position="aboveleft" offset="0,0" height="20" width="0" />
</genericcontrol>
</template>
<template name="anchor_list_content_label_right">
<genericcontrol name="labelrightanchor">
<anchored to="list" position="aboveright" offset="0,0" height="20" width="0" />
</genericcontrol>
</template>


So these two templates are expecting to anchor to a control called "list".

What I found in record_char_inventory was:



<anchor_list_content_label_left>
<anchored to="inventorylist" />
</anchor_list_content_label_left>


Which suggested what I needed to change.

problem is as soon as I add a frame to the list, or the children on the list the same thing happens with the frames showing up when they shouldn't.
The main window doesn't need to change size, if the list is bigger than the given display area then the frames for the items off the bottom of the window are drawn.

Is there another way that I could separate list items?

I'm also looking at the contents of the child, may be there is something in it that is causing the frame to display outside the viewable area.

Moon Wizard
March 17th, 2026, 17:53
Yes, you already found you needed to adjust the list label anchors. I forgot to do that; since the default is to just use "list" for the name, unless there are multiples.

For the frame. If you're matching the other ruleset layouts; there is no frame on the majority of lists. I'm not even sure if I'm envisioning what you are trying to do. Maybe a screen clip could help show what you are trying to do, even if it doesn't look right yet?

Regards,
JPG

rmilmine
March 18th, 2026, 21:09
Sorry it took so long to get back to you.
I spent some time editing the list items so that they used what you had suggested as does the sublist now.

Here is a screen shot of the area of the window with the groups and subgroups.

66832

The first group name has 3 subgroup names.
The headings group name and cost are a little off, but this is how it looks with out the frames.

I edited the whole thing so that the groups, list headings and list are in a subwindow, and the subgroups, subheadings and sublist are in another subwindow.
Unfortunately they also have the frames show up outside of the window.
I just finished editing it to use the subwindow.
I could move the sublist in on the left and right so that it's more distinctive visually from the rest.

Without the frames it has no display issue when the window resizes.