Using C++ Data Types in Custom Gtk+ Classes



As anyone can see from the title, I am trying to use a C++ data
type such as a string or vector as a member in a custom Gtk+
class. Here is a little example of what I mean:

struct Custom
{
GtkNotebook parent;
vector<string> list;
};

struct CustomClass
{
GtkNotebookClass parent_class;
};

When I do this, I keep getting segmentation faults from the debugger.
The output of gdb keeps telling me I cannot do anything with those
variables. For example, if I include a string, when I try to set it equal to
some text, it tells me it crashed in the "assign()" function.

I have had problems integrating C++ and Gtk+ before, but I do not want
to use Gtkmm. I used it before and it added too much extra baggage on
the executable.

Thanks for any help you can offer! - Andrew Krause



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