[GH-ISSUE #66] Window can have only one child #37

Closed
opened 2026-05-05 11:30:43 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @mischnic on GitHub (Mar 22, 2018).
Original GitHub issue: https://github.com/kusti8/proton-native/issues/66

https://github.com/parro-it/libui-node/blob/master/docs/window.md#setchild:

setChild
Allow to specify the control to show in window content area. UiWindow instances could contains only one control. If you need more, you have to use Containers.

This

<App>
  <Window title="Test" size={{ w: 500, h: 500 }} margined={true}>
    <Text>Input:</Text>
    <Box>
      <Button>Hello</Button>
      <TextInput />
    </Box>
    <Button>Test</Button>
  </Window>
</App>

will display only:

<Button>Test</Button>

(the last child).

This should be documented and even better a warning/error be shown.

Originally created by @mischnic on GitHub (Mar 22, 2018). Original GitHub issue: https://github.com/kusti8/proton-native/issues/66 https://github.com/parro-it/libui-node/blob/master/docs/window.md#setchild: > **`setChild`** Allow to specify the control to show in window content area. UiWindow instances could contains only one control. If you need more, you have to use Containers. This ```jsx <App> <Window title="Test" size={{ w: 500, h: 500 }} margined={true}> <Text>Input:</Text> <Box> <Button>Hello</Button> <TextInput /> </Box> <Button>Test</Button> </Window> </App> ``` will display only: ```jsx <Button>Test</Button> ``` (the last child). This should be documented and even better a warning/error be shown.
Author
Owner

@kusti8 commented on GitHub (Mar 22, 2018):

Ok I'll add a warning.

<!-- gh-comment-id:375467238 --> @kusti8 commented on GitHub (Mar 22, 2018): Ok I'll add a warning.
Author
Owner

@mischnic commented on GitHub (Mar 23, 2018):

(Same goes for Group)

<!-- gh-comment-id:375712131 --> @mischnic commented on GitHub (Mar 23, 2018): (Same goes for Group)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/proton-native#37
No description provided.