Kurt Dresner
2004-Jul-23 09:07 UTC
[Wxruby-users] Problems using network code and trying to add a GUI
Hi folks, I''m new to wxRuby, but I''ve heard so many great things about wx that I wanted to try it for a program I''m trying to write. What I want is this: I have an application (server) that will accept connections from clients through TCP, which then play a game through it. As things change in the game (players coming and going, games being won and lost), I want things to update in the GUI. I am trying to do this in such a way that I can use a text mode or curses mode if I want. Basically I have a bunch of hooks that get called in the server to a generic "output object" and I want my GUI to be one of those objects. Here''s the problem: Every time I try something like this, be it curses or graphically based, I have problems with things updating. Nothing wants to update on my GUI unless I''m moving my mouse around over it, (or in curses unless I''m hitting keys). What does this mean? Am I not getting some fundamental concept of GUI programming? What approach should I take? Why is GUI programming so hard for me in any language other than Java/Swing? Thanks, Kurt
Nick
2004-Jul-23 09:19 UTC
[Wxruby-users] Problems using network code and trying to add a GUI
Does your main loop yield at all to the GUI object, or does it block on waiting for TCP messages? I''m pretty sure wxWidgets runs within the same thread as your main loop, which would mean if you''re blocked on I/O that you''re not updating the GUI. My 2 cents. Nick Kurt Dresner wrote:>Hi folks, I''m new to wxRuby, but I''ve heard so many great things about >wx that I wanted to try it for a program I''m trying to write. > >What I want is this: > >I have an application (server) that will accept connections from >clients through TCP, which then play a game through it. As things >change in the game (players coming and going, games being won and >lost), I want things to update in the GUI. I am trying to do this in >such a way that I can use a text mode or curses mode if I want. >Basically I have a bunch of hooks that get called in the server to a >generic "output object" and I want my GUI to be one of those objects. > >Here''s the problem: > >Every time I try something like this, be it curses or graphically >based, I have problems with things updating. Nothing wants to update >on my GUI unless I''m moving my mouse around over it, (or in curses >unless I''m hitting keys). > >What does this mean? Am I not getting some fundamental concept of GUI >programming? What approach should I take? Why is GUI programming so >hard for me in any language other than Java/Swing? > >Thanks, > >Kurt >_______________________________________________ >wxruby-users mailing list >wxruby-users@rubyforge.org >http://rubyforge.org/mailman/listinfo/wxruby-users > > > > >
Kurt Dresner
2004-Jul-23 13:23 UTC
[Wxruby-users] Problems using network code and trying to add a GUI
I spawn a separate thread for dealing with all the communication stuff. It''s the GUI that seems to freeze up unless I''m moving the mouse around over it. -Kurt On Fri, 23 Jul 2004 08:18:14 -0500, Nick <devel@nicreations.com> wrote:> > Does your main loop yield at all to the GUI object, or does it block on > waiting for TCP messages? I''m pretty sure wxWidgets runs within the same > thread as your main loop, which would mean if you''re blocked on I/O that > you''re not updating the GUI. > > My 2 cents. > > Nick > > > > Kurt Dresner wrote: > > >Hi folks, I''m new to wxRuby, but I''ve heard so many great things about > >wx that I wanted to try it for a program I''m trying to write. > > > >What I want is this: > > > >I have an application (server) that will accept connections from > >clients through TCP, which then play a game through it. As things > >change in the game (players coming and going, games being won and > >lost), I want things to update in the GUI. I am trying to do this in > >such a way that I can use a text mode or curses mode if I want. > >Basically I have a bunch of hooks that get called in the server to a > >generic "output object" and I want my GUI to be one of those objects. > > > >Here''s the problem: > > > >Every time I try something like this, be it curses or graphically > >based, I have problems with things updating. Nothing wants to update > >on my GUI unless I''m moving my mouse around over it, (or in curses > >unless I''m hitting keys). > > > >What does this mean? Am I not getting some fundamental concept of GUI > >programming? What approach should I take? Why is GUI programming so > >hard for me in any language other than Java/Swing? > > > >Thanks, > > > >Kurt > >_______________________________________________ > >wxruby-users mailing list > >wxruby-users@rubyforge.org > >http://rubyforge.org/mailman/listinfo/wxruby-users > > > > > > > > > > > > _______________________________________________ > wxruby-users mailing list > wxruby-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users >
Nick
2004-Jul-23 15:44 UTC
[Wxruby-users] Problems using network code and trying to add a GUI
It''s been my observation Ruby threads are implemented at the interpreter level (not at they system level), so if one thread blocks on a system call the others won''t run. It may not be what you''re seeing though. Nick Kurt Dresner wrote:>I spawn a separate thread for dealing with all the communication >stuff. It''s the GUI that seems to freeze up unless I''m moving the >mouse around over it. > >-Kurt > >On Fri, 23 Jul 2004 08:18:14 -0500, Nick <devel@nicreations.com> wrote: > > >>Does your main loop yield at all to the GUI object, or does it block on >>waiting for TCP messages? I''m pretty sure wxWidgets runs within the same >>thread as your main loop, which would mean if you''re blocked on I/O that >>you''re not updating the GUI. >> >>My 2 cents. >> >>Nick >> >> >> >>Kurt Dresner wrote: >> >> >> >>>Hi folks, I''m new to wxRuby, but I''ve heard so many great things about >>>wx that I wanted to try it for a program I''m trying to write. >>> >>>What I want is this: >>> >>>I have an application (server) that will accept connections from >>>clients through TCP, which then play a game through it. As things >>>change in the game (players coming and going, games being won and >>>lost), I want things to update in the GUI. I am trying to do this in >>>such a way that I can use a text mode or curses mode if I want. >>>Basically I have a bunch of hooks that get called in the server to a >>>generic "output object" and I want my GUI to be one of those objects. >>> >>>Here''s the problem: >>> >>>Every time I try something like this, be it curses or graphically >>>based, I have problems with things updating. Nothing wants to update >>>on my GUI unless I''m moving my mouse around over it, (or in curses >>>unless I''m hitting keys). >>> >>>What does this mean? Am I not getting some fundamental concept of GUI >>>programming? What approach should I take? Why is GUI programming so >>>hard for me in any language other than Java/Swing? >>> >>>Thanks, >>> >>>Kurt >>>_______________________________________________ >>>wxruby-users mailing list >>>wxruby-users@rubyforge.org >>>http://rubyforge.org/mailman/listinfo/wxruby-users >>> >>> >>> >>> >>> >>> >>> >>_______________________________________________ >>wxruby-users mailing list >>wxruby-users@rubyforge.org >>http://rubyforge.org/mailman/listinfo/wxruby-users >> >> >> >_______________________________________________ >wxruby-users mailing list >wxruby-users@rubyforge.org >http://rubyforge.org/mailman/listinfo/wxruby-users > > > > >