MrmFetchWidget

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

Questions about motif? Contact us

2 posts / 0 new
Last post
MrmFetchWidget

Submitted by Anonymous on Mon, 03/05/2001 - 22:30. Developers
I programm with OSF MOTIF but I have the following problems

My programm is built like that

I have 3 windows to display and 3 uil files

So I declare String uid_file_name = {"file1.uid", "file2.uid", "file3.uid"};

In main()
---------------
I make a MrmFetchWidget of main_window1 on top_level
and a XtManageChild of main_window1

In the same file of main()
-------------------------------------
I have two functions f1 and f2 which make

In the firstone
MrmFetchWidget of main_window2 on top_level
and a XtManageChild of main_window2 on top_level

In the secoundone
MrmFetchWidget of main_window3
and a XtManageChild of main_window3

In file1.uil
--------------
This file displays the main_window1.
In this file I call a function which displays a FormDialog.
For example
XmNactivateCallback function(main_window1);

The first window and form dialog are good displayed.
But when I want to display the secound window, I can`t make it.

void function(Widget w, XtPointer client_data, XtPointer call_data)
{
Widget target = (Widget) client_data;
...
XtDestroyWidget(target)
f1(target);
...
}

PROBLEM The secound window doesn`t display.

In file2.uil
--------------
This file displays the main_window2...normally
In this file I call a function which displays a FormDialog.
For example
XmNactivateCallback function_bis(main_window2);

void function_bis(Widget w, XtPointer client_data, XtPointer call_data)
{
Widget target = (Widget) client_data;
...
XtDestroyWidget(target)
f2(target);
...
}

But what I don`t understand is that if I make in main()
MrmFetchWidget of main_window2, and XtManageChild(main_window2)
main_window2 is good displayed and
then main_window3 is displayed!!!

I don`t know where is the problem?
Variables main_window1,2,3 are global....

Should I Fetch on top_level all the main_window....however I tried to make it without success.

If you could respond to a french progammer, I`ll very happy.
Transmit this message to persons who could have an idea.

Thank you very much.

--Emile

ICS_support

Without delving into your problems, I can say that this bit of code

XtDestroyWidget(target);
f2(target);

is no good. Once you destroy a widget, you shouldn`t be doing anything with its value except removing the ID from local caches.

Note also that you`ll want to be sure to preserve the parent ID value so that you can fetch the
children widget into it.