Problem using Gtk_Label

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem using Gtk_Label

Roger Mc Murtrie-2
Mac OSX 10.11.3
GPS 6.1.1 (20150118) hosted on x86_64-apple-darwin12.5.0
GNAT GPL 2015 (20150428-49)
gtkada-gpl-2015-src

Im trying to use labels under GtkAda  but the following declaration and assignment in my program compiles and builds OK.
aLabel : Gtk_Label;

aLabel := gtk_label_new;
 with no other references to aLabel.

When I run the program it crashes with:
(process:10666): GLib-GObject-CRITICAL **: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed

(process:10666): GLib-GObject-CRITICAL **: g_object_set_qdata_full: assertion 'G_IS_OBJECT (object)' failed
An exception occurred in Show_AdaQuant_Dialog.
Exception name: CONSTRAINT_ERROR
Message: erroneous memory access

Any advice will be appreciated.
Regards,
Roger
_______________________________________________
gtkada mailing list
[hidden email]
http://lists.adacore.com/mailman/listinfo/gtkada
Reply | Threaded
Open this post in threaded view
|

Re: Problem using Gtk_Label

Emmanuel Briot
> Im trying to use labels under GtkAda  but the following declaration and assignment in my program compiles and builds OK.
> aLabel : Gtk_Label;
>
> aLabel := gtk_label_new;
> with no other references to aLabel.
>
> When I run the program it crashes with:
> (process:10666): GLib-GObject-CRITICAL **: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed
>
> (process:10666): GLib-GObject-CRITICAL **: g_object_set_qdata_full: assertion 'G_IS_OBJECT (object)' failed

There is no way we can help without a reproducer here.
This is an operation that works in general, of course, and we don't know the rest of your code and whether this
single statement is responsible for the failure.
You could try using a debugger and checking that gtk_label_new is indeed called.

regards
Emmanuel

_______________________________________________
gtkada mailing list
[hidden email]
http://lists.adacore.com/mailman/listinfo/gtkada
Reply | Threaded
Open this post in threaded view
|

Re: Problem using Gtk_Label

Roger Mc Murtrie-2
Problem solved.
I'm new to GtkAda so on a steep learning curve.
I had placed the statement aLabel := gtk_label_new; before initializing GtkAda with Gtk.Main.Init!
regards,
Roger



> On 1 Feb 2016, at 7:15 PM, Emmanuel Briot <[hidden email]> wrote:
>
>> Im trying to use labels under GtkAda  but the following declaration and assignment in my program compiles and builds OK.
>> aLabel : Gtk_Label;
>>
>> aLabel := gtk_label_new;
>> with no other references to aLabel.
>>
>> When I run the program it crashes with:
>> (process:10666): GLib-GObject-CRITICAL **: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed
>>
>> (process:10666): GLib-GObject-CRITICAL **: g_object_set_qdata_full: assertion 'G_IS_OBJECT (object)' failed
>
> There is no way we can help without a reproducer here.
> This is an operation that works in general, of course, and we don't know the rest of your code and whether this
> single statement is responsible for the failure.
> You could try using a debugger and checking that gtk_label_new is indeed called.
>
> regards
> Emmanuel
>

_______________________________________________
gtkada mailing list
[hidden email]
http://lists.adacore.com/mailman/listinfo/gtkada
Reply | Threaded
Open this post in threaded view
|

Re: Problem using Gtk_Label

Emmanuel Briot
> I'm new to GtkAda so on a steep learning curve.
> I had placed the statement aLabel := gtk_label_new; before initializing GtkAda with Gtk.Main.Init!

Excellent. If you had shown a bit more of your code, we would likely have noticed
it, this is a frequent source of error.

Emmanuel

_______________________________________________
gtkada mailing list
[hidden email]
http://lists.adacore.com/mailman/listinfo/gtkada