* GtkAda and the Tree_Store Widget
@ 2003-09-05 6:57 Adam Puleo
2003-09-05 8:52 ` Preben Randhol
2003-09-08 5:56 ` max1
0 siblings, 2 replies; 4+ messages in thread
From: Adam Puleo @ 2003-09-05 6:57 UTC (permalink / raw)
I'm trying to use the Tree_Store widget in GtkAda 2.2.0 but nothing shows up
in the window (Gtk_Scrolled_Window). I've tried to steal the code from
testgtk but I have to integrate it with the code generated by Glade so I
suspect I'm missing something somewhere. Does anyone know how I would go
about troubleshooting this?
Thanks,
-adam
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: GtkAda and the Tree_Store Widget
2003-09-05 6:57 GtkAda and the Tree_Store Widget Adam Puleo
@ 2003-09-05 8:52 ` Preben Randhol
2003-09-05 8:53 ` Preben Randhol
2003-09-08 5:56 ` max1
1 sibling, 1 reply; 4+ messages in thread
From: Preben Randhol @ 2003-09-05 8:52 UTC (permalink / raw)
Adam Puleo wrote:
> suspect I'm missing something somewhere. Does anyone know how I would go
> about troubleshooting this?
Yes.
1. Join the GtkAda mailinglist
2. Present some code. Especially the part where you intergrate your code
into the glade generated one.
:-)
Preben
--
�I think fish is nice, but then I think that rain is wet.
So who am I to judge.�
- The Hitch Hiker's Guide to the Galaxy (radioplay)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: GtkAda and the Tree_Store Widget
2003-09-05 8:52 ` Preben Randhol
@ 2003-09-05 8:53 ` Preben Randhol
0 siblings, 0 replies; 4+ messages in thread
From: Preben Randhol @ 2003-09-05 8:53 UTC (permalink / raw)
Preben Randhol wrote:
> 1. Join the GtkAda mailinglist
Oops forgot the link => http://libre.act-europe.fr/GtkAda/
--
�I think fish is nice, but then I think that rain is wet.
So who am I to judge.�
- The Hitch Hiker's Guide to the Galaxy (radioplay)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: GtkAda and the Tree_Store Widget
2003-09-05 6:57 GtkAda and the Tree_Store Widget Adam Puleo
2003-09-05 8:52 ` Preben Randhol
@ 2003-09-08 5:56 ` max1
1 sibling, 0 replies; 4+ messages in thread
From: max1 @ 2003-09-08 5:56 UTC (permalink / raw)
Adam Puleo wrote:
> I'm trying to use the Tree_Store widget in GtkAda 2.2.0 but nothing shows up
Try this:
with Glib;
with Gtk.Box;
with Gtk.Main;
with Gtk.Enums;
with Gtk.Widget;
with Gtk.Window;
with Gtk.Button;
with Gtk.Tree_View;
with Gtk.Tree_Store;
with Gtk.Tree_Model;
with Gtk.Tree_View_Column;
with Gtk.Scrolled_Window;
with Gtk.Cell_Renderer_Text;
procedure Gtk_Test is
use type Glib.Gint;
Box : Gtk.Box.Gtk_Box;
Window : Gtk.Window.Gtk_Window;
Scroll : Gtk.Scrolled_Window.Gtk_Scrolled_Window;
Button : Gtk.Button.Gtk_Button;
Store : Gtk.Tree_Store.Gtk_Tree_Store;
View : Gtk.Tree_View.Gtk_Tree_View;
Parent : Gtk.Tree_Model.Gtk_Tree_Iter := Gtk.Tree_Model.Null_Iter;
Iter : Gtk.Tree_Model.Gtk_Tree_Iter;
Types : Glib.GType_Array (0 .. 0);
Column : Gtk.Tree_View_Column.Gtk_Tree_View_Column;
Render : Gtk.Cell_Renderer_Text.Gtk_Cell_Renderer_Text;
Ignore : Glib.Gint;
begin
Gtk.Main.Init;
Gtk.Window.Gtk_New (Window);
Gtk.Box.Gtk_New_Vbox (Box);
Gtk.Button.Gtk_New (Button, "Hello World");
Gtk.Box.Pack_Start (Box, Button, False, False);
Gtk.Scrolled_Window.Gtk_New (Scroll);
Gtk.Scrolled_Window.Set_Border_Width (Scroll, 5);
Gtk.Scrolled_Window.Set_Policy
(Scroll,
Gtk.Enums.Policy_Automatic,
Gtk.Enums.Policy_Automatic);
Gtk.Box.Pack_Start (Box, Scroll);
Types (0) := Glib.GType_String;
Gtk.Tree_Store.Gtk_New (Store, Types);
for I in 1 .. 1000 loop
Iter := Gtk.Tree_Model.Null_Iter;
Gtk.Tree_Store.Append (Store, Iter, Parent);
Gtk.Tree_Store.Set (Store, Iter, 0,
Gtk.Tree_Model.To_String (Gtk.Tree_Store.Get_Path (
Store, Iter)));
end loop;
Gtk.Tree_View.Gtk_New (View, Store);
Gtk.Cell_Renderer_Text.Gtk_New (Render);
for I in 1 .. Glib.Gint'(18) loop
Gtk.Tree_View_Column.Gtk_New (Column);
Gtk.Tree_View_Column.Pack_Start (Column, Render, True);
Gtk.Tree_View_Column.Add_Attribute (Column, Render, "text", 0);
Ignore := Gtk.Tree_View.Append_Column (View, Column);
end loop;
Gtk.Scrolled_Window.Add (Scroll, View);
Gtk.Window.Add (Window, Box);
Gtk.Scrolled_Window.Show (Scroll);
Gtk.Button.Show (Button);
Gtk.Tree_View.Show (View);
Gtk.Box.Show (Box);
Gtk.Window.Show (Window);
Gtk.Main.Main;
end Gtk_Test;
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-09-08 5:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-05 6:57 GtkAda and the Tree_Store Widget Adam Puleo
2003-09-05 8:52 ` Preben Randhol
2003-09-05 8:53 ` Preben Randhol
2003-09-08 5:56 ` max1
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox