Thread: category selection control
-
August 14th, 2011, 09:15 #1
category selection control
Is there any method that can be used to count the number of categories present in a windowlist?
I would like to be able to resize the window so that all category tabs are always displayed when the containing window is opened - currently it is not always obvious that there are extra tabs that are hidden off the edge of the window.
-
August 14th, 2011, 11:14 #2
How about looping through the database nodes using ipairs and count/comparing the category nodes e.g.
Code:local count = 0; for k,v in pairs (getDatabaseNode().getChildren()) do if v.getName() == "category" then count = count + 1; end end
FG Project Development
Next Project(s)*: Starfinder v1.2 Starship Combat
Current Project: Starfinder v1.1 - Character Starships
Completed Projects: Starfinder Ruleset v1.0, Starfinder Core Rulebook, Alien Archive, Paizo Pathfinder Official Theme, D&D 5E data updates
* All fluid by nature and therefore subject to change.
-
August 14th, 2011, 11:40 #3
Hi DrZ thanks for the reply.
I tried something similar before, but it appears category nodes are not counted as children. The above would return 0
if you do something like print(DB.findNode("encounter").getChildCount())
the number returned matches the number of encounters the categories appear to be ignored.
-
August 14th, 2011, 12:16 #4
Hmm, not sure then. I guess you would have to request an API change. i.e. something like access methods for windowlists like
- getCategories() returns a table of strings
- getCategoryCount() returns integer count of categoriesFG Project Development
Next Project(s)*: Starfinder v1.2 Starship Combat
Current Project: Starfinder v1.1 - Character Starships
Completed Projects: Starfinder Ruleset v1.0, Starfinder Core Rulebook, Alien Archive, Paizo Pathfinder Official Theme, D&D 5E data updates
* All fluid by nature and therefore subject to change.
-
August 14th, 2011, 12:21 #5
Yeah thats what I figured, but I think M_W probably has enough on his plate without working on something with such limited use.
I just wondered if anyone had found a workaround.
Its not really a big issue.
anyway thanks for your help.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks