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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,dea3b09c039d0609 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!feeder.news-service.com!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Error converting from UTF8 to ISO-8859-1 Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <4a70669a$0$13417$703f8584@news.kpn.nl> <8isqph858n0s$.krle17w7i2z1$.dlg@40tude.net> <4a707cc8$0$10035$703f8584@news.kpn.nl> <1k50e917idq61$.1w6zcc9yrx5dh.dlg@40tude.net> <4a717cbf$0$31793$703f8584@news.kpn.nl> Date: Thu, 30 Jul 2009 17:01:58 +0200 Message-ID: <1k4t22qb76xtx.rde9b5zvltd0.dlg@40tude.net> NNTP-Posting-Date: 30 Jul 2009 17:01:56 CEST NNTP-Posting-Host: 59f71632.newsspool1.arcor-online.net X-Trace: DXC=T4[S?EnSMI3Tia]Ho99G50ic==]BZ:af>4Fo<]lROoR1^YC2XCjHcb9Z29Q9OdP3F;DNcfSJ;bb[5IRnRBaCd`:fT@91@ck5 X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:7447 Date: 2009-07-30T17:01:56+02:00 List-Id: On Thu, 30 Jul 2009 12:58:15 +0200, ldries46 wrote: > My only interest at this moment is to find the reason for the Error messages > and the way to avoid them. The way to activate the buttons is something I > try to discover myself because I want to understand what I do Your code contains errors. Wall_Color_Pkg: ---------------------------------------------------- with Glib; use Glib; with Gtk; use Gtk; with Gdk.Types; use Gdk.Types; with Gtk.Widget; use Gtk.Widget; with Gtk.Window; use Gtk.Window; with Gtk.Enums; use Gtk.Enums; with Gtk.Button; use Gtk.Button; with Gtk.Color_Selection; use Gtk.Color_Selection; with Gtk.Handlers; use Gtk.Handlers; with Gtkada.Handlers; use Gtkada.Handlers; with Callbacks_Escape; use Callbacks_Escape; with Escape_Intl; use Escape_Intl; --with Escape_Pkg.Callbacks; use Escape_Pkg.Callbacks; package body Wall_Color_Pkg is package Button_Callback is new Gtk.Handlers.User_Callback -- This is User_Callback ^^^^^^^^^^^^^^^^^^^^^ (Gtk_Button_Record, Gtk_Window); procedure On_WallFloorOK_Activate(Object : access GTK_Button_Record'Class) is begin null; end; procedure Gtk_New (Wall_Color : out Wall_Color_Access) is begin Wall_Color := new Wall_Color_Record; Wall_Color_Pkg.Initialize (Wall_Color); end Gtk_New; procedure Initialize (Wall_Color : access Wall_Color_Record'Class) is pragma Suppress (All_Checks); Pixmaps_Dir : constant String := "pixmaps/"; ColorSelection : Gtk_Color_Selection; OK : Gtk_Button; Cancel : Gtk_Button; Help : Gtk_Button; begin Gtk.Color_Selection_Dialog.Initialize (Wall_Color, -"Wall Color"); Set_Border_Width (Wall_Color, 5); Set_Title (Wall_Color, -"Wall Color"); Set_Position (Wall_Color, Win_Pos_None); Set_Modal (Wall_Color, False); Set_Resizable (Wall_Color, False); ColorSelection := Get_ColorSel (Wall_Color ); OK := Get_OK_Button (Wall_Color); Cancel := Get_Cancel_Button (Wall_Color); Help := Get_Help_Button (Wall_Color); Set_Current_Color( ColorSelection, Current_Color ); Button_CallBack.Connect(OK, "clicked", On_WallFloorOK_Activate'Access); -- This connects to plain Gtk.Handlers.Callback ^^ end Initialize; procedure Set_Wall_Color( Red : in Guint16; Green : in Guint16; Blue : in Guint16 ) is begin Set_Rgb(Current_Color, Red, Green, Blue); end; end Wall_Color_Pkg; ---------------------------------------------------- I have no idea what you are trying to achieve, but using Gtk.Handlers.User_Callback could go as follows: ---------------------------------------------------- with Gtk.Enums; use Gtk.Enums; with Gtk.Button; use Gtk.Button; with Gtk.Color_Selection; use Gtk.Color_Selection; with Gtk.Handlers; use Gtk.Handlers; with Escape_Intl; use Escape_Intl; package body Wall_Color_Pkg is package Button_Callback is new Gtk.Handlers.User_Callback ( Gtk_Button_Record, Wall_Color_Access ); procedure On_WallFloorOK_Activate ( Button : access GTK_Button_Record'Class; Widget : Wall_Color_Access ) is begin null; end; procedure Gtk_New (Wall_Color : out Wall_Color_Access) is begin Wall_Color := new Wall_Color_Record; Wall_Color_Pkg.Initialize (Wall_Color); end Gtk_New; procedure Initialize (Wall_Color : access Wall_Color_Record'Class) is ColorSelection : Gtk_Color_Selection; OK : Gtk_Button; Cancel : Gtk_Button; Help : Gtk_Button; begin Gtk.Color_Selection_Dialog.Initialize (Wall_Color, -"Wall Color"); Set_Border_Width (Wall_Color, 5); Set_Title (Wall_Color, -"Wall Color"); Set_Position (Wall_Color, Win_Pos_None); Set_Modal (Wall_Color, False); Set_Resizable (Wall_Color, False); ColorSelection := Get_ColorSel (Wall_Color ); OK := Get_OK_Button (Wall_Color); Cancel := Get_Cancel_Button (Wall_Color); Help := Get_Help_Button (Wall_Color); Set_Current_Color( ColorSelection, Current_Color ); Button_CallBack.Connect ( OK, "clicked", Button_CallBack.To_Marshaller (On_WallFloorOK_Activate'Access), Wall_Color.all'Unchecked_Access ); end Initialize; procedure Set_Wall_Color( Red : in Guint16; Green : in Guint16; Blue : in Guint16 ) is begin Set_Rgb(Current_Color, Red, Green, Blue); end; end Wall_Color_Pkg; ---------------------------------------------------- -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de