From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3af4bf9fdc8875b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-05 01:43:25 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!opentransit.net!proxad.net!feeder2-1.proxad.net!nnrp1.proxad.net.POSTED!not-for-mail Sender: briot@lyon.act-europe.fr Newsgroups: comp.lang.ada Subject: Re: Getting started with GtkAda & Glade References: From: Emmanuel Briot Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.105 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 05 Sep 2001 08:43:25 GMT NNTP-Posting-Host: 213.228.58.160 X-Complaints-To: abuse@proxad.net X-Trace: nnrp1.proxad.net 999679405 213.228.58.160 (Wed, 05 Sep 2001 10:43:25 CEST) NNTP-Posting-Date: Wed, 05 Sep 2001 10:43:25 CEST Organization: Guest of ProXad - France Xref: archiver1.google.com comp.lang.ada:12736 Date: 2001-09-05T08:43:25+00:00 List-Id: karlran1234@yahoo.com (Karl Ran) writes: > I played a little bit with your suggestions but I haven't found a > solution for > for my problem ... due to my lack of Ada/Gtk knowledge., I guess > > Ok, now the code looks like this: > > ----------------------------------------------------------------------- > 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); > Scale : Gtk_Scale := Gtk_Scale (Object); > begin > Put_Line ("Current_Value is " & Gdouble'Image (Get_Value > (Scale))); > return False; > end On_Hscale1_Motion_Notify_Event; > ------------------------------------------------------------------------ Sorry, I now realize I had looked at the development version of gtk+/GtkAda. Instead, you would do something like: Put_Line (Gdouble'Image (Get_Value (Get_Adjustment (Scale)))); It does seem complex, however this is because the set of possible values for a lot of widgets in gtk+ are separated from the value they contain. Instead, that value is stored in a structure called a Gtk_Adjustment (that contains the current value, the minimum and maximum possible values and a few other fields). The nice thing is that other widgets can ask to receive signals when the value is changed (Pretty close to the standard Model-View-Controller model, I believe). The new version of gtk+/GtkAda has more direct access functions, even though they do the same thing as above in the background. Emmanuel