joaoventura / pylibui Goto Github PK
View Code? Open in Web Editor NEWPylibui is a Python 3 wrapper for the libui library.
License: MIT License
Pylibui is a Python 3 wrapper for the libui library.
License: MIT License
Some tests have a TODO line with a single raise statement, they are failing and should be removed.
Hello,
As the pylibui
wrapper is supposed to be pythonic, I thought it would be great to use the properties instead of defining setValue
/getValue
-like methods.
Here is a little implementation example for checkboxes checked
attribute:
@property
def checked(self):
"""
Returns whether the checkbox is checked or not.
:return: bool
"""
return libui.uiCheckboxChecked(self.control)
@checked.setter
def checked(self, checked):
"""
Sets whether the checkbox is checked or not.
:param checked: bool
:return: None
"""
libui.uiCheckboxSetChecked(self.control, checked)
That way, that would allow us to do things like:
if my_checkbox.checked:
my_checkbox.checked = False
instead of...
if my_checkbox.getChecked():
my_checkbox.setChecked(False)
What do you think ? Should I make a PR for this ?
Have a good day,
Nicolas.
Any ideas?
libui announced removal of some window functions. So our window implementation is a bit broken now.
Should we remove these functions?
libui no longer uses cmake but meson
the readme should probably be updated accordingly
cheers!
Jupyter Notebooks (can be installed with pip install jupyter notebook
and run with jupyter notebook
) has mainly data processing usage and such but is also tweaked to support pyqt and wxpython, I wonder, if it would possible to support libui on it also, steps to reproduce:
jupyter notebook
on pylibui folderExpected:
Everything goes smoothly and I could repeat running of the sample code
Actual:
Jupyter will not notice even the created window is closed or crashes.
I think things can be tweaked to work more smoothly, for example see this documentation, it seems IPython.lib.guisupport
provides good utilities to enhance the support.
I have problems about running tests and examples. Some of them ends with a segmentation fault. I think there are some problems about getters of components like window and checkbox. And I think it's about boolean difference between Python and C.
I'm using Ubuntu 16.04
Am I the only person that have problems about tests or anyone can confirm that there is a problem?
We need someone to implement date time picker.
Please feel free to ask for help, if you want to work on this.
Original libui has a control gallery that looks really cool. It's like an example of all controls. I think we should add a control gallery to pylibui too. And we can improve it as we add new controls. What do you think?
There are some tests with a single raise keyword and a TODO comment. They are failing. I think they must be commented out until a way to simulate mouse press found or... what about removing them completely? Because I don't think we can find a way to simulate mouse press.
Instead of tests we can request working examples that uses the functions which need mouse input from contributors.
I noticed we don't have a "label" example like we do for all the other widgets.
Hello,
I've compiled libui
**(even on an alpha branch).
https://packagecloud.io/waghanza/plunder/packages/fedora/25/libui-0.0alpha3-1.x86_64.rpm
I have a undefined symbol
AttributeError: /usr/lib64/libui.so: undefined symbol: uiWindowOnContentSizeChanged
Regards,
PS : I don't know how to fix it
PSS : This package is for fedora
x86_64
We need someone to implement seperators.
Please feel free to ask for help, if you want to work on this.
Really sorry for being a noob here but I keep getting an error when trying to run a pylibui sample application. I set it up by doing the following on my Windows 10 64-bit machine.
However, my programs fail to run and I get the following error:
c:\Apps\Python>python libuitest.py
Traceback (most recent call last):
File "libuitest.py", line 1, in
from pylibui.core import App
File "C:\Python35\lib\site-packages\pylibui\core.py", line 6, in
from . import libui
File "C:\Python35\lib\site-packages\pylibui\libui_init_.py", line 24, in
ctypes.cdll.LoadLibrary(SHARED_LIBS)
File "C:\Python35\lib\ctypes_init_.py", line 425, in LoadLibrary
return self.dlltype(name)
File "C:\Python35\lib\ctypes_init.py", line 347, in init
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
Any help?
We need someone to implement groups.
Please feel free to ask for help, if you want to work on this.
I think we should start to write a documentation. What do you think? I'm not very good at writing in English ๐ but I can read and review
Also should we use a doc generator or do wiki pages suffice?
I keep getting the following error after building. Any recommendations on how I can fix this?
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pylibui.core import App
>>> app = App()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/brandon/anaconda3/lib/python3.6/site-packages/pylibui-0.0.1-py3.6.egg/pylibui/core.py", line 17, in __init__
libui.uiInit(options)
File "/home/brandon/anaconda3/lib/python3.6/site-packages/pylibui-0.0.1-py3.6.egg/pylibui/libui/main.py", line 24, in uiInit
return clibui.uiInit(ctypes.byref(options))
File "/home/brandon/anaconda3/lib/python3.6/ctypes/__init__.py", line 361, in __getattr__
func = self.__getitem__(name)
File "/home/brandon/anaconda3/lib/python3.6/ctypes/__init__.py", line 366, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib/x86_64-linux-gnu/libui.so.1: undefined symbol: uiInit
I've followed the instructions on building libui
and pylibui
in the README
.
There is an error about lineno variable in bindings.py
if start <= lineno + 1 <= end:
lines.append(line.strip())
First line must be if start <= lineno <= end:
. Because when lineno +1 used in the condition, the first item of the returned lines is going to be an empty string and bindings.py can not create the last function of sections. (i.e. uiNewSomething)
A screenshot of the lines returned by return_lines
function for combobox, see the first item
... somehow i would have expected to be adding children with addChild
, not with setChild()
...
Hi ๐
This is my first visit to this fine repo, but it seems you have been working hard to keep all dependencies updated so far.
Once you have closed this issue, I'll create separate pull requests for every update as soon as I find one.
That's it for now!
Happy merging! ๐ค
Imagine modern library without support binary package distribution is hardest,
For using in 1990's is normaly but today we understand that building is time and maintenance money.
Could you please resolve mantenince issue and provide biaary distribution your package in PyPi system.
C:\Program Files (x86)\Python36-32\Scripts>python -m pip install --upgrade pip
Requirement already up-to-date: pip in c:\program files (x86)\python36-32\lib\site-packages (10.0.1)
C:\Program Files (x86)\Python36-32\Scripts>pip.exe install pylibui
Collecting pylibui
Could not find a version that satisfies the requirement pylibui (from versions: )
No matching distribution found for pylibui
C:\Program Files (x86)\Python36-32\Scripts>pip.exe install libui
Collecting libui
Could not find a version that satisfies the requirement libui (from versions: )
No matching distribution found for libui
Followed your guide in the README and did the following:
sudo -H python3 setup.py install
When trying to run the example on the README, I would get this error:
Traceback (most recent call last):
File "pylibui-test.py", line 1, in <module>
from pylibui.core import App
File "/usr/local/lib/python3.5/dist-packages/pylibui/core.py", line 6, in <module>
from . import libui
File "/usr/local/lib/python3.5/dist-packages/pylibui/libui/__init__.py", line 24, in <module>
ctypes.cdll.LoadLibrary(SHARED_LIBS)
File "/usr/lib/python3.5/ctypes/__init__.py", line 425, in LoadLibrary
return self._dlltype(name)
File "/usr/lib/python3.5/ctypes/__init__.py", line 347, in __init__
self._handle = _dlopen(self._name, mode)
OSError: /usr/local/lib/python3.5/dist-packages/pylibui/libui/sharedlibs/libui.so: cannot open shared object file: No such file or directory
Fixed this by copying over the sharedlibs/
folder but then I got this error:
Traceback (most recent call last):
File "pylibui-test.py", line 2, in <module>
from pylibui.controls import Window
ImportError: No module named 'pylibui.controls'
This had me stumped until I realized that the entire controls/
folder was not copied during setup. Once I manually copied it over to the install location, then it worked fine.
If you can, please change your setup procedure to automatically take care of these steps to make installation of this library painless.
In wrappers (i.e. the files under pylibui/libui
) there are some bool casts. We want wrappers to be really simple. So these casts should be moved to corresponding files in pylibui/controls
and docstrings must be corrected as well.
Correct files above and please review all wrappers. If they have unnecessary details that can be implemented in pylibui/controls
, fix them as well.
Feel free to ask for help if you need
The window example does not work. After closing the window, the python process just keeps running. SIGINT is ignored. SIGQUIT terminates the process.
It's a bit difficult to change file content for every template/section. I offer to use sys.argv in bindings.py file so we can use it just like:
$ python3 bindings.py combobox
I can open a pull request soon if you confirm it.
Hi,
I can see that there is not any commit since more than one year.
Is pylibui
dead / call for maintainer ?
As I am using pylibui
, I can maintain it.
Regards,
The script to generate automatically the bindings parses the libui header file in pylibui/scripts/ui.h. The current header file is 4 months old now, so there is definitely some things that were added to libui in the last months that are not in the pylibui ctype wrapper files.
We just need to regularly copy ui.h from the libui project, to keep binding generation up-to-date and manually integrate the new functions in the wrapper files. In the future we may try to automatize some things, but let the project mature a little bit more..
We need an example for tab, so we can better understand all methods' behaviours.
Check other examples for guidance, feel free to ask for help if you need.
I followed the instructions on windows and when I run the example program I get the following error:
Traceback (most recent call last):
File ".\hello.py", line 8, in <module>
from pylibui import libui
File "C:\Users\(USER)\Desktop\Projects\Chat\pylibui\libui\__init__.py", line 15, in <module>
ctypes.cdll.LoadLibrary(SHARED_LIBS)
File "C:\Users\(USER)\AppData\Local\Programs\Python\Python35-32\lib\ctypes\__init__.py", line 425, in LoadLibrary
return self._dlltype(name)
File "C:\Users\(USER)\AppData\Local\Programs\Python\Python35-32\lib\ctypes\__init__.py", line 347, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
Am I doing something wrong or is it a bug? The directory structure is as follows:
Ran on windows 8.1 with python 35 and the latest version of both libui and pylibui
EDIT: in init.py, changing this works
SHARED_LIBS = os.path.join(SHARED_LIBS_PATH, 'libui.dylib')
to
SHARED_LIBS = os.path.join(SHARED_LIBS_PATH, 'libui.dll')
We need someone to implement editable comboboxes.
Please feel free to ask for help, if you want to work on this.
I want to use this for the menu of my game, and looking at the libui controlgallery screenshots they have something called a "Combobox". It looks like you havent implemented it yet though. Do you have any plans to do it? If not, id be willing to try and do it myself
EDIT: I tried doing it myself, but after generating the bindings, I had no idea how to use them or how to make a higher level wrapper around them. It would be great if you could add comboboxes yourself, as I cant figure it out
We need someone to implement radio buttons.
Please feel free to ask for help, if you want to work on this.
I think it would be good to have a constructor that accepts a list. So we can get a working combobox without dealing with a lot of append
calls. What do you think about that? @joaoventura @superzazu
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.