[gtkada] Possible problem in Glib.Properties
Manuel Op de Coul
manuel.op.de.coul at eon-benelux.com
Mon Nov 8 11:32:15 CET 2004
I made a start with another GtkAda package, the spec is below.
And created another function which is still missing in Gtk.Widget:
function Get_Settings (Widget : access Gtk_Widget_Record'Class) return
Gtk_Settings
is
function Internal (Widget : System.Address) return Gtk_Settings;
pragma Import (C, Internal, "gtk_widget_get_settings");
begin
return Internal (Get_Object (Widget));
end Get_Settings;
This is part of the code:
with Glib.Properties; use Glib.Properties;
with Gtk.Settings; use Gtk.Settings;
declare
The_Settings : Gtk_Settings;
begin
-- create Button
The_Settings := Get_Settings(Button);
if Get_Property(The_Settings, Gtk.Settings.Button_Images_Property)
then
Manuel
-- <c_version>1.3.11</c_version>
with Glib.Object;
with Glib.Properties;
package Gtk.Settings is
type Gtk_Settings_Record is new Glib.Object.GObject_Record with private;
type Gtk_Settings is access all Gtk_Settings_Record'Class;
function Get_Type return Glib.GType;
-- Return the internal value associated with Gtk_Settings.
function Get_Default return Gtk_Settings;
-- Return the Gtk_Settings object for the default GDK screen, creating
it
-- if necessary.
----------------
-- Properties --
----------------
-- <properties>
-- The following properties are defined for this object. See
-- Glib.Properties for more information on properties.
--
-- - Name: Alternative_Button_Order_Property
-- Type: Boolean
-- Flags: read-write
-- Descr: Whether buttons in dialogs should use the alternative
button order.
--
-- - Name: Button_Images_Property
-- Type: Boolean
-- Flags: read-write
-- Descr: Whether stock icons should be shown in buttons.
--
-- - Name: Color_Palette_Property
-- Type: String
-- Flags: read-write
-- Descr: Palette to use in the color selector.
--
-- </properties>
Alternative_Button_Order_Property : constant
Glib.Properties.Property_Boolean;
Button_Images_Property : constant
Glib.Properties.Property_Boolean;
Color_Palette_Property : constant
Glib.Properties.Property_String;
private
type Gtk_Settings_Record is new Glib.Object.GObject_Record with null
record;
Alternative_Button_Order_Property : constant
Glib.Properties.Property_Boolean :=
Glib.Properties.Build ("gtk-alternative-button-order");
Button_Images_Property : constant
Glib.Properties.Property_Boolean :=
Glib.Properties.Build ("gtk-button-images");
Color_Palette_Property : constant
Glib.Properties.Property_String :=
Glib.Properties.Build ("gtk-color-palette");
pragma Import (C, Get_Type, "gtk_settings_get_type");
pragma Import (C, Get_Default, "gtk_settings_get_default");
end Gtk.Settings;
More information about the gtkada
mailing list