From: karlran1234@yahoo.com (Karl Ran)
Subject: Getting started with GtkAda & Glade
Date: 31 Aug 2001 05:37:31 -0700
Date: 2001-08-31T12:37:31+00:00 [thread overview]
Message-ID: <e7ebd224.0108310437.23eaeee7@posting.google.com> (raw)
Hi there,
I'm trying to created a GUI with GtkAda and Glade(the RAD tool).
It's just one window with one horizontal scale widget (Class
GtkHScale);
Glade create this file (window1_pkg-callbacks.adb) for me:
-----------------------------------------------------------------
with System; use System;
with Glib; use Glib;
with Gdk.Event; use Gdk.Event;
with Gdk.Types; use Gdk.Types;
with Gtk.Accel_Group; use Gtk.Accel_Group;
with Gtk.Object; use Gtk.Object;
with Gtk.Enums; use Gtk.Enums;
with Gtk.Style; use Gtk.Style;
with Gtk.Widget; use Gtk.Widget;
with Ada.Text_IO;
package body Window1_Pkg.Callbacks is
use Gtk.Arguments;
------------------------------------
-- On_Hscale1_Motion_Notify_Event --
------------------------------------
function On_Hscale1_Motion_Notify_Event
(Object : access Gtk_Widget_Record'Class;
Params : Gtk.Arguments.Gtk_Args) return Boolean
is
Arg1 : Gdk_Event := To_Event (Params, 1);
begin
Ada.Text_IO.Put_Line("Well, the user moved the slider but I don't know
the position :(");
return False;
end On_Hscale1_Motion_Notify_Event;
end Window1_Pkg.Callbacks;
-----------------------------------------------------------------
What I like to accomplish is to print the current value(position) of
the slider
while the user is moving it.
Anyone know what have to be placed inside the Put_Line-brackets?
Karl
PS: This is the XML Glade source...
<?xml version="1.0"?>
<GTK-Interface>
<project>
<name>Menu2</name>
<program_name>menu2</program_name>
<directory></directory>
<source_directory>src</source_directory>
<pixmaps_directory>pixmaps</pixmaps_directory>
<language>Ada 95</language>
<gnome_support>False</gnome_support>
<gettext_support>True</gettext_support>
</project>
<widget>
<class>GtkWindow</class>
<name>window1</name>
<title>window1</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
<modal>False</modal>
<allow_shrink>False</allow_shrink>
<allow_grow>True</allow_grow>
<auto_shrink>False</auto_shrink>
<widget>
<class>GtkHScale</class>
<name>hscale1</name>
<can_focus>True</can_focus>
<signal>
<name>motion_notify_event</name>
<handler>on_hscale1_motion_notify_event</handler>
<last_modification_time>Fri, 31 Aug 2001 12:16:08
GMT</last_modification_time>
</signal>
<draw_value>True</draw_value>
<value_pos>GTK_POS_TOP</value_pos>
<digits>1</digits>
<policy>GTK_UPDATE_CONTINUOUS</policy>
<value>0</value>
<lower>1</lower>
<upper>42</upper>
<step>1</step>
<page>0</page>
<page_size>0</page_size>
</widget>
</widget>
</GTK-Interface>
next reply other threads:[~2001-08-31 12:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-08-31 12:37 Karl Ran [this message]
2001-09-03 7:48 ` Getting started with GtkAda & Glade Emmanuel Briot
2001-09-03 18:47 ` Karl Ran
2001-09-05 8:43 ` Emmanuel Briot
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox