Comments (4)
Hi there, I would like to cover all the libui API, but currently I'm not actively developing for pylibui as I have other priorities right now. But I strongly suggest you to try to generate the bindings as it is really simple: https://github.com/joaoventura/pylibui#contributing
Start by checking which functions on libui you need to generate the bindings for: https://github.com/andlabs/libui/blob/master/ui.h#L211
Then use the script in bindings.py to build the wrappers to those functions, which then you have to manually generate the code (you can check the other examples).. Then you can make (or not) the higher level python API (or just use the wrapper you implemented). It's not really that hard, you just need to look around and test things..
from pylibui.
Can I work on this please? Maybe I can help some. I ran bindings.py file for combobox and get something like this:
"""
Python wrapper for libui.
"""
import ctypes
from . import clibui
class uiCombobox(ctypes.Structure):
"""Wrapper for the uiCombobox C struct."""
pass
def uiComboboxPointer(obj):
"""
Casts an object to uiCombobox pointer type.
:param obj: a generic object
:return: uiCombobox
"""
return ctypes.cast(obj, ctypes.POINTER(uiCombobox))
# - void uiComboboxAppend(uiCombobox *c, const char *text);
def uiComboboxAppend(*args):
"""
Describe the function.
:param args: arguments
:return: value
"""
# TODO
return clibui.uiComboboxAppend()
# - int uiComboboxSelected(uiCombobox *c);
def uiComboboxSelected(*args):
"""
Describe the function.
:param args: arguments
:return: value
"""
# TODO
return clibui.uiComboboxSelected()
# - void uiComboboxSetSelected(uiCombobox *c, int n);
def uiComboboxSetSelected(*args):
"""
Describe the function.
:param args: arguments
:return: value
"""
# TODO
return clibui.uiComboboxSetSelected()
# - void uiComboboxOnSelected(uiCombobox *c, void (*f)(uiCombobox *c, void *data), void *data);
def uiComboboxOnSelected(*args):
"""
Describe the function.
:param args: arguments
:return: value
"""
# TODO
return clibui.uiComboboxOnSelected()
What is this and what should I do now?
from pylibui.
You have to write a higher level binding around it, look at the other examples here.
from pylibui.
You first have to create the ctypes bindings for it, check examples here, then you can add an higher level binding as @LordZane mentioned.
from pylibui.
Related Issues (20)
- Implement separator HOT 44
- Implement editable combobox
- Implement radio buttons
- Implement date time picker HOT 2
- Removal of some window functions in clibui HOT 2
- Update ui.h
- Create a Control Gallery HOT 7
- Start writing documentation HOT 2
- Undefined symbol HOT 2
- Installation issues HOT 1
- Implement form HOT 1
- controls folder not getting copied when installing via setup.py HOT 2
- Run from iPython/Jupyter Notebook
- Is pylibui dead ? HOT 3
- Initial Update
- Could you please provide Python distribution on PyPi service HOT 1
- Issue building: AttributeError: /usr/lib/x86_64-linux-gnu/libui.so.1: undefined symbol: uiInit HOT 1
- `App.stop` does not exit app HOT 1
- setChild or addChild? HOT 3
- Build instructions outdated HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pylibui.