Re: gtkentry->set_text("hello") segmentation fault signal 11



ok i tried to do that i get a lot of errors.

when i used

Gtk::Entry* entry_rapidrate;
entry_rapidrate->get_text();
worked verywell

but set_text dont.

when i use
 Gtk::Entry *entry_rapidrate = new Gtk::Entry();
entry_rapidrate->set_text("hello");

i get

(process:7732): GLib-GObject-CRITICAL **: /build/buildd/glib2.0-2.16.6/gobject/gtype.c:2248: initialization assertion failed, use IA__g_type_init() prior to this function

(process:7732): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed

(process:7732): GLib-GObject-CRITICAL **: /build/buildd/glib2.0-2.16.6/gobject/gtype.c:2248: initialization assertion failed, use IA__g_type_init() prior to this function

(process:7732): GLib-GObject-CRITICAL **: /build/buildd/glib2.0-2.16.6/gobject/gtype.c:2248: initialization assertion failed, use IA__g_type_init() prior to this function

(process:7732): GLib-GObject-CRITICAL **: /build/buildd/glib2.0-2.16.6/gobject/gtype.c:2248: initialization assertion failed, use IA__g_type_init() prior to this function

(process:7732): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(process:7732): GLib-GObject-CRITICAL **: /build/buildd/glib2.0-2.16.6/gobject/gtype.c:2248: initialization assertion failed, use IA__g_type_init() prior to this function

(process:7732): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(process:7732): GLib-GObject-CRITICAL **: /build/buildd/glib2.0-2.16.6/gobject/gtype.c:2248: initialization assertion failed, use IA__g_type_init() prior to this function

(process:7732): GLib-GObject-CRITICAL **: /build/buildd/glib2.0-2.16.6/gobject/gtype.c:2248: initialization assertion failed, use IA__g_type_init() prior to this function

(process:7732): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

(process:7732): GLib-GObject-CRITICAL **: /build/buildd/glib2.0-2.16.6/gobject/gtype.c:2248: initialization assertion failed, use IA__g_type_init() prior to this function



On Thu, May 21, 2009 at 12:16 PM, Jonathon Jongsma <jonathon quotidian org> wrote:
Oscar Dávila wrote:
This is how i have declared the entry

Gtk::Entry* entry_rapidrate;
entry_rapidrate->set_text("hello");

You didn't create any widget, you simply declared a pointer to a widget and didn't even initialize it to a value. This is pretty basic C/C++, so I would suggest doing a bit of studying of basics first.  In any case, you would need to do something like:

Gtk::Entry *entry_rapidrate = new Gtk::Entry();

entry_rapidrate->set_text("hello");

// later when you're done using the entry, free it so you
// don't leak memory
delete entry_rapidrate;

--
jonner



--
Atentamente:
Oscar Dávila Ramírez
odavilar gmail com




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