GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Aug 21, 2014 12:24 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Error message during reading *.glade file in GtkAda
PostPosted: Sun Mar 17, 2013 10:05 am 
Offline
Familiar Face

Joined: Fri Sep 23, 2011 12:04 pm
Posts: 30
I get an error message during reading my*.glade file.

The message is:
Quote:
Program received signal SIGSEGV, Segmentation fault.
0x63a5d2fa in g_type_check_is_value_type () from D:\PROGRA~1\GNAT\GtkADA\bin\libgobject-2.0-0.dll

The error appears in my call to Add_From_File function
Code:
Error := Add_From_File (Builder, "Cell_3D.glade");

I am using Windows 7, The GNAT Programming Studio 2012 and the Ada language.
What is causing this error. I already have tried deleting the *.glade file and saving it again, sometimes in a more simple form.
Sometimes it works but not always.
As far I know GtkAda is using Gtk 2.0 (with Glade3 v3.8).
As neither a *.glade file nor a *.txt or .lst or an extensionles file is allowed to be attached in this forum I don't know how to send the glade file,
because it is to big to include in this question.


Top
 Profile  
 
 Post subject: Re: Error message during reading *.glade file in GtkAda
PostPosted: Sun Mar 17, 2013 11:22 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 745
Location: UK
Hi,

Looking at your very very short sample code it looks like you are using GtkBuilder. From this you must be using GTK+ version 2.12 or higher.

Have you checked what format you are saving the file as? There are two formats, one for libglade and another for GtkBuilder. Both are XML files, but they do have different tags in places.

Also check that you are not using widgets that do not exist in the version of GTK+ that you are linking against.

_________________
E.


Top
 Profile  
 
 Post subject: Re: Error message during reading *.glade file in GtkAda
PostPosted: Sun Mar 17, 2013 12:41 pm 
Offline
Familiar Face

Joined: Fri Sep 23, 2011 12:04 pm
Posts: 30
I am using Gtk 2.24 together with the Glade 3.8 version which is deliverd in the same package from adacore. So in my opnion Glade3 should be warning if I do use something I may not use.
I am sure that I use the correct form of file because I an earlier stadium the file was working.
I know the error must occur in Add_From_File because at a breakpoint just before that statement the program was still running but within that statement the program aborted. Can you tell me if there are widges that I cannot use in Gtkbuilder which Glade doe not warn for.
I am only using the menu bar, statusbar end a number of dialogs which use only labels, horizontal seperstors, horizontal scales, comboboxes, checkbuttons and OK/Cancel buttons. In the dialogs these buttons are the only ones producing events. I have checked if all names used in Glade are exactly copied into my program (included correct use of capitals).

L. Dries


Top
 Profile  
 
 Post subject: Re: Error message during reading *.glade file in GtkAda
PostPosted: Sun Mar 17, 2013 1:30 pm 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 745
Location: UK
GTK+ v2.24 is the last of the version 2 series of GTK+ and Glade 3.8 is the last to work with version 2. So you should not have any problems with compatibility of widgets between them.

What could be causing the segmentation fault is difficult to tell. More things to look for are the locations of the files, and if the GtkBuilder is set up correctly.

_________________
E.


Top
 Profile  
 
 Post subject: Re: Error message during reading *.glade file in GtkAda
PostPosted: Sun Mar 17, 2013 2:53 pm 
Offline
Familiar Face

Joined: Fri Sep 23, 2011 12:04 pm
Posts: 30
What can I do wrong. I am using the Builder as is used in GtkAda.
The only thing I have to do is
Code:
      Gtk_New (Builder);
[color=#FF0000]      if Builder = null then
         answer := Message_Dialog( Msg     => "Error : Builder gets 'null' value",
                                                  Buttons => Button_OK,
                                                  Title   => "Error");
         Error_Free (Error);
         return;  -- exit program
      end if;[/color]
      Error := Add_From_File (Builder, "Cell_3D.glade");  -- breakoiunt before this statement
      if Error /= null then
         answer := Message_Dialog( Msg     => "Error : " & Get_Message (Error),
                                       Buttons => Button_OK,
                                       Title   => "Error");
         Error_Free (Error);
         return;  -- exit program
      end if;

I included especially the red lines because I wanted to be sure the Builder wasn't a null pointer.
The fact that the program even reached the statement before the second if statement without showing a messagebox shows that the Get_New did not created a nullpointer.
When in debugging mode even stepping into Add_From_File creates the error. Even if the filename in the statement should be case sensitive the filenamr is correct.
The problem must be in Builder or it can be that Add_From_File cannot be debugged.
L. Dries


Top
 Profile  
 
 Post subject: Re: Error message during reading *.glade file in GtkAda
PostPosted: Sun Mar 17, 2013 3:14 pm 
Offline
Familiar Face

Joined: Fri Sep 23, 2011 12:04 pm
Posts: 30
I have just deleted the two dialogs using comboboxes and now the program reaches the Do_Connect statement, and the program goes on till the statement that calls with the builder the first of these two dialogs en finds a null pointer for that widget (as it should).
I think this means that the comboboxes or the GtkListcores have something to do with it.

L. Dries


Top
 Profile  
 
 Post subject: Re: Error message during reading *.glade file in GtkAda
PostPosted: Mon Mar 18, 2013 10:25 am 
Offline
Familiar Face

Joined: Fri Sep 23, 2011 12:04 pm
Posts: 30
I have the proof that the Combobox is the reason of the segmentation fault. I was just building up a new dialog with a combobox.The program runs when I have the following items changed:
under the tab General, Combobox model (to an existing GtkListstore), Active Item (to 0) and Entry Text Colum (to 0)
under the tab Common, width request (to 1), Visible (to Yes) and Border Width to 3

Now I tried a further change:
under the tab General, Has Entry (to Yes)

When I tried to run this the program it fails again in the Add_From_File function.

In the case where the program runs the combobox has an empty entry and shows an empty list of exactly the correct number of list entries.
What did I do wrong. When created by Glade3 the combobox should be complete visible including the list. So what did I forgot??? to change.

L. Dries


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group