Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Wrapping C Library
#1
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.
Reply
#2
*BUMP*
Reply
#3
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Wrapping c/c++ dll Oolongtea 2 730 Aug-25-2023, 10:35 PM
Last Post: PyDan
  How to do "fixed size" (wrapping) math in Python? AlexanderWulf 13 1,869 Jul-19-2023, 04:13 PM
Last Post: deanhystad
  xml indent SubElements (wrapping) with multiple strings ctrldan 2 1,473 Jun-09-2023, 08:42 PM
Last Post: ctrldan
  wrapping c++ library JESuh 2 1,304 Jun-16-2022, 08:18 AM
Last Post: JESuh
  wrapping problem ibaad1406 2 2,023 Jun-19-2019, 07:22 AM
Last Post: Gribouillis
  PyInstaller, how to create library folder instead of library.zip file ? harun2525 2 4,800 May-06-2017, 11:29 AM
Last Post: harun2525

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020