Segmentation fault with Button for Keyboard.

View: New views
2 Messages — Rating Filter:   Alert me  

Segmentation fault with Button for Keyboard.

by Rick Duley-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am trying to create a Button to go in a Table and keep a
record of where it is in that table.
It all worked yesterday with Gtk.Button.Gtk_Button
(Speller.jpg) but even one button won't compile today.

The debugger gives me a message about a segmentation fault
but I can't see why. It seems to occur at the very start of
the program where there is nothing done that can be wrong.

All assistance appreciated. 

--
Rick Duley
North Perth,
Western Australia
http://rickduley.webs.com
                                     .-_|\
                                    /     \
                              perth *_.-._/
                                         v
aussie : 0409 106 049
o'seas : +61 409 106 049
--------------------------------------------
"Wise men profit more from fools
     than fools from wise men;
for the wise shun the mistakes of fools
      but fools do not imitate
                the successes of the wise."
                   Marcus Cato (234-149 BC)



_______________________________________________
gtkada mailing list
gtkada@...
http://lists.adacore.com/mailman/listinfo/gtkada

090704-Key_Button.zip (5K) Download Attachment
Speller.jpg (22K) Download Attachment

Re: Segmentation fault with Button for Keyboard.

by Dmitry A. Kazakov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, 4 Jul 2009 18:46:57 +0800, you wrote:

> I am trying to create a Button to go in a Table and keep a
> record of where it is in that table.
> It all worked yesterday with Gtk.Button.Gtk_Button
> (Speller.jpg) but even one button won't compile today.
>
> The debugger gives me a message about a segmentation fault
> but I can't see why. It seems to occur at the very start of
> the program where there is nothing done that can be wrong.
>
> All assistance appreciated.

Move the call to Gtk.Main.Init above widget creation calls.

Other problems:

Add Show (Key_Window);
Add -mwindows key to the linker options of the project

Note that when Gtk gives you error messages. These messages, especially of
the critical level, should be paid attention first.

P.S. If you have troubles tracking down Glib messages you can use GtkAda
visual tracing from

   http://www.dmitry-kazakov.de/ada/gtkada_contributions.htm

for example, the following will pop up a trace window upon a Glib error in
GObject with call stack back trace:

with Gtk.Main.Router.GNAT_Stack;
with GLib.Messages;
   ...
begin
   Gtk.Main.Init;
   Gtk.Main.Router.Init;
   Gtk.Main.Router.GNAT_Stack.Set_Log_Trace
   (  "Gtk", GLib.Messages.Log_Level_Flags'Last
   );
   Gtk.Main.Router.GNAT_Stack.Set_Log_Trace ("GLib-GObject");
   ...

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
_______________________________________________
gtkada mailing list
gtkada@...
http://lists.adacore.com/mailman/listinfo/gtkada