Re: Gjs run() function blocks execution of code after that



once you run the app you can use callbacks to execute your code, including the one triggered on show.

I have few examples of regularly executed code here and there, including:

  1. jsgtk-twitter https://github.com/WebReflection/jsgtk-twitter
  2. jsgtk-examples https://github.com/WebReflection/jsgtk-examples
  3. the previous repo is baed on GJS examples: https://github.com/optimisme/gjs-examples#gjs-examples

Last, but not least, there are examples in jsgtk too:
https://github.com/WebReflection/jsgtk/tree/master/examples

Regards



On Sun, Apr 9, 2017 at 3:31 PM, Łukasz Godlewski <l godlewski live com> wrote:
Hi,

I'm working on creating a Proof of Concept that Gtk widgets can be built and managed using Gjs as React.js and I'm almost there, but there is a problem. Generally, after the application is launched (the run() function is called on the gtkApplication object) the application window appears and rest of code (after that line) is not executed until the application is closed. I guess some loop is initialized by the run() function and rest of code is executed when this loop is broken. 

I know the callbacks of signals are executed but it's not enough because when I create a React component and want to change its state, I'm calling the standard setState(...) function which is asynchronous and unfortunately this function is not executed until the application is closed/the loop is broken.
Can it be solved somehow? Is there a function pausing this loop? Or have you any suggestion how to solve that problem?

Thanks!
Łukasz Godlewski

_______________________________________________
_javascript_-list mailing list
_javascript_-list gnome org
https://mail.gnome.org/mailman/listinfo/_javascript_-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]