[gtkada] gtkada Digest, Vol 79, Issue 2

Rick Duley rickduley at gmail.com
Fri May 13 00:02:19 CEST 2011


IMHO, you should dump code generators altogether and write your widgets the
way you want them.  It's the only way I know to have some form of control
over the output. Go to http://adasafehouse.webs.com/GtkAda.html and try
either 'Gadget' or 'Walker'.  It's a lot of work but it's worth it.
--------------------------------------------
Rick Duley
North Perth
Western Australia 6006
http://rickduley.webs.com
                                     .-_|\
                                    /     \
                              perth *_.-._/
                                         v
aussie : 0409 106 049
o'seas : +61 409 106 049
skype  : rickduley
--------------------------------------------
"The best way to sound
   like you know what you’re talking about
      is to know what you’re talking about."


On Thu, May 12, 2011 at 6:00 PM, <gtkada-request at lists.adacore.com> wrote:

> Send gtkada mailing list submissions to
>        gtkada at lists.adacore.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        http://lists.adacore.com/mailman/listinfo/gtkada
> or, via email, send a message with subject or body 'help' to
>        gtkada-request at lists.adacore.com
>
> You can reach the person managing the list at
>        gtkada-owner at lists.adacore.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of gtkada digest..."
>
> Today's Topics:
>
>   1. Window reference. (Pascal)
>   2. Re: Window reference. (Paul Cass)
>
>
> ---------- Forwarded message ----------
> From: Pascal <p.p14 at orange.fr>
> To: gtkada at lists.adacore.com
> Date: Wed, 11 May 2011 21:44:13 +0200
> Subject: [gtkada] Window reference.
> Hello.
>
> I've built a simple window and few widgets with Glade then generated Ada
> code with gate tool.
> From On_Button2_Clicked procedure (Window1_Pkg.Callbacks) I want to access
> to an other widget present in Window1_Record (Window1_Pkg), but the window
> referece is created locally in main procedure (Window1) without  the
> possibility to get it out.
>
> So I've modified Gtk_New to store the reference and added a function
> Get_Window (Window1_Pkg) which return this reference.
>
> Is it the good way to get it?
> Or is there a more simple one?
>
> See complete code in attached tgz file.
>
> Thanks, Pascal.
> http://blady.pagesperso-orange.fr
>
>
>
>
>
> ---------- Forwarded message ----------
> From: Paul Cass <cassp41 at yahoo.com.au>
> To: "gtkada at lists.adacore.com" <gtkada at lists.adacore.com>
> Date: Wed, 11 May 2011 19:48:05 -0700 (PDT)
> Subject: Re: [gtkada] Window reference.
>  That's basically how I've done it in the past.   I haven't written that
> much code in GTKAda but I recall searching for an alternative, and perhaps
> simpler solution, with no success.
>
> Paul
>
> Here is some code from a Sudoku program that I wrote - still unfinished :)
>
>
> (part of a buttons package body)
>
> -- the new button record is stored in an array for later access
>  procedure Sudoku_Number_Button_New (New_Sudoku_Number : out
> Sudoku_Number_Button;
>
> Label             : in Utf8_String := "";
>
> Sudoku_Number     : in Number_Choice := one) is
>       begin
>       New_Sudoku_Number := new Sudoku_Number_Button_Record;
>       Sudoku_Number_Buttons (Sudoku_Number) := New_Sudoku_Number; -- save
> for later access
>       Initialize
>         (New_Sudoku_Number => New_Sudoku_Number,
>          Label           => Label,
>          Sudoku_Number   => Sudoku_Number);
>    end Sudoku_Number_Button_New;
>
> -- this is the function in the same package to provide access to the button
> record using a sudoku number (1 to 9)
>
>   function Get_Number_Button (Sudoku_Number : Number_Choice) return
> Sudoku_Number_Button is
>    -- returns access to the sudoku_number_button_record
>    begin
>       return Sudoku_Number_Buttons (Sudoku_Number);  -- could be null
>    end Get_Number_Button;
>
>
> -- and this is a procedure within a callback package that calls the
> function above
>   procedure Set_Number_Buttons_Inactive (Except_For : in Number_Choice) is
>    begin
>       For Btn in Number_Choice loop
>          if Btn /= Except_For then
>             Sudoku.Filter_Buttons.Set_Active (Get_Number_Button (Btn),False);
>          end if;
>       end loop;
>    end Set_Number_Buttons_Inactive;
>
>
>  *From:* Pascal <p.p14 at orange.fr>
> *To:* gtkada at lists.adacore.com
> *Sent:* Thursday, 12 May 2011 5:44 AM
> *Subject:* [gtkada] Window reference.
>
> Hello.
>
> I've built a simple window and few widgets with Glade then generated Ada
> code with gate tool.
> From On_Button2_Clicked procedure (Window1_Pkg.Callbacks) I want to access
> to an other widget present in Window1_Record (Window1_Pkg), but the window
> referece is created locally in main procedure (Window1) without  the
> possibility to get it out.
>
> So I've modified Gtk_New to store the reference and added a function
> Get_Window (Window1_Pkg) which return this reference.
>
> Is it the good way to get it?
> Or is there a more simple one?
>
> See complete code in attached tgz file.
>
> Thanks, Pascal.
> http://blady.pagesperso-orange.fr
>
>
>
>
> _______________________________________________
> gtkada mailing list
> gtkada at lists.adacore.com
> http://lists.adacore.com/mailman/listinfo/gtkada
>
>
>
> _______________________________________________
> gtkada mailing list
> gtkada at lists.adacore.com
> http://lists.adacore.com/mailman/listinfo/gtkada
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/gtkada/attachments/20110513/3bbe0596/attachment.htm 


More information about the gtkada mailing list