Problems in Introspection while developing app in javascript
- From: Mohan R <mohan43u gmail com>
- To: gtk-devel-list gnome org
- Subject: Problems in Introspection while developing app in javascript
- Date: Fri, 30 Nov 2012 14:35:43 +0530
Hi,
I'm developing a twitter library and an app for a while.
https://github.com/mohan43u/gtweet/
I'm facing following issues which I'm not able to solve.
1. g_simple_async_result_get_op_res_gpointer() was not introspectable
which prevented me to effectively write a async function. Take a look at
gtweet_generic_callback() function at line 1083,
https://github.com/mohan43u/gtweet/blob/master/lib/tweet-object.c
Instread of setting "stream_response" property, I should have used
g_simple_async_result_set_op_res_gpointer() and should have used
g_simple_async_result_get_op_res_gpointer() to take the chunk of data
coming from twitter in GAsyncReadyCallback (through javascript). But
because of introspection, I have to introduce "stream_response" property
to workaround.
2. Gtk.CssProvider.load_from_data() and Gtk.CssProvider.load_from_path()
not working. Here is an example script,
http://pastebin.sabayon.org/pastie/11336
3. GLib.Thread.new() not introspectable. If I have thread support, I can
make the twitter app much more useful by adding streaming functionality.
I believe, there is thread support in gjs. But, I'm not able to find one
example.
The twitter app(exec/twitterclientgtk.js) is working now. But, I feel
without realtime updates, there is no benefit for yet another twitter
client. I can't do it without threads. Need some help to implement
threading through javascript.
I feel current code examples in developers.gnome.org is missing lot of
informantion to write gtk app in javascript, few thing I fould,
1. Information about functions inside lang.js and signals.js.
Especially, class(), bind(), connect() and emit(). Although examples are
inside gjs source tree, It will be helpful to have a proper
documentation page.
2. Information about howto get values in out parameters (like "button"
parameter in gdk_event_get_button()). No examples provided even in gjs
source. I got a hint from this thread, and figured out how to do it.
https://mail.gnome.org/archives/commits-list/2012-January/msg11220.html
If someone is working on improving javascript documentation, I'm willing
to help. We need more javascript examples.
Thanks,
Mohan R
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]