Giter Club home page Giter Club logo

pylibui's People

Contributors

ditti4 avatar joaoventura avatar lengran avatar mark-summerfield avatar superzazu avatar tiagodanin avatar waghanza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pylibui's Issues

use of properties instead of setters/getters in wrapper

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.

Be more contributor-friendly

  • I think README.md can be rewritten, especially the Contributing section, maybe adding a CONTRIBUTING.md will be better.
  • We can make some improvements in bindings.py so generating binding templates will be easier. see #14
  • More issues and more labels. We can open issues for unimplemented or semi-implemented components and add some labels to new issues, so new contributors can easily find them.

Any ideas?

Run from iPython/Jupyter Notebook

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:

  1. Open jupyter notebook on pylibui folder
  2. Create a notebook and paste a sample pylibui code on it
  3. Close the created window

Expected:
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.

Segmentation faults

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?

Implement date time picker

We need someone to implement date time picker.

Please feel free to ask for help, if you want to work on this.

Create a Control Gallery

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?

Semi-implemented tests

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.

Implement separator

We need someone to implement seperators.

Please feel free to ask for help, if you want to work on this.

Installation issues

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.

  1. Downloaded pylibui from github, unzipped and run python setup.py install
  2. This now creates the pylibui package in C:\Python35\Lib\site-packages\pylibui
  3. I now create a folder called sharedlibs in C:\Python35\Lib\site-packages\pylibui\libui
  4. I copy the results of my cmake into this folder. the files are as follows:
    libui.dll, libui.pdb, libui.lib, cpp-multithread.pdb, cpp-multithread.exe, controlgallery.exe, controlgallery.pdb, histogram.exe, histogram.pdb, test.exe, test.pdb

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?

Implement group

We need someone to implement groups.

Please feel free to ask for help, if you want to work on this.

Start writing documentation

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 :octocat:

Also should we use a doc generator or do wiki pages suffice?

Issue building: AttributeError: /usr/lib/x86_64-linux-gnu/libui.so.1: undefined symbol: uiInit

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.

bindings.py lineno error

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
bindings

setChild or addChild?

... somehow i would have expected to be adding children with addChild, not with setChild()...

Initial Update

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! ๐Ÿค–

Could you please provide Python distribution on PyPi service

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

controls folder not getting copied when installing via setup.py

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.

Remove unwanted casting in wrappers

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.

  • checkbox.py
  • control.py
  • window.py

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 :octocat:

`App.stop` does not exit app

The window example does not work. After closing the window, the python process just keeps running. SIGINT is ignored. SIGQUIT terminates the process.

Use command line arguments in bindings.py

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.

Is pylibui dead ?

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,

Update ui.h

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..

Add an example for tab

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.

Cannot load the libui dll?

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:
untitled

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')

Implement editable combobox

We need someone to implement editable comboboxes.

Please feel free to ask for help, if you want to work on this.

Comboboxes?

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

Implement radio buttons

We need someone to implement radio buttons.

Please feel free to ask for help, if you want to work on this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.