[gtkada] How do I set the window icon using GtkAda?
Dave Mihalik
dmihalik at toast.net
Tue Aug 29 02:00:49 CEST 2006
When I try to compile the following program, I get the error: “Set_Icon” is
not declared in “Window”
I have tried compiling this program using Gtk-2.4.0 and GtkAda 2.8.0.
with Gtk.Window; use Gtk.Window;
with Gtk.Enums; use Gtk.Enums;
with Glib.Error; use type Glib.Error.GError;
with Gdk.Pixbuf; use Gdk.Pixbuf;
with Gtk.Main; use Gtk.Main;
with Gtk.Handlers; use Gtk.Handlers;
with Gtk.Widget; use Gtk.Widget;
with Gdk.Event; use Gdk.Event;
procedure iconexample is
package Callback is new Gtk.Handlers.Callback
(Widget_Type => Gtk_Widget_Record);
procedure WindowDestroy (Widget : access Gtk_Widget_Record'Class) is
pragma Unreferenced (Widget);
begin
Gtk.Main.Main_Quit;
end WindowDestroy;
mymainwindow : Gtk_Window;
myicon : Gdk.Pixbuf.Gdk_Pixbuf;
error : Glib.Error.GError;
begin
Gtk.Main.Init;
Gtk_New (mymainwindow, Window_Toplevel);
Callback.Connect(mymainwindow,
"destroy",
Callback.To_Marshaller (WindowDestroy'Access));
Gdk.Pixbuf.Gdk_New_From_File(myicon,"myicon.xpm",error);
Gtk.Window.Set_Icon(mymainwindow,myicon);
Gtk.Window.Show_All(mymainwindow);
Gtk.Main.Main;
end iconexample;
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.6/428 - Release Date: 8/25/2006
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/gtkada/attachments/20060828/de86cb94/attachment.htm
More information about the gtkada
mailing list