Responsive UI or stability ?

Gtk# is not a thread-safe toolkit, which means that only one thread at a time can safely invoke methods on Gtk#. This thread is typically the thread executing the main loop (which is when control has been explicitly transfered to Gtk).

So basically using threads means making application more responsive, so the big calculations and long timeouts don’t effect the UI. Which is good. But the above text says that other threads shouldn’t touch UI, if so the application will hang unpredictably. So if I want to make changes to GTK# UI I need to use Gtk.Application.Invoke, but I’m having problems with Liststore which stores all the data in the Treeview, it just won’t work.

So I made a temporary fix by sacrificing Responsive UI for stability. The 0.2.1 version of gTwitter reflects that.

Use 0.2 version if you want responsive application, or use the 0.2.1 if you want it stable. (Note that this is just a temporary solution until I figure out what to do with liststore issue)

13 Responses to Responsive UI or stability ? »»


Comments

  1. Comment by devicerandom | 2007/03/15 at 17:00:36

    I’ve never used gtk# or C#, but I know the very same issues arise when using threads the WxWidgets toolkit under Python (that in turn wraps Gtk on Linux). The mantra is: “GUI manipulations should only happen in the GUI thread”.

    I solved the issue this way:
    1) use custom events for nonGUI –> GUI communication
    2) use a shared python Queue object for GUI—>nonGUI communication (I’m sure Mono has an equivalent in its standard library)

    I’d like to help you, but unfortunately I don’t know c# nor Gtk.

  2. Comment by Frank | 2007/03/15 at 18:33:20

    Hi Nil,

    thanks for your work - just installed gTwitter the first time (0.2.1) and works good so far (except the performance problems of twitter itself).

    Do you think you could integrate the username in one of the next versions? this could be helpful for private messages.

    Thanks,
    Frank
    http://twitter.com/helmi

  3. Comment by ghaefb | 2007/03/15 at 19:02:39

    Hey Frank.

    I don’t quite understand what you mean by “integrating usename”.
    I guess I need to look into twitter private messaging…

    @devicerandom

    Thanks for the info… I’ll figure it out.

  4. Comment by Frank | 2007/03/16 at 08:15:57

    Hey Nil,

    for private messaging you have to send “D $username $message” and the recipient get’s the private message by mail most of the time.

    In the current gTwitter GUI i don’t see the usernames of the others - i just see the fullnames so it’s kinda hard to send them private messages.

  5. Comment by ghaefb | 2007/03/16 at 08:45:20

    I see, so technically private messaging works on gTwitter if you know the persons username.
    Cool, I’ll make usernames visible somehow.
    Thanks

  6. Comment by devicerandom | 2007/03/16 at 09:14:35

    I speak for my case: to let the non-GUI part talk to the GUI, basically I make the non-GUI emit a custom Wx “event”, that works like a GUI event just like a rightbuttonclick event, let’s say. The event itself is an object that can contain any variable you like, so it can carry any data. You then, in the GUI thread, bind what you want to answer to the custom event, just like you were binding a mouse click.

  7. Comment by Kayatbalf | 2007/11/29 at 21:43:33

    I am glad to find this forum !
    http://danuegonax.com
    Wow! Good resources here, Enjoyed the visit!

  8. Comment by Kayatbalf | 2007/11/30 at 13:40:51

    Excellent forum with fantastic references and reading…. well done indeed…
    http://srubibablo.com
    There was merrily!

  9. Comment by Kayatbalf | 2007/12/19 at 12:38:08

    I simply mad about this forum!
    http://unikont.com
    I simply mad about this forum!

  10. Comment by dareTriera | 2008/03/19 at 07:32:43

    Good aftenoon !
    http://renerpal.com
    The Author, you - super hero!
    So interesting there was that I fell asleep…


Trackbacks & Pingbacks »»

  1. Trackback by Prevacid. | 2008/04/20 at 20:36:47

    Prevacid side effects….

    Prevacid side affects. Prevacid cut dose. Prevacid. Prilosec versus prevacid….

  2. Trackback by Nextel 2-way radio phone systems. | 2008/05/09 at 07:50:28

    Cordless iwatsu phone systems….

    Cordless phone systems. History of automated phone systems. Business phone systems and minnesota. Expandable 2 line phone systems. 4 line phone systems cordless handset. Nortel phone systems. Wireless phone systems. Phone number for sea systems. At t p…

  3. Trackback by Generic prevacid. | 2008/06/07 at 00:24:03

    Prevacid generic….

    Generic prevacid….

Leave a Reply »»