Hello all,

I just started working with Gtkmm on Windows a few days ago, and I can't get
Glib::Keyfile to work properly.

If the KeyFile doesn't exist, I want to start a config screen and make one.
Problem is, I can't catch anything from load_from_file, it just seems to
blow up.

I found a related item, but it doesn't look like it ever resolved:
http://www.nabble.com/Glib::KeyFile-bug--td18043898.html

The Doc's say  "If the file could not be loaded then a
FileError<http://www.gtkmm.org/docs/glibmm-2.4/docs/reference/html/classGlib_1_1FileError.html>or
KeyFileError<http://www.gtkmm.org/docs/glibmm-2.4/docs/reference/html/classGlib_1_1KeyFileError.html>exception
is thrown."

But there doesn't seem to be anything to catch. Anyone have something I'm
missing?

Below is my build/run output and the source of my test file.  MSYS/MinGW.

-------------------------------------------------------------------

[EMAIL PROTECTED] ~/w32-light/src
$ g++ -Wall -o example example.cpp `pkg-config gtkmm-2.4 --libs --cflags`

[EMAIL PROTECTED] ~/w32-light/src
$ ./example.exe

This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.

[EMAIL PROTECTED] ~/w32-light/src
$

-------------------------------------------------------------------

#include <iostream>

#include <glibmm.h>

int main (int argc, char ** argv) {

    Glib::KeyFile config;

    try {
        if(!config.load_from_file("fileDoesNotExist.txt"))
            std::cout << "Can't load it!" << std::endl;
    }
    catch (Glib::KeyFileError & e) {
        std::cout << "Caught KeyFileError" << std::endl;
    }
    catch (Glib::FileError & e) {
        std::cout << "Caught FileError" << std::endl;
    }
    catch (Glib::Error & e) {
        std::cout << "Caught Glib::Error" << std::endl;
    }

    return 0;
}

-------------------------------------------------------------------
_______________________________________________
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list

Reply via email to