Using X Motif on previously developed X windows application

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

2 posts / 0 new
Last post
Using X Motif on previously developed X windows application

Submitted by Anonymous on Tue, 06/24/2003 - 19:26. General Questions
We have a program running with X Windows. And now we want to add push button and menu bar features. In order to simplify the coding, we want to use X Motif to build the push button widget. Does anybody know how to integrate a software based on X windows with X motif? (the functions need to be used, or what methods can be used to communicate between X WIndows and X Motif)

ICS_support

It`s both harder and easier than you would think. The job is easier because X and Motif are closely related -- Motif is built on Xt, which uses X. The layers relate. But the job is harder because the style of programming is so different. In an Xlib program, the main loop is typically a big switch which maps the various events that can occur within a application to the code that handles the user actions. In a Motif program, the main loop is handled within Xt; it does the same dispatching. The functions, rather than being called directly, are called from Xt. So the good news is that the functional code is probably going to be similar; but the bad news is that you have to turn your program inside-out and have it move to the callback model.

(A program such as BX can help you create the interface; you can then adapt your back-end functions to this interface.)