|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
Addressing widgets in a Gtk.TableI am looking for a way to have a cluster of Gtk.Button in some sort of array (a keyboard, if you like) where I can address them individually. I am looking at Gtk.Table but I cannot find any procedures which allow me to address individual cells of the table.
Is Table the right container?
How do I address individual cells?
All assistance appreciated-- Rick Duley North Perth, Western Australia http://rickduley.webs.com .-_|\ / \ perth *_.-._/ v aussie : 0409 106 049 o'seas : +61 409 106 049 -------------------------------------------- "Wise men profit more from fools than fools from wise men; for the wise shun the mistakes of fools but fools do not imitate the successes of the wise." Marcus Cato (234-149 BC) _______________________________________________ gtkada mailing list gtkada@... http://lists.adacore.com/mailman/listinfo/gtkada |
|
|
Re: Addressing widgets in a Gtk.TableOn Mon, 29 Jun 2009 20:13:30 +0800, you wrote:
> I am looking for a way to have a cluster of Gtk.Button in some sort of array > (a keyboard, if you like) where I can address them individually. I am > looking at Gtk.Table but I cannot find any procedures which allow me to > address individual cells of the table. > > Is Table the right container? Yes it is. > How do I address individual cells? > All assistance appreciated You can enumerate table elements using forall, foreach. But it is better to index cells in an independent way. E.g. you can extend Gtk_Table_Record putting an index accelerator in there: type Button_List is array (Positive range <>, Positive range <>) of Gtk_Button; type Gtk_Keyboard_Record (Rows, Columns : Positive) is new Gtk_Table_Record is with record Buttons (1..Rows, 1..Columns); end record; type Gtk_Keyboard is access all Gtk_Keyboard_Record'Class; procedure Gtk_New ( Widget : in out Gtk_Keyboard; Rows, Columns : Positive ) is begin Widget := new Gtk_Keyboard_Record (Row, Columns); Initialize (Widget.all, Rows, Columns); end Gtk_New; procedure Initialize ( Widget : access Gtk_Keyboard_Record'Class Rows, Columns : Positive ) is begin Gtk.Table.Initialize (Widget.all, GInt (Rows), GInt (Columns)); -- ... Creating buttons and placing them into the table and the index end; etc -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de _______________________________________________ gtkada mailing list gtkada@... http://lists.adacore.com/mailman/listinfo/gtkada |
| Free embeddable forum powered by Nabble | Forum Help |