Making GUI labels not go past edge of inspector

Why is it so hard to not prevent blocks of text from going past the right side of a custom inspector. It seems impossible to just put in a GUI label and have it automatically wrap to whatever width the inspector is.

Setting GUI.skin.label.wordwrap = true never seems to work except when a label has been given an explicit width.
Using GetLastRect() seems usually to return 0.

I just want to be able to have a block of help text in a custom inspector, and have it always wrap to whatever the inspector’s width happens to currently be. What is the easiest and most versatile way to do this?

komatii

It seems the putting GUI.skin.label.wordwrap = false at the end of OnInspectorGUI screws up wordwrapping of labels in the entire inspector

What I’ve been using with eDriven is:

EditorGUILayout.HelpBox(
	@"Select any container in the Hierarchy view and then click any component in this dialog.
The component will be created and added to hierarchy.
If holding the Control key, the created component will get selected.
Note: Stage could not be created as a child of another component.",
	MessageType.Info, true);

Everything is working nice (it auto wraps etc.)…

1127685--42661--$help_box.png
1127685--42662--$help_box_wrap.png