python-eel / Eel

A little Python library for making simple Electron-like HTML/JS GUI apps
MIT License
6.28k stars 581 forks source link

Entering size(<width>, <height>) in eel.start() doesn't really work. #713

Closed norwagov closed 6 months ago

norwagov commented 6 months ago

Eel version I'm using 0.16.0 EEL version.

Describe the bug When I try to create any app using eel, i cannot use:

eel.init('assets')
eel.start('github_issue.html', size=(500, 500), port=2023)

...because the effect looks like this:

image

Well, as you can see from the code, it should be smaller.

To Reproduce Steps to reproduce the behavior:

  1. Install eel using pip
  2. Create main.py file
  3. In the same directory as main.py, create assets folder
  4. In the assets folder, create a file called index.html, and put some code in it. I've just put a pure string for test.
  5. In the main.py, enter the code given down bellow:
import eel

eel.init('assets')
eel.start('index.html', size=(500, 500), port=2023)
  1. Enter python -u <directory>/main.py in terminal / Execute the python file

Expected behavior The window should be 500px by 500px. Well, it's not.

System Information

thatfloflo commented 6 months ago

This might be a limitation of your browser and OS. Usually with Chrome in app mode the sizing works, but generally most browsers now do not let the user programmatically resize windows, least not without user interaction triggering this. You can try window.resizeTo() in JavaScript and see if that works.

It is using Chrome by default if the mode argument to eel.start() is not given. Firefox isn't specifically supported at this time, you'd have to do this with mode='custom'.

norwagov commented 6 months ago

Okay, it works on another OS. Thank You for the help!