Need help with first steps

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

Questions about motif? Contact us

4 posts / 0 new
Last post
Need help with first steps

Submitted by Anonymous on Thu, 02/22/2001 - 00:12. Developers
Dear Forum,

i have some experience with developing MS Windows applications with the SDK and MFC, but now i am migrating to Solaris/CDE/Motif and need some help with my first project.

The program which i will write is a kind of hexeditor or kind of graphical memory dumper/debugger. The memory content is shown in a table. So far i could do that with a simple (read-only) text widget, but now it gets complicated, because the user should be able to change the memory content.

What i came up to is that when a click occurs i just create a borderless text field at the coordinates of the click, then the user can edit the memory content which was shown at that coordinate in the client window, and afterwards i will remove the text field again, update the memory, and redraw the screen. But i don`t know if this is a good idea, since i really have not much experience with Motif.

So i am asking you guys, and you should know it better then me ) Is there any way you would recommend me to proceed?

Thanks
Chris

ICS_support

That`s not entirely unreasonable, but it sounds to me like you`re working around the limitations in the Text widget. While Motif is fairly complete, it is designed so that you can add new pieces to it -- new widgets that are better at doing what you want them to do than existing widgets.

Now, the approach you describe is reasonble. It is used by the XiTable in the EPak widget set, for example. I think it may also be used by the XbaeMatrix.

The boundaries of your program suggest both some problems and some shortcuts you can take. In particular, you`d need to display the text in a fixed-width font, which presents a problem. But you have some advantages in that the user is not modifying arbitrary amounts of text, so you can create a tabular display and update the data as the ASCII versions change. I`d really look at making a simple text-display widget which can handle column-oriented text; and you can tie two together to handle ASCII and hex data for a joint display.

While this is a lot to bite off for a first project, it may save you a lot of frustration in trying to bend Motif widgets to do other things.

(And if you do take the approach you suggested, you should also look at some of the existing editors out there, particularly NEdit.)

Anonymous

Dear dbl,

thanks for your message, i appreciate it very much.

I have two weeks for a prototype, so i think i will just try the way with the text field, disable user editing, and then somehow try to find some tweaks to please my boss.

I had a short glance at NEdit - a fairly complex project, i will have a look at it in more detail soon. And if the text field idea won`t work i will switch to a table widget like XiTable/XbaeMatrix.

Thanks,
Chris

ICS_support

OK! We`ll look for the Motif version of "od"!