Re: Loading a custom RC file



On Mon, 2007-05-14 at 17:12 -0500, Jonathon Jongsma wrote:
> On 5/14/07, Robert Pearce <rob bdt-home demon co uk> wrote:
> > Probably a very simple question...
> >
> > I'm converting one of my programs from C/GTK to C++/GTKmm. The original
> > calls
> >
> >       gtk_rc_parse ( RCFILE );
> >
> > early in the main function. I want to do the same again, but I've not
> > found an obvious GTKmm equivalent. There are wrappers in Gtk::RC for
> > most of the other resource path functions, just not that one.
> >
> > What am I missing?
> > --
> > Rob Pearce                       http://www.bdt-home.demon.co.uk
> >
> 
> If you look at this example that ships with gtkmm [1], the function
> gtk_rc_parse() is used there as well, so it looks like you'll have to
> just keep using that GTK+ function.  Whether there is a reason that
> this function is not wrapped, I don't know.
> 
> [1] http://svn.gnome.org/viewcvs/gtkmm/trunk/examples/book/custom/custom_widget/mywidget.cc?view=markup

its wrapped like this:

using namespace Gtk;

int
UI::load_rcfile (string path)
{
	if (path.length() == 0) {
		return -1;
	}

	if (access (path.c_str(), R_OK)) {
		error << "UI: couldn't find rc file \"" 
		      << path
		      << '"'
		      << endmsg;
		return -1;
	}
	
	RC rc (path.c_str());

	......








[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]