0

This thread shows a way to open multiple windows in a Kivy app. It's necessary to create more than one app and then call the app that opens a new window when needed. I've never deployed a Kivy app. So my question is will that work if deploying for distribution? Can multiple apps be bundled up and put in an executable?

The app in question pops out a full screen window to a second display.

The multiple window situation with Kivy is an issue with what I'm working on. Fortunately the work around above will do but I don't want to continue going down that path if it won't deploy well/at all.

Community
  • 1
  • 1
Max Phillips
  • 6,991
  • 9
  • 44
  • 71

2 Answers2

0

Yes this is possible. I did the same. I assume this counts for a windows application? If so I can provide you with a basic module framework which you could use. You need to make use of multiprocessing features where you instantiate separate kivy apps. Each app has it's own window definitions. Furthermore I make use of windows api to minimize <> maximize the windows. Just let me know if it is for windows and I will put togther the python code for you.

Bill Bridge
  • 821
  • 1
  • 9
  • 30
  • I just saw your link to another thread. That's indeed the structure I am using as well. Next to that you might need to add functionality for freeze problems: if \_\_name\_\_ == "\_\_main\_\_": from multiprocessing import freeze_support freeze_support() With PyInstaller I have created a distributable installation tree and using Inno Setup compiler to create a distribution package. Works very well. – Bill Bridge Jun 27 '16 at 15:13
  • What are you doing with your other windows? You're not pushing them out to a second display by any chance? – Max Phillips Jun 27 '16 at 17:16
  • At click of button a in window1, window1 minimizes and window2 appears having a complete new kivy app instance. I guess you easily could push this to a 2nd display as you will have new control over the kivy graphics configuration, e.g. size, position, resizable, ..... – Bill Bridge Jun 27 '16 at 19:20
  • You might need the win32api in general and http://docs.activestate.com/activepython/3.1/pywin32/win32api__GetMonitorInfo_meth.html more specifically – Bill Bridge Jun 27 '16 at 19:28
  • were you building for Windows? – Max Phillips Jun 27 '16 at 21:51
0

First thing: Window != Form. The question (and answer) only show a way how to communicate between multiple apps(multiple standalone things) and how to run multiple apps from the same interpreter. It may look like a working forms, but it's not... and most probably it won't even behave in this way e.g. changing color in other form won't work for you this way if you won't write a listener for that (no simple other_form.my_widget.color). Look at this.

If it works in the interpreter, it will work after deploying if you package it correctly, because packaging is basically putting whole compiled-for-desired-platform interpreter with your .py file somewhere.

Anyway, why do you want to have multiple windows? The same thing you can make within Kivy only with Drag Behavior and ModalView keeping your whole app simple, clean and easier to debug.

(meaning = You'll have a lot of fun debugging those multiwindows if a customer breaks something and you don't have a proper logger)

Community
  • 1
  • 1
Peter Badida
  • 11,310
  • 10
  • 44
  • 90
  • 2
    The premise of the application is to project onto a second output. HDMI out to multiple TV's in an entertainment venue. Therefore I need the user side and then the presentation side. I'm not excited about doing it this way. I'd rather use a framework that was designed to do this. But not having a ton of experience with Python, Kivy seemed like the best choice. – Max Phillips Jun 27 '16 at 17:10
  • If they share source, it may seem that you'd do better to have one app, however imagine if you'd do something wrong - whole presentation is killed. More reasonable approach might be to have two apps, but from two interpreters - server/client approach. Your "client" app would listen to e.g. ip, look for a file or something and if it'd crash, you'll know what went wrong where. With multiprocessing if you freeze your interpreter or encounter something unexpected it'll force you to restart the whole thing. – Peter Badida Jun 27 '16 at 17:18
  • I'll have to play around with a couple approaches. Building the interface is pretty straightforward. It's the choke point of opening a second window and then having it automatically displayed on a second display that's going to cause pain. The second window doesn't need to accept any interaction so maybe a different framework could be incorporated for that portion. Thank you for the help btw, much appreciated. – Max Phillips Jun 27 '16 at 17:36