Python Forum

Full Version: Help Wrapping C Library
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I am trying to wrap the Sigil library, which was written in C. I have had success wrapping it in other languages such as Ruby and Euphoria, however with Python I keep hitting roadblocks.

sigil.slWindow.argtypes = [ctypes.c_int,ctypes.c_int,ctypes.c_wchar_p,ctypes.c_int]
sigil.slWindow.restype = None

sigil.slClose.argtype = None
sigil.slClose.restype = None

sigil.slShouldClose.argtype = None
sigil.slShouldClose.restype = ctypes.c_bool

def slWindow(width,height,title,fullScreen):
    return sigil.slWindow(width,height,title,fullScreen)

def slClose():
    return sigil.slClose()

sigil.slRender.argtype = None
sigil.slRender.restype = None

def slRender():
    return slRender()


def slShouldClose():
    return sigil.slShouldClose()

slWindow(640,480,"Hello World",0) #only the H is printed in the title screen

while not slShouldClose():
       slRender()
The window shows up, but it only shows a white screen when it should be blank(black) and I can't close the window, I have to use CTRL+ALT+DELETE to close the window.
*BUMP*
This is the kind of question where I think that we need to be able to fully reproduce it to investigate robustly. Assuming your code is more than a short script, I recommend getting your code on Github with clear instructions for how to reproduce this issue. Also note, I'm not certain that people will be willing to do in and help, but given that you haven't gotten a response for nearly a month and bumped nearly a week ago, I think that's your best bet.