Re: [gnet] GNet and Gtk



Hi,

El dt 04 de 01 del 2005 a les 18:51 +0100, en/na Bruno Dusausoy va
escriure:
> Hi,
> 
> I will break the silence surrounding this mailing-list for quite a
> moment now. But beware, this is a *newbie* question ;).
> 
> I'd like to make a simple example. It's a modified echoserver. It
> doesn't print what it gets on the console, but instead it prints it out
> in a gtk widget.
> Well, it should do that, but don't do it at the moment.

A while ago I tried to do the same as you. I made a echo-server alike
application that used GTK widgets instead of the console to display the
echo messages. The source code is here:
http://www.dsv.su.se/~icss-jpc/nello.tgz


It was my first attempt to both use gnetlib and GTK+, and it was mostly
to learn the API and get going, so the code might hurt some refined
hacker's eyes :).
Anyway, it consists of a server and a client. The client presents a
window much like an IRC client. Several clients may connect to the
server, which will echo any message received to all connected clients,
and to stderr in the console.

If the code helps you, that would be nice! If not, well, another piece
of crappy code polluting the net won't hurt :)

Regards!

/Josep

> 
> Instead, depending where I put the gtk_main() function, it showed
> nothing (no window appearing), or it showed the window but didn't update
> the widget that i was trying to change.
> 
> My problem seemed related to gtk_main(), the main loop.
> I don't know where to put it in order to make the whole stuff working
> good.
> I did some essays/errors but couldn't figure where to put it.
> 
> Then I began to think harder. Maybe it's because I was trying to modify
> the "standard" echoserver.c program. And maybe this program used
> synchronous system calls that made the "GUI" freeze or not respond.
> 
> Should I modigy an asynchronous version of the server, or am I thinking
> wrong ?
> 
> Sorry for my bad English.
> 
> Regards.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]