Hello!

Piotr Sipika has written on Monday, 27 July, at 23:02:
>On 07/26/2015 04:50 AM, John Whitmore wrote:

>> Another question there is that [1] has added text "TP-1" to the panel plugin
>> but that text is not showing up for me :-( Not sure where to start. Might 
>> have
>> to read a whole volume on GTK Development.
>A plugin is just a widget inside of an EventBox used to handle user
>interactions. It seems that the pre-0.7 version of the wiki page[1] had
>a gtk_widget_show_all() call, whereas the post-0.7 version does not have
>it[2].  I've updated the page -- see if gtk_widget_show_all(p) makes the
>label appear.

    No, that is wrong, gtk_widget_show_all(p) is not ever required. The
panel itself will handle showing the widget, it's why it was removed from
the updated page. On other side, the gtk_widget_show(pLabel) should've
been added instead, and I've added that missing call into Wiki page two
days ago. I'm sorry that I didn't mentioned that in the mailing list.

>> The last question would be how does that plugin get updated? I can't see any
>> mechanism to update the status of the displayed info. I really want to use
>> this plugin to display the status of a connected device. So A Daemon, 
>> probably
>> python, would monitor the device and notify the plugin of changes in
>> status. What would be used there? DBus to talk to the panel plugin? But how 
>> do
>> you get the plugin to check every few seconds?
>Updating the GUI can get a bit tricky.  One thing to keep in mind is
>that the GUI operates on one thread and only that thread should update
>the widgets (you can update the GUI from other threads, but it requires
>playing with things like g_threads_init, gdk_thread_enter and _leave[3]).

    In general, threads are required if your operation is time consuming,
like network connection or scanning a disk, etc. If your update is just
reading a list from some file or query a kernel data then thread is more
slow operation than doing it in timeout callback which is a pretty good
convenience API in GLib, it's why most of plugins never use threads for
their updates.

    With best regards,
    Andriy.

------------------------------------------------------------------------------
_______________________________________________
Lxde-list mailing list
Lxde-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxde-list

Reply via email to