question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Window size not working properly

See original GitHub issue

Hi! Awesome library!

I don’t know how the libui-node works properly, so please help.

If I render a <Window /> element on the tree, without any children, the Window get the right size. But, as soon as I insert the children, the window fits to the children and ignore the specified width and height. Is it expected?

Also, it looks like updating the height of the window via state doesn’t work as well. My code is the following:

import React, { Component } from 'react'

import { render, Window, App, Button } from 'proton-native'

class Example extends Component {
  state = {
    height: 300,
  }

  componentWillMount() {
    this.handleResize = this._handleResize.bind(this)
  }

  _handleResize() {
    this.setState({
      height: 400,
    })
  }

  render() {
    console.log(this.state.height)

    return (
      <App>
        <Window
          title="Example"
          margined
          size={{
            w: 300,
            h: this.state.height
          }}
        >
          <Button onClicked={this.handleResize}>
            Change my size!
          </Button>
        </Window>
      </App>
    )
  }
}

render(<Example />)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
KirankumarDafdacommented, Dec 5, 2018

@zaguiini I was also looking for the same and found that adding box tag inside the window component will render the screen exact as the same size of given height and width of window.

import { render, Window, App, Button, Box } from 'proton-native'

return (
      <App>
        <Window
          title="Example"
          margined
          size={{
            w: 300,
            h: this.state.height
          }}
        >
          <Box>
               <Button onClicked={this.handleResize}>
                    Change my size!
               </Button>
          </Box>
        </Window>
      </App>
    )
0reactions
andlabscommented, May 2, 2018

There are a lot of other issues with resizing on Mac that I need to fix as well (and these are issues on my end due to probably not using Auto Layout correctly), so the answer to these questions will likely be a case-by-case thing until I fix them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix Screen Size Too Big or Small on Windows
Open the Start menu and select Settings. · Go to System. · In Display, check the Scale and Resolution options, and adjust them...
Read more >
8 Fixes When You Can't Resize Window in Windows 11 and 10
8 Fixes When You Can't Resize Window in Windows 11 and 10 · 1. Try Keyboard Shortcuts to Resize a Window · 2....
Read more >
Can't change windows' size in Win 10 - Microsoft Community
Right click on the very top of the window's bar and click on "Restore." This will restore the window to it's original capabilities...
Read more >
How to Fix Windows not Remembering Window Positions and ...
Method 1: Cascading · Firstly, Restart your computer. · Now open any window(like File Explorer), of which size and position you want to...
Read more >
How to resize a window - Computer Hope
Press Alt + Spacebar again to open the window menu, arrow down to Size, and press Enter . Press the up or down...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found