Resources database (Xrm*) - Xwindows

This is a discussion on Resources database (Xrm*) - Xwindows ; I see there is a nice set of routines (Xrm*) for creating and manipulating a database of resources. So I can merge databases, add/remove new resources, augment them by parsing the command line, and so on. I can also create ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Resources database (Xrm*)

  1. Resources database (Xrm*)

    I see there is a nice set of routines (Xrm*) for creating and
    manipulating a database of resources. So I can merge databases, add/remove
    new resources, augment them by parsing the command line, and so on.

    I can also create a display for a new application by using XtOpenDisplay,
    or XtDisplayInitialize, and they usually call the proper Xrm* routines in
    a sensible manner.

    However, on occasions one may need to do some unusual hacking on the
    resource database. One can get hold of the database created by
    XtDisplayInitialize using XtDatabase, and even use it as the basis for
    creating another database by merging, etc. But what you cannot do is to
    use the new database you have created (e.g. by storing it back into the
    display so it can be seen by other Intrinsics routines).

    This is because XtDatabase only gives you an (XrmDatabase) value, and all
    the routines that produce new databases require an (XrmDatabase *)
    parameter. Now, for sure there exists an (XrmDatabase *) fields somewhere
    inside the Display struture, but that structure is opaque, and there is
    no macro provided to access it.

    So what possible use are all the Xrm* routines if there is no way to make
    use of them? Or is there some way to do what I want?

    --
    Charles H. Lindsey ---------At Home, doing my own thing------------------------
    Tel: +44 161 436 6131 Fax: +44 161 436 6133 Web: http://www.cs.man.ac.uk/~chl
    Email: chl@clerew.man.ac.uk Snail: 5 Clerewood Ave, CHEADLE, SK8 3JU, U.K.
    PGP: 2C15F1A9 Fingerprint: 73 6D C2 51 93 A0 01 E7 65 E8 64 7E 14 A4 AB A5

  2. Re: Resources database (Xrm*)


    "Charles Lindsey" wrote in message
    news:Itx2Mt.64A@clerew.man.ac.uk...
    >I see there is a nice set of routines (Xrm*) for creating and
    > manipulating a database of resources. So I can merge databases, add/remove
    > new resources, augment them by parsing the command line, and so on.
    >
    > I can also create a display for a new application by using XtOpenDisplay,
    > or XtDisplayInitialize, and they usually call the proper Xrm* routines in
    > a sensible manner.
    >
    > However, on occasions one may need to do some unusual hacking on the
    > resource database. One can get hold of the database created by
    > XtDisplayInitialize using XtDatabase, and even use it as the basis for
    > creating another database by merging, etc. But what you cannot do is to
    > use the new database you have created (e.g. by storing it back into the
    > display so it can be seen by other Intrinsics routines).
    >
    > This is because XtDatabase only gives you an (XrmDatabase) value, and all
    > the routines that produce new databases require an (XrmDatabase *)
    > parameter. Now, for sure there exists an (XrmDatabase *) fields somewhere
    > inside the Display struture, but that structure is opaque, and there is
    > no macro provided to access it.
    >
    > So what possible use are all the Xrm* routines if there is no way to make
    > use of them? Or is there some way to do what I want?
    >
    > --
    > Charles H. Lindsey ---------At Home, doing my own
    > thing------------------------
    > Tel: +44 161 436 6131 Fax: +44 161 436 6133 Web:
    > http://www.cs.man.ac.uk/~chl
    > Email: chl@clerew.man.ac.uk Snail: 5 Clerewood Ave, CHEADLE, SK8 3JU,
    > U.K.
    > PGP: 2C15F1A9 Fingerprint: 73 6D C2 51 93 A0 01 E7 65 E8 64 7E 14 A4
    > AB A5


    XrmDatabase db;
    .....
    SomeXrmFunctionNeedingPointer (&db );

    &db is an (XrmDatabase *)

    --
    Fred L. Kleinschmidt
    Boeing Associate Technical Fellow
    Technical Architect, Software Reuse Project




  3. Re: Resources database (Xrm*)

    In "Fred Kleinschmidt" writes:

    >"Charles Lindsey" wrote in message
    >news:Itx2Mt.64A@clerew.man.ac.uk...
    >>I see there is a nice set of routines (Xrm*) for creating and
    >> manipulating a database of resources. So I can merge databases, add/remove
    >> new resources, augment them by parsing the command line, and so on.
    >>
    >> I can also create a display for a new application by using XtOpenDisplay,
    >> or XtDisplayInitialize, and they usually call the proper Xrm* routines in
    >> a sensible manner.
    >>
    >> However, on occasions one may need to do some unusual hacking on the
    >> resource database. One can get hold of the database created by
    >> XtDisplayInitialize using XtDatabase, and even use it as the basis for
    >> creating another database by merging, etc. But what you cannot do is to
    >> use the new database you have created (e.g. by storing it back into the
    >> display so it can be seen by other Intrinsics routines).
    >>
    >> This is because XtDatabase only gives you an (XrmDatabase) value, and all
    >> the routines that produce new databases require an (XrmDatabase *)
    >> parameter. Now, for sure there exists an (XrmDatabase *) fields somewhere
    >> inside the Display struture, but that structure is opaque, and there is
    >> no macro provided to access it.
    >>
    >> So what possible use are all the Xrm* routines if there is no way to make
    >> use of them? Or is there some way to do what I want?


    >XrmDatabase db;
    >....
    >SomeXrmFunctionNeedingPointer (&db );


    >&db is an (XrmDatabase *)


    No, that does not help. I can easily construct db and put into it all the
    resources I want, garnered from all the places I choose (including the
    ones assembled by XtDisplayInitialize).

    But now I want to create some widgets that take their resources from the
    database I have constructed. To do that, I need my new database to become
    the one associated with the Display, and there is now way to do that that
    I can see.

    --
    Charles H. Lindsey ---------At Home, doing my own thing------------------------
    Tel: +44 161 436 6131 Fax: +44 161 436 6133 Web: http://www.cs.man.ac.uk/~chl
    Email: chl@clerew.man.ac.uk Snail: 5 Clerewood Ave, CHEADLE, SK8 3JU, U.K.
    PGP: 2C15F1A9 Fingerprint: 73 6D C2 51 93 A0 01 E7 65 E8 64 7E 14 A4 AB A5

  4. Re: Resources database (Xrm*)

    "Charles Lindsey" writes:

    > But now I want to create some widgets that take their resources from
    > the database I have constructed. To do that, I need my new database
    > to become the one associated with the Display, and there is now way
    > to do that that I can see.


    to me, what you want to do looks like what "xrdb -merge somefile"
    (xrdb (1)) is meant to do

    maybe you could look into xrdb's sources

+ Reply to Thread