Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Kivy should show nice message box on Windows when gl version < 2.0 #1723

Closed
winstonwolff opened this issue Dec 20, 2013 · 5 comments
Closed
Milestone

Comments

@winstonwolff
Copy link

There is code in kivy.core.gl to print a MessageBox on Windows when the GL version is too low. But it is broken in two ways: (1) sys.platform is replaced later with kivy.utils.platform, and (2) unless you have the mfc.dll, import win32ui will fail. Here is code that will fix both problems:

from os import environ
#from sys import platform, exit
from sys import exit
import sys


MIN_REQUIRED_GL_VERSION = (2, 0)


def msgbox(message):
    if sys.platform == 'win32':
    #if platform == 'win32':
        import ctypes
        ctypes.windll.user32.MessageBoxA(None, message, 'Kivy Fatal Error', 0)
        #import win32ui
        #win32ui.MessageBox(message, 'Kivy Fatal Error')
        exit(1)
@tshirtman
Copy link
Member

Hi, would you do a PR for this?

Thanks

On Thu, Dec 19, 2013 at 04:15:02PM -0800, winstonwolff wrote:

There is code in kivy.core.gl to print a MessageBox on Windows when the GL version is too low. But it is broken in two ways: (1) sys.platform is replaced later with kivy.utils.platform, and (2) unless you have the mfc.dll, import win32ui will fail. Here is code that will fix both problems:

from os import environ
#from sys import platform, exit
from sys import exit
import sys


MIN_REQUIRED_GL_VERSION = (2, 0)


def msgbox(message):
    if sys.platform == 'win32':
    #if platform == 'win32':
        import ctypes
        ctypes.windll.user32.MessageBoxA(None, message, 'Kivy Fatal Error', 0)
        #import win32ui
        #win32ui.MessageBox(message, 'Kivy Fatal Error')
        exit(1)

Reply to this email directly or view it on GitHub:
#1723

@akshayaurora
Copy link
Member

@tshirtman, would it make sense to use plyrs and use cross platform toast
here?

On Thu, Dec 26, 2013 at 1:35 AM, Gabriel Pettier
notifications@github.comwrote:

Hi, would you do a PR for this?

Thanks

On Thu, Dec 19, 2013 at 04:15:02PM -0800, winstonwolff wrote:

There is code in kivy.core.gl to print a MessageBox on Windows when the
GL version is too low. But it is broken in two ways: (1) sys.platform is
replaced later with kivy.utils.platform, and (2) unless you have the
mfc.dll, import win32ui will fail. Here is code that will fix both problems:

from os import environ
#from sys import platform, exit
from sys import exit
import sys


MIN_REQUIRED_GL_VERSION = (2, 0)


def msgbox(message):
if sys.platform == 'win32':
#if platform == 'win32':
import ctypes
ctypes.windll.user32.MessageBoxA(None, message, 'Kivy Fatal Error', 0)
#import win32ui
#win32ui.MessageBox(message, 'Kivy Fatal Error')
exit(1)

Reply to this email directly or view it on GitHub:
#1723


Reply to this email directly or view it on GitHubhttps://github.com//issues/1723#issuecomment-31204563
.

@tshirtman
Copy link
Member

I'm hesitant to make kivy depend on plyers, plus, it would grag in a lot
of dependencies no? (for all potential platforms)

On Thu, Dec 26, 2013 at 10:11:49AM -0800, qua-non wrote:

@tshirtman, would it make sense to use plyrs and use cross platform toast
here?

On Thu, Dec 26, 2013 at 1:35 AM, Gabriel Pettier
notifications@github.comwrote:

Hi, would you do a PR for this?

Thanks

On Thu, Dec 19, 2013 at 04:15:02PM -0800, winstonwolff wrote:

There is code in kivy.core.gl to print a MessageBox on Windows when the
GL version is too low. But it is broken in two ways: (1) sys.platform is
replaced later with kivy.utils.platform, and (2) unless you have the
mfc.dll, import win32ui will fail. Here is code that will fix both problems:

from os import environ
#from sys import platform, exit
from sys import exit
import sys


MIN_REQUIRED_GL_VERSION = (2, 0)


def msgbox(message):
if sys.platform == 'win32':
#if platform == 'win32':
import ctypes
ctypes.windll.user32.MessageBoxA(None, message, 'Kivy Fatal Error', 0)
#import win32ui
#win32ui.MessageBox(message, 'Kivy Fatal Error')
exit(1)

Reply to this email directly or view it on GitHub:
#1723


Reply to this email directly or view it on GitHubhttps://github.com//issues/1723#issuecomment-31204563
.


Reply to this email directly or view it on GitHub:
#1723 (comment)

@tito
Copy link
Member

tito commented Dec 28, 2013

No plyer for that

@tito
Copy link
Member

tito commented Jan 7, 2014

Ok, i've replaced with ctypes instead of win32 ui. But the analysis with sys.platform is wrong, as we correctly import it to not conflict with the kivy.utils platform.

@tito tito closed this as completed in d80741b Jan 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants