Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!uunet!mcsun!hp4nl!utrcu1!mi.eltn.utwente.nl!klamer From: klamer@mi.eltn.utwente.nl (Klamer Schutte) Newsgroups: comp.sys.atari.st.tech Subject: Re: Going from X11 to GEM Keywords: X11, GEM, Viola Message-ID: Date: 2 May 91 14:47:13 GMT Article-I.D.: mi.klamer.673195633 References: <1991Apr28.194206.1750@oz.plymouth.edu> Sender: news@utrcu1.UUCP Organization: University of Twente, BSC-El Lines: 45 In <1991Apr28.194206.1750@oz.plymouth.edu> oddjob@oz.plymouth.edu (Andrew C. Stoffel) writes: >Does anybody have any experience porting programs built on the X11 >model of client-server programs to GEM (or anything else) on the ST ? >(I know..... I COULD wait until I could afford a TT and *nix..) This is not as difficult as it seems. The other way around is a lot more difficult! What you have to do is: 0) When initialising the program register all client functions (You want to get a pointer to them). 1) make a endless loop in your program 2) put in there an event_multi and a (huge) switch statement 3) at all switch labels, see iff there is a client, and do him or if there is no client, do the default. Here is an example of untested pseudo code: register_clients(); while(1) { event_multi( all options enabled ); switch( type off message ) case keyevent: find_active_window(); if (there_is_a_client(window)) (*do_client_function( window, key ); else do_default_key_action(window); break; case mousevent: ... ... } >Anyone got any ideas ??? Comments ??? Comments ??? Klamer -- Klamer Schutte Faculty of electrical engineering -- University of Twente, The Netherlands klamer@mi.eltn.utwente.nl {backbone}!mcsun!mi.eltn.utwente.nl!klamer