comp.lang.ada
 help / color / mirror / Atom feed
* I am trying to use GtkAda.
@ 2011-07-07 13:08 ldries46
  2011-07-07 14:36 ` Ludovic Brenta
  0 siblings, 1 reply; 5+ messages in thread
From: ldries46 @ 2011-07-07 13:08 UTC (permalink / raw)


I am trying to use GtkAda.
At this moment I have created with Glade-2 a dialog with one Label a
Combobox and two buttons.
The program using this dialog compiles without errors.
But when I execute Run(Sphere_Level) I get an empty dialog.

The relevant code is:
      Gtk_New(Sphere_Level);
      if Run(Sphere_Level) = Gtk_Response_OK then
         n3 := Sphere_Level.Levelselection;
      end if;
      Hide(Sphere_Level);
      Destroy(Sphere_Level);

Where the Initialize routine is (created by Glade-2):

procedure Initialize (Sphere_Level : access Sphere_Level_Record'Class) is
   pragma Suppress (All_Checks);
   Pixmaps_Dir : constant String := "pixmaps/";
   Levelselection_Items : String_List.Glist;

begin
   Gtk.Dialog.Initialize (Sphere_Level);
   Set_Title (Sphere_Level, -"Sphere Level");
   Set_Position (Sphere_Level, Win_Pos_None);
   Set_Modal (Sphere_Level, False);
   Set_Resizable (Sphere_Level, True);



   Gtk_New_From_Stock (Sphere_Level.Cancelbutton1, "gtk-cancel");
   Set_Relief (Sphere_Level.Cancelbutton1, Relief_Normal);

   Set_Flags (Sphere_Level.Cancelbutton1, Can_Default);
   Pack_Start (Get_Action_Area (Sphere_Level), Sphere_Level.Cancelbutton1);
   Gtk_New_From_Stock (Sphere_Level.Okbutton1, "gtk-ok");
   Set_Relief (Sphere_Level.Okbutton1, Relief_Normal);

   Set_Flags (Sphere_Level.Okbutton1, Can_Default);
   Pack_Start (Get_Action_Area (Sphere_Level), Sphere_Level.Okbutton1);
   Gtk_New_Hbox (Sphere_Level.Hbox1, False, 0);

   Gtk_New (Sphere_Level.Label1, -("Degree of subdivision" & ASCII.LF & "(1
= basic)"));
   Set_Alignment (Sphere_Level.Label1, 0.5, 0.5);
   Set_Padding (Sphere_Level.Label1, 23, 0);
   Set_Justify (Sphere_Level.Label1, Justify_Left);
   Set_Line_Wrap (Sphere_Level.Label1, False);
   Set_Selectable (Sphere_Level.Label1, False);
   Set_Use_Markup (Sphere_Level.Label1, False);
   Set_Use_Underline (Sphere_Level.Label1, False);

   Pack_Start
     (Sphere_Level.Hbox1,
      Sphere_Level.Label1,
      Expand  => False,
      Fill    => False,
      Padding => 0);
   Gtk_New (Sphere_Level.Levelselection);
   Set_Value_In_List (Sphere_Level.Levelselection, False);
   Set_Use_Arrows (Sphere_Level.Levelselection, True);
   Set_Case_Sensitive (Sphere_Level.Levelselection, False);
   Set_Editable (Get_Entry (Sphere_Level.Levelselection), False);
   Set_Has_Frame (Get_Entry (Sphere_Level.Levelselection), True);
   Set_Max_Length (Get_Entry (Sphere_Level.Levelselection), 2);
   Set_Width_Chars (Get_Entry (Sphere_Level.Levelselection), 2);
   Set_Text (Get_Entry (Sphere_Level.Levelselection), -(""));
   Set_Invisible_Char (Get_Entry (Sphere_Level.Levelselection),
UTF8_Get_Char ("●"));
   Set_Has_Frame (Get_Entry (Sphere_Level.Levelselection), True);
   String_List.Append (Levelselection_Items, -("1"));
   String_List.Append (Levelselection_Items, -("2"));
   String_List.Append (Levelselection_Items, -("3"));
   String_List.Append (Levelselection_Items, -("4"));
   String_List.Append (Levelselection_Items, -("5"));
   String_List.Append (Levelselection_Items, -("6"));
   String_List.Append (Levelselection_Items, -("7"));
   String_List.Append (Levelselection_Items, -("8"));
   String_List.Append (Levelselection_Items, -("9"));
   Combo.Set_Popdown_Strings (Sphere_Level.Levelselection,
Levelselection_Items);
   Free_String_List (Levelselection_Items);


   Pack_Start
     (Sphere_Level.Hbox1,
      Sphere_Level.Levelselection,
      Expand  => True,
      Fill    => True,
      Padding => 0);
   Pack_Start
     (Get_Vbox (Sphere_Level),
      Sphere_Level.Hbox1,
      Expand  => True,
      Fill    => True,
      Padding => 0);

   --  Connect signals

end Initialize;

I am convinced that I forget something but I tried to find anything to learn
from on the internet, but I cannot find anything.
You can help me by explaning what I forgot or by sending a link where I can
find the relevant parts

-- 
View this message in context: 
http://old.nabble.com/Learn-to-use-GtkAda-tp32012833p32012833.html
Sent from the Gtk+ - Ada mailing list archive at Nabble.com.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: I am trying to use GtkAda.
  2011-07-07 13:08 I am trying to use GtkAda ldries46
@ 2011-07-07 14:36 ` Ludovic Brenta
  2011-07-08  9:52   ` ldries46
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Brenta @ 2011-07-07 14:36 UTC (permalink / raw)


I think you need to call Show_All (Sphere_Level) at the end of its
Initialize procedure, or immediately before calling Run.

HTH

--
Ludovic Brenta.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: I am trying to use GtkAda.
  2011-07-07 14:36 ` Ludovic Brenta
@ 2011-07-08  9:52   ` ldries46
  2011-07-08 10:22     ` Ludovic Brenta
  2011-07-08 22:14     ` Rick
  0 siblings, 2 replies; 5+ messages in thread
From: ldries46 @ 2011-07-08  9:52 UTC (permalink / raw)


Thanks,

This was the solution for the problem
Now the only question left is a good guide from which I can learn all tyhis.

L. Dries

"Ludovic Brenta"  schreef in bericht 
news:cec3893f-a147-440f-bc03-6dbc3aea9246@j15g2000yqf.googlegroups.com...

I think you need to call Show_All (Sphere_Level) at the end of its
Initialize procedure, or immediately before calling Run.

HTH

--
Ludovic Brenta. 




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: I am trying to use GtkAda.
  2011-07-08  9:52   ` ldries46
@ 2011-07-08 10:22     ` Ludovic Brenta
  2011-07-08 22:14     ` Rick
  1 sibling, 0 replies; 5+ messages in thread
From: Ludovic Brenta @ 2011-07-08 10:22 UTC (permalink / raw)


ldries46 wrote on comp.lang.ada:
> Now the only question left is a good guide from which I can learn all tyhis.

The GTK+ tutorial would be the place to start.  Look in
http://developer.gnome.org/gtk-tutorial/stable/x281.html

The GtkAda User's Guide is less explicit about it, but it does call
Show_All in the first example (section "Starting an application with
GtkAda").

--
Ludovic Brenta.
The clients achieve our replacement and underlying 360-degree
thinking,
whereas the group strategizes parallel measurements.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: I am trying to use GtkAda.
  2011-07-08  9:52   ` ldries46
  2011-07-08 10:22     ` Ludovic Brenta
@ 2011-07-08 22:14     ` Rick
  1 sibling, 0 replies; 5+ messages in thread
From: Rick @ 2011-07-08 22:14 UTC (permalink / raw)


On Jul 8, 5:52 am, "ldries46" <bertus.dr...@planet.nl> wrote:
> Thanks,
>
> This was the solution for the problem
> Now the only question left is a good guide from which I can learn all tyhis.

Try http://adasafehouse.webs.com/
This doesn't use Glade - you write your own code.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-07-08 22:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-07 13:08 I am trying to use GtkAda ldries46
2011-07-07 14:36 ` Ludovic Brenta
2011-07-08  9:52   ` ldries46
2011-07-08 10:22     ` Ludovic Brenta
2011-07-08 22:14     ` Rick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox