move values form running code to UIL files

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

Questions about motif? Contact us

5 posts / 0 new
Last post
move values form running code to UIL files

Submitted by orank on Mon, 01/28/2002 - 16:07. Developers
Hi ,
This is a very esoteric question (I think) . . .

I have a application that creates widgets using a UIL file and MrmFetchWidget.
My problem
I need to set a special color map (that I create manually) to the widgets in the UIL file. and it must be done on creation and not after the MrmFetchWidget. (if I don?t set the values the MrmFetchWidget failes with a X error because the colormaps of the widgets does not match the rest on the widgets in my application).

On widgets I create manually and not trough a UIL file I do the following
XtSetArg(args[n],XmNcolormap, colormap); n++;
XtSetArg(args[n],XmNvisual, visInfo->visual); n++;
XtSetArg(args[n],XmNdepth, visInfo->depth); n++;

(the colormap and the visual are different then the default visual set in the X server)

My question
Is there a way to transfer the values (visInfo, colormap) from the running code to the UIL file before (or in the process) of the Read from the UIL ?

ICS_support

Probably not. Those are dynamic values which will depend on the server available, and not the static values (fixed resources and layouts) that are supported in UIL.

But there is a hook, in the MrmNcreateCallback, for exactly this situation. Your application gets a callback with the ID of the newly-created widget. This may work for you. You may also need to create the shell in the application code and then create the widgets via MrmFetchWidget, to create the bulk of the application interface.

orank

Hi dbl ,
I hope you can answer to this question too.

I did what you suggested, I added the create callback and tried to change the visual, depth and colormap of the widgets in the create call back. But I a get X error, that mean probably that I cant change the visual,depth and colormap of the widgets since they are already created. I might be wrong but I guess I need to create the widgets with the special visual,depth and colormap that I need.

is there a way to transfer the Visual ID that my application is using to the Mrm created widgets before creating something in the Mrm init or Mrm open Hierarchy ? I found that there is a MrmOpenHierarchyPerDisplay but it does not help ether. Maybe I can transfer something in the MrmOsOpenParam ?

thanks in advence . . thanks so much

Anonymous

You cannot access parts of a widget`s window in the CreateCallback since the widget is not yet realised. It has no window to work with, hence the X errors.

orank

Hi all,
I found a way to deal with this situation. That means I can insert runtime values to constant UIL files using identifiers.

I can send the values of the visual, depth and colormap from my application to the Mrm file by using a door into the Uil File called ?identifier?.

I define the var?s in the C code , like this
Static MRMRegisterArg register_object[] = {
{?Name1?,NULL},
{?Name2?,NULL},
{?Name3?,NULL}
};

I set the values in the C code, like this

register_object[0].value = vis_info->visual;
register_object[1].value = vis_info->depth;
register_object[2].value = colormap;

And then register them to the UIL file, like this
MrmRegisterNames(register_object,XtNuber(register_object))

In the beginning of the UIL file I write
Identifier
Name1;
Name2;
Name3;

Then I can use these values in the UIL file Now , the values can be anything you want. Because a void* pointer is transferred.

ALL THE BEST,
Oran Kushnir
Phone +972-9-9594713
E-mail orank@tecnomatix.com