yes, if I do that, the new value is "".
i.e., XrmGetResource returns true.
If you need it to return false, you could set it to "False" or "0".
If you need to remove it from the database, then try
xrdb -remove ...
or check the xrdb source to see which functions is it calling.
Best regards,
Dušan Peterc
http://www.arahne.si
XrmGetResource will still return true, right?
the users of the resource will think that the XrmValue contains a
valid value.
> If you need to remove it from the database, then try
> xrdb -remove ...
> or check the xrdb source to see which functions is it calling.
"xrdb -remove" removes the whole database, not the individual
property.
it calls XDeleteProperty on the root screen.
thanks for your kind reply.
,--- sds@gnu org writes:
[...]
| "xrdb -remove" removes the whole database, not the individual
| property.
| it calls XDeleteProperty on the root screen.
Hmm..., so this means resources are stored in root windows's
properties. Just figured out that 'xprop -root |grep
^RESOURCE_MANAGER' dumps the resources, so looks like you need to
parse the value of 'RESOURCE_MANAGER' property, remove the desired
property from the string, and reset the 'RESOURCE_MANAGER'
property with new string.
But this'll be an overkill.
| thanks for your kind reply.
Thanks for hinting that resources are stored in root window :) .
HTH
- --
Ashish Shukla आशीष शुक्ल http://wahjava.wordpress.com/
·-- ·- ···· ·--- ·- ···- ·- ·--·-· --· -- ·- ·· ·-·· ·-·-·- -·-· --- --
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFHS97WHy+EEHYuXnQRAs+9AKDI2hEkXk78U7B1Hx9SwKZeBKDCSgCfWlwk
Drv7ea0WUPJO1GDgE1XtUac=
=6NA+
-----END PGP SIGNATURE-----
actually, there is a more direct way to the string:
XResourceManagerString().
note however, that this gives me access to the resource database
associated with the X server.
what if I am manipulating an rdb which is not associated with the
server?
[snipped]
|> Hmm..., so this means resources are stored in root windows's
|> properties. Just figured out that 'xprop -root |grep
|> ^RESOURCE_MANAGER' dumps the resources, so looks like you need to
|> parse the value of 'RESOURCE_MANAGER' property, remove the desired
|> property from the string, and reset the 'RESOURCE_MANAGER'
|> property with new string.
|
| actually, there is a more direct way to the string:
| XResourceManagerString().
| note however, that this gives me access to the resource database
| associated with the X server.
| what if I am manipulating an rdb which is not associated with the
| server?
You mean manipulating .Xresources file, right ? For that, refer to the
source code of xrdb.c, which ships with Xorg.
HTH
no.
I want to remove a given specific binding from a given database object
using C code.
i.e., I do not want to write the rdb to a file, edit it with vi/emacs/
grep -v, and then load it back.
I want a function that would revert the effects of
XrmPutStringResource(&rdb,"Foo.Bar.Baz","Zot")
i.e., such that after I call it,
XrmGetResource(rdb,"Foo.Bar.Baz","*.*.*",...)
would return "false", as it did before the XrmPutStringResource call.
xrdb.c, IIUC, removes the whole database from the display, not an
individual entry from a given database.
Sam.
> I want to remove a given specific binding from a given database object
> using C code.
I don't see any such function in libx11-1.0.0/src/Xrm.c.
It would have to Xfree the entry, but the Xfree calls in
the source do not seem suitable.
What you can do:
- Change your requirements.
- Copy the Xrm functions to your own program and augment them as
needed. Alas, then your resources wouldn't be seen by any
toolkit libraries that use libX11. You should not rely on the
internal structures remaining the same across libX11 versions.
- XrmEnumerateDatabase and copy the other values to a new
database, then swap it in with XrmSetDatabase.
- Convince the maintainers of libX11 to add the functions you
need, then wait perhaps 10 years so most people have installed
the new versions.