• When I install the RGtk package on Solaris, I get errors when I load the RGtk library about missing symbols.
    If the errors are about missing symbols, it could be due to using Solaris' own version of make rather than the GNU make. The solution is to re-install the RGtk package using the command gmake. Also, you can set the environment variable MAKE to gmake. Of course, gmake should be in your path. If it is not, specify the fully-qualified location of the gmake executable. And if it is not on your system, install it. The package could use the vanilla make, but it currently does not and it is not a high priority issue for me.

    If the error is about a missing library, then the problem is with your setting of LD_LIBRARY_PATH.

  • When I try to load any of the other Gtk packages such as RGtkExtra, RGdkPixbuf, RGtkGlade, and so on, I get an error of the form.
    There are two possible issues.
    1. When you installed RGtk, did you use the -c (or --clean) flag in the command
        R CMD INSTALL -c RGtk	     
      
      This is needed to create the additionally library libRGtk.so which other packages can use to share code from the RGtk package.
    2. The second problem may be that the system cannot find libRGtk.so:
      > library(RGtkExtra)
      Error in dyn.load(x, as.logical(local), as.logical(now)) :
              unable to load shared library
      "/usr/local/lib/R/library/RGtkExtra/libs/RGtkExtra.so":
        libRGtk.so: cannot open shared object file: No such file or directory
      Error in library(RGtkExtra) : .First.lib failed
      
      To fix this, set the environment variable LD_LIBRARY_PATH to include the directory /RGtk/libs/.
  • When I try to compile RGtk on Solaris, I get a lot of errors on the first C file and then the installation terminates.
    If you installed R using the native C compiler (cc) rather than gcc, then you will have to tell R to use gcc when building packages (at least RGtk). To do this, edit $R_HOME/etc/Makeconf and replace all occurrences of
    • cc with gcc;
    • -G with -shared;
    • -KPIC with -fPIC
    This worked for me. The reason I had to compile R with cc rather than gcc was because of the error when compiling arithmetic.c regarding an int's being 32 bit values. While this is a configuration issue, it also may be desirable to use cc and f77 rather than cc and g77.
    Where can I get the HTML widget?
    From ftp://www.gnome.org/pub/GNOME/unstable/sources/gtkhtml. To build this, you will need up-to-date versions of the different libraries on which it depends.
    When I try to build gtkhtml (or specifically any application that links against it), I get an error about a missing symbol g_utf8_get_char_validated . What can I do?
    Get a newer version of the GNOME Application library (gal).

    BTW, the links to the unstable sources can be replaced with the stable/ directory if you want to be cautious, but some things may not work with these older versions!

    Is it possible to get access to other libraries such as xmhtml, applet, capplet, zvt, gnomeui, etc.
    Yep. If one can get the defs files, the RGtkBindingGenerator package can be used to automatically generate code.

    One can read the definitions from non-defs files and use the same code generation functions. All one needs to do is transform the descriptions of the classes, enums, flags, functions into the appropriate S objects. It is quite a simple structure.

    The GtkHTML widget doesn't display images that are referenced in the HTML content. How can I fix this?
    One of the nice aspects of the GtkHTML widget design is that it allows the host application to find the image and then pass it to the widget. This gives the application great flexibility in how it can resolve the image, e.g. download, create it from a graphics device, etc. One specifies a callback function for the "url_requested" event/signal. This is called with the HTML widget, the name of the URL and a pointer to a GtkHTMLStream object. The callback should read the contents of the image, perhaps from a remote server and then write the contents to the GtkHTMLStream. The first step can be done using, e.g. download.file() or resolving a relative URL locally by appending the base of the current document to the URL name using widget$GetBase().

    The second step involves writing the image contents to the HTML stream given as the third argument to the callback. This currently requires passing the image to some C code R_readFileToHTMLStream. One calls this with the fully qualified name of the file containing the image and the stream reference exactly as given by the third argument of the callback.

    An example of how this works is given in the gtkHtmlImages.S in connection with the viewHtml() function from the RGtkViewers.

    Note that this mechanism makes it possible to interpret the URL in arbitrary ways. Specifically, the value of the URL need to be a URL, but instead may be an R command. Whether this is useful remains to be seen!

    How do I compute the parent widget of a widget?
    gtkWidgetGetParent() should work but unfortunately the underlying Gtk routine gtk_widget_get_ancestor doesn't behave properly.

    While this misbehaves, you can access the parent directly as a Gtk argument of an object.

     gtkObjectGetArg(obj, "parent")
    
    or
     obj$GetArg("parent")
    
    use the argument.

  • Duncan Temple Lang <duncan@research.bell-labs.com>
    Last modified: Fri Jan 17 06:08:07 UTC 2003