[GH-ISSUE #159] Can only create one window? #100

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

Originally created by @chuanhaisoft on GitHub (Jun 18, 2018).
Original GitHub issue: https://github.com/kusti8/proton-native/issues/159

Can only create one window ?

how to create a second, third window ?

communication between windows

Originally created by @chuanhaisoft on GitHub (Jun 18, 2018). Original GitHub issue: https://github.com/kusti8/proton-native/issues/159 Can only create one window ? how to create a second, third window ? communication between windows
Author
Owner

@mischnic commented on GitHub (Jun 18, 2018):

Example for a "child window" (the application doesn't quit if the child window is closed):

class Main extends Component {
  state = {
    childWindow: false
  };

  render() {
    return (
      <App>
        <Menu>
          <Menu.Item type="Quit" />
        </Menu>
        <Window title="Notes" size={{ w: 800, h: 500 }} margined>
          <Box padded>
            <Button
              onClick={() => this.setState({ childWindow: true })}
              enabled={!this.state.childWindow}
            >
              Open a child window
            </Button>
          </Box>
        </Window>
        {this.state.childWindow && (
          <Window
            title="Child"
            size={{ w: 300, h: 70 }}
            margined
            lastWindow={false}
            onClose={() => this.setState({ childWindow: false })}
          >
            <Box>
              <Text>
                Unfortunately, there is nothing to see here.
              </Text>
            </Box>
          </Window>
        )}
      </App>
    );
  }
}

render(<Main />);
<!-- gh-comment-id:398032299 --> @mischnic commented on GitHub (Jun 18, 2018): Example for a "child window" (the application doesn't quit if the child window is closed): ```jsx class Main extends Component { state = { childWindow: false }; render() { return ( <App> <Menu> <Menu.Item type="Quit" /> </Menu> <Window title="Notes" size={{ w: 800, h: 500 }} margined> <Box padded> <Button onClick={() => this.setState({ childWindow: true })} enabled={!this.state.childWindow} > Open a child window </Button> </Box> </Window> {this.state.childWindow && ( <Window title="Child" size={{ w: 300, h: 70 }} margined lastWindow={false} onClose={() => this.setState({ childWindow: false })} > <Box> <Text> Unfortunately, there is nothing to see here. </Text> </Box> </Window> )} </App> ); } } render(<Main />); ```
Author
Owner

@chuanhaisoft commented on GitHub (Jun 18, 2018):

thanks

<!-- gh-comment-id:398040881 --> @chuanhaisoft commented on GitHub (Jun 18, 2018): thanks
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#100
No description provided.