Posts

Showing posts from May, 2007

Faster ListStore

Your are wondering why ListStore.append() is so slow in your code? No more turtle-soft: disconnect the view and the store by doing TreeView.set_model(None), edit the ListStore, and then reconnect them. Tadaaa, this is just thousands of time faster here...

Returning a array of structs with dbus-glib

I was looking for an example on how to return an array of struct in a D-Bus program, and I found nothing. So here is a fast note for later reference. This is pseudo code, just to show you how to proceed. So you want to return a "a(si)", that's it, an array of struct containing each a string and an integer. in your example.xml: (process with dbus-binding-tool as usual) <node name="/com/example/Example"></node> <interface name="com.example.Example"></interface> <method name="getExampleArray"></method> <arg type="a(si)" name="array" direction="out"></arg> </method> </interface> </node> in your example.c: // you define your structure here by using get_struct #define DBUS_STRUCT_STRING_INT (dbus_g_type_get_struct ("GValueArray", G_TYPE_STRING, G_TYPE_INT, G_TYPE_INVALID)) gboolean desktoptracks_get_example_array(De...