When I create the containers, such as tab, box or group, one of the argument is container_items. At first, I always created container_items. And I think I must use container_items.DLGAddElement() to add element. But I found I can achieve the same result by using container.DLGAddElement().
Also, for some widget, like radio button, it also has container_items argument.
Could anyone give me some information when will we use the contain_items?
DLGCreateTab( TagGroup &tab_items, string label )
DLGCreateBox( String title, TagGroup &items )
DLGCreateGroup( TagGroup &items )
DLGCreateRadioList( TagGroup &items )
(Nearly) all DLG... commands are essentially utility methods that build a tagGroup, where the tagGroup describes what the dialog will be like. For debugging or learning purpose it is often helpful to show this tagGroup. If different commands yield the same tagGroup, they indeed are identical in function.
To display a TagGroup, you can use
TagGroupOpenBrowserWindow(tagGroup myTags, string Name, bool isFileBased)with
mytagsbeing the TagGroup to be displayed (the one you create with DLGCreateDialog) andwith
Namejust being the title of the shown dialog andwith
isFileBasedindicating whether or not the tags (if changed) should be saved once the dialog is closed.gives you
:
As you can see, both methods give you the same dialog and (nearly) the same tag structure, but adding to the container instead of the container items tags adds an "invalid" flag. I would guess, adding to the items is the "correct" way, but when adding to the container itself, the underlying code 'fixes' it for your. Quite likely some convenience behavior added at later state.
Example regarding comment on tabs: