[gtkada] tutorial for Stock ?

Thomas De Contes d.l.tDeContes at free.fr
Sun Nov 21 04:00:09 CET 2010


Hi :-)



I would like to use Stock, particularly for icons, but if it's possible to have complete buttons or menu, it's so nice :-) (for example for keyboard accelerator, ...)

I have read this :
http://www.adacore.com/wp-content/files/auto_update/gtkada-docs/gtkada_rm/gtkada_rm/gtk-stock.ads.html
http://library.gnome.org/devel/gtk/stable/gtk-Stock-Items.html
But I find it too much brief



Is there somewhere a tutorial to use it, please ?


For example, I don't know if
- I can use Gtk_New_From_Stock
http://www.adacore.com/wp-content/files/auto_update/gtkada-docs/gtkada_rm/gtkada_rm/gtk-image_menu_item.ads.html#gtk-image_menu_item.ads:59:14
and then Set_Label
http://www.adacore.com/wp-content/files/auto_update/gtkada-docs/gtkada_rm/gtkada_rm/gtk-menu_item.ads.html#gtk-menu_item.ads:87:14
to keep all the Stock menu but the label that i want to personalize,
- I shouldn't modify a Stock item because of risk to disturb behavior or some other thing like that, due to "internal organization" of Stock items that must not be modified



About keyboard accelerators, it's not very clear too :


http://www.adacore.com/wp-content/files/auto_update/gtkada-docs/gtkada_rm/gtkada_rm/gtk-image_menu_item.ads.html#gtk-image_menu_item.ads:64:14

  procedure Gtk_New
    (Widget      : out Gtk_Image_Menu_Item;
     Stock_Id    : String;
     Accel_Group : Gtk.Accel_Group.Gtk_Accel_Group);
  --  Create a new Gtk_Image_Menu_Item with a label.
  --  If label contains an underscore, a mnemonic is created accordingly.

I think the doc is wrong, since it speaks about mnemonic instead of accelerator, and there is no label


Why is it called Gtk_New rather than Gtk_New_From_Stock, like the one immediately above ?


If i'm right, i can choose between
- use Gtk_New_From_Stock to create a Stock menu without keyboard accelerator,
- use Gtk_New and provide an Accel_Group, to create a Stock menu with its keyboard accelerator

Could someone confirm me that I have correctly understood, please ? :-)



-- 
Téléassistance / Télémaintenance
http://www.portparallele.com/ThomasDECONTES/




More information about the gtkada mailing list