$Width "isn't inherited" but it does take initial value from prototype?

I’m confused about $Width. TBX Reference says this: “… $Width and $Height are also not inherited. … Newly-created notes take their initial $Height and $Width from their prototype.”

That H and W are NOT “inherited” but DO take initial values from the prototype can only mean that “inherit” here means inheritance AFTER the notes have been created and have set the initial value. But now I’m confused; all of my new notes have a value of 3 even when their prototype has a different value. (To eliminate the possibility of interference from some unseen influence, I tested this in a new file and got the same result.)

Can someone please clarify?

1 Like

Well, having after considerable attempts at a solution and then finally posting a question, I’m embarrassed to say that I’ve come up with one way to make the prototype’s value take effect with new notes. Until now, I had only entered the $Width value in the KA in the prototype. (I still don’t understand why that doesn’t work.) The solution I came up with is to make the default value a rule, i.e, $Width=“10”;

But I would still like to understand what TBX Reference is saying about inheritance and initial values.

Hmm, I wrote that a long while back and (a) it’s poorly phrased and (b) the app has changed slightly since. I’ve now struck that sentence. It used to be that in the app or doc preferences you could set the defaults (for example in v5), but that is now gone. All new notes get the same width/height according to the default values for $Width and $Height. You can alter that on a per-TBX doc basis via the System tab of the Document Inspector. For that you need to select the desired attribute on that Inspector, e.g. $Width, and then alter the default to the desired value. That change affects only new notes made after the change.

IF you re-read the part of the article of prototypes (before the sentence quoted) it explains why width/height (and some other intrinsic attributes) don’t inherit.

Your second post shows you’ve found the correct method to use where you do want to set such attributes. You use action code in one of a number of settings: agent action, container $OnAdd action, rule, edict (possible but less likely), or a stamp.

Don’t forget a rule runs all the time but you probably want to set the width/height of the note only once (or occasionally reset/correct it if altered). Therefore you might like to consider a stamp.

[N.B. I’ve now corrected aTbRef6 to remove the now-confusing sentence. Sorry for confusion caused in the interim. The resource is now 12 years old and the app changes over time. I catch most things but miss the occasional one.]]

I think that what Mark Anderson was trying to say in aTbRef is something like this.

Width and Height are not inherited, but take their initial values from the default values of Width and Height.

If you want to change the height or width of new notes, you have several options.

Throughout the document: change the default value of $Width or $Height in the System pane of the Document Inspector.

In a particular container: set $Width or $Height in the container’s OnAdd rule.

For notes that meet some criterion: set $Width(original) or $Height(original) in an agent’s AgentAction.

1 Like

Thank you, Mark and Mark. Got it now.