<?xml version='1.0' encoding='utf-8' /> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html><head> <title>GtkAda: Gtk.Accel_Map</title> <link rel='stylesheet' href='gtkada_rm.css' type='text/css'> <script src='gtkada_rm.js' type='text/javascript'></script> </head><body> <div id='objectName'> <span><a href='index.html'><img src='home.png' alt='Toc' title='Table of Contents'/></a> <a href='gallery.html'><img src='gallery.png' alt='Gallery' title='Widgets gallery'/></a> <a href='entities.html'><img src='entities.png' alt='Index' title='Global Index'/></a> <a href='tree.html'><img src='tree.png' alt='Tree' title='Widgets Inheritance Tree'/></a> </span> Gtk.Accel_Map </div> <!-- objectName --> <div id='leftSide'> <div id='classHierarchy'> <h2>Hierarchy</h2> <ul class='top'> <li><img src='childtree.png' alt='_' /><a class='tree' onclick='treetoggle(this)'><img src='treeopen.png' alt='[-]' /></a><a href='glib-object.html'>GObject_Record</a></li><ul> <li><img src='childtree2.png' alt=' '/><img src='childtree.png' alt='_' />Gtk_Accel_Map_Record</li></ul> </ul> </div> <!-- classHierarchy --> <div id='navigation'> <h2>Navigation</h2> <ul> <li><a href='#Description' onclick='return switchPage("page1")'>Description</a></li> <li><a href='#Types' onclick='return switchPage("page1")'>Types</a></li> <li><a href='#Subprograms' onclick='return switchPage("page1")'>Subprograms</a> <ul> <li><a href='#Subprograms__General' onclick='return switchPage("page1")'>General</a></li> <li><a href='#Subprograms__Foreach' onclick='return switchPage("page1")'>Foreach</a></li> </ul> </li> <li><a href='#Signals' onclick='return switchPage("page2")'>Signals</a></li> </ul> </div> <!-- navigation --> </div> <!-- leftSide --> <div id='documentation'> <ul id='notebook'> <li id='tab_page1' class='current'><a href='' onclick='return !switchPage("page1")'>Entities</a></li> <li id='tab_page2'><a href='#Signals' onclick='return !switchPage("page2")'>Signals</a></li> </ul> <!-- notebook --> <div id='notebook_page1' class='notebookPage'> <a name='Description'></a> <div class='description'> <h2>Description</h2> An accel_map provides support for loading and saving accelerators (see also <a href='gtk-accel_group.html'>Gtk.Accel_Group</a>). </div> <!-- description --> <a name='Types'></a> <div id='types'> <h2>Types</h2> <ul> <li><a name='Gtk_Accel_Map_'></a> <div class='profile'><b>type</b> Gtk_Accel_Map <b>is</b> <b>access</b> <b>all</b> Gtk_Accel_Map_Record'Class;</div> <div class='comment'></div></li> <li><a name='Gtk_Accel_Map_Foreach_'></a> <div class='profile'><b>type</b> Gtk_Accel_Map_Foreach <b>is</b> <b>access</b> <b>procedure</b> (Data : System.Address; Accel_Path : String; Accel_Key : Gdk.Types.Gdk_Key_Type; Accel_Mods : Gdk.Types.Gdk_Modifier_Type; Changed : Boolean);</div> <div class='comment'>Changed is set to true if the keybinding was changed manually by the user, and thus would need saving during an accelerator map dump. </div></li> <li><a name='Gtk_Accel_Map_Record_'></a> <div class='profile'><b>type</b> Gtk_Accel_Map_Record <b>is</b> <b>new</b> <a href='glib-object.html'>Glib.Object.GObject_Record</a> <b>with</b> <b>null</b> <b>record</b>;</div> <div class='comment'></div></li> </ul> </div> <!-- types --> <a name='Subprograms'> </a> <a name='Subprograms__General'> </a> <div id='subprograms'> <h2>Subprograms</h2> <ul> <li><a name='Get_1_'></a> <div class='profile'><b>function</b> <span class='name'>Get</span> <b>return</b> Gtk_Accel_Map;</div> <div class='comment'>Gets the singleton global <a href='gtk-accel_map.html'>Gtk_Accel_Map</a> object. This object is useful only for notification of changes to the accelerator map via the ::changed signal; it isn't a parameter to the other accelerator map functions. </div></li> <li><a name='Get_Type_2_'></a> <div class='profile'><b>function</b> <span class='name'>Get_Type</span> <b>return</b> <a href='glib.html'>Glib.GType</a>;</div> <div class='comment'>Return the internal type used for a <a href='gtk-accel_map.html'>Gtk_Accel_Map</a> </div></li> <li><a name='Save_3_'></a> <div class='profile'><b>procedure</b> <span class='name'>Save</span> (File_Name : String);</div> <div class='comment'><a href='gtk-accel_map.html#Save_3_'>Save</a> the key shortcuts to a file. These are the shortcuts that might have been changed dynamically by the user, if the RC file (see Gtk.RC) contained the line "gtk-can-change-accels=1" </div></li> <li><a name='Load_4_'></a> <div class='profile'><b>procedure</b> <span class='name'>Load</span> (File_Name : String);</div> <div class='comment'><a href='gtk-accel_map.html#Load_4_'>Load</a> the key shortcuts from a file </div></li> <li><a name='Add_Entry_5_'></a> <div class='profile'><b>procedure</b> <span class='name'>Add_Entry</span> (Accel_Path : String; Accel_Key : Gdk.Types.Gdk_Key_Type; Accel_Mods : Gdk.Types.Gdk_Modifier_Type);</div> <div class='comment'>Register a new accelerator for a given menu item, within the global accelerator map. This function should only be called once per <tt>Accel_Path</tt>. To change it programmatically during runtime, use <a href='gtk-accel_map.html#Change_Entry_7_'>Change_Entry</a>. <tt>Accel_Path</tt> is of the form: <app>/Category1/Category2/.../Action", where "app" is a unique, application-specific identifier (for examples of valid <tt>Accel_Path</tt>, check the file created by <a href='gtk-accel_map.html#Save_3_'>Save</a> above). <p> For instance, the path in the testgtk application for the menu File->Open would be <testgtk>/file/open <p> Generally, the path need to be set explicitely for an item, through a call to <a href='gtk-menu_item.html#Set_Accel_Path_11_'>Gtk.Menu_Item.Set_Accel_Path</a> or <a href='gtk-widget.html#Set_Accel_Path_40_'>Gtk.Widget.Set_Accel_Path</a>. However, if the widget is created automatically through a <a href='gtk-item_factory.html'>Gtk.Item_Factory</a>, this is done automatically. <p> It is better to use this function instead of Add_Accelerator, since when the accelerators are changed interactively by the user, the new value will be shown properly in the menu, which wouldn't happen if they had been forced by Add_Accelerator. </div></li> <li><a name='Lookup_Entry_6_'></a> <div class='profile'><b>procedure</b> <span class='name'>Lookup_Entry</span> (Accel_Path : String; Key : <b>out</b> <a href='gtk-accel_group.html'>Gtk.Accel_Group.Gtk_Accel_Key</a>; Found : <b>out</b> Boolean);</div> <div class='comment'>Look up the accelerator for <tt>Accel_Path</tt>, and set <tt>Key</tt> appropriately. If no accelerator was set, <tt>Found</tt> is set to False, and the value of <tt>Key</tt> is meaningless. </div></li> <li><a name='Change_Entry_7_'></a> <div class='profile'><b>function</b> <span class='name'>Change_Entry</span> (Accel_Path : String; Accel_Key : Gdk.Types.Gdk_Key_Type; Accel_Mods : Gdk.Types.Gdk_Modifier_Type; Replace : Boolean) <b>return</b> Boolean;</div> <div class='comment'>Change the accelerator currently associated wtih <tt>Accel_Path</tt>. A change may not always be possible due to conflicts with other accelerators. <tt>Replace</tt> should be set to True if other accelerators may be deleted to resolve such conflicts. Returns True if the entry could be changed </div></li> <li><a name='Lock_Path_8_'></a> <div class='profile'><b>procedure</b> <span class='name'>Lock_Path</span> (Accel_Path : String);</div> <a name='Unlock_Path_9_'></a> <div class='profile'><b>procedure</b> <span class='name'>Unlock_Path</span> (Accel_Path : String);</div> <div class='comment'>Locks the given accelerator path. If the accelerator map doesn't yet contain an entry for <tt>Accel_Path</tt>, a new one is created. <p> Locking an accelerator path prevents its accelerator from being changed during runtime. A locked accelerator path can be unlocked by <a href='gtk-accel_map.html#Unlock_Path_9_'>Unlock_Path</a>. Refer to <a href='gtk-accel_map.html#Change_Entry_7_'>Change_Entry</a> for information about runtime accelerator changes. <p> If called more than once, <tt>Accel_Path</tt> remains locked until <a href='gtk-accel_map.html#Unlock_Path_9_'>Unlock_Path</a> has been called an equivalent number of times. <p> Note that locking of individual accelerator paths is independent from locking the Gtk_Accel_Group containing them. For runtime accelerator changes to be possible both the accelerator path and its accel group have to be unlocked. </div></li> <a name='Subprograms__Foreach'></a> <h3>Foreach</h3> <div class='description'></div> <li><a name='Add_Filter_10_'></a> <div class='profile'><b>procedure</b> <span class='name'>Add_Filter</span> (Filter_Pattern : String);</div> <div class='comment'>Adds a filter to the global list of accel path filters. Accel map entries whose accel path matches one of the filters are skipped by <a href='gtk-accel_map.html#Foreach_11_'>Foreach</a>. This function is intended for GTK+ modules that create their own menus, but don't want them to be saved into the applications accelerator map dump. </div></li> <li><a name='Foreach_11_'></a> <div class='profile'><b>procedure</b> <span class='name'>Foreach</span> (Data : System.Address; Func : Gtk_Accel_Map_Foreach);</div> <div class='comment'>Calls <tt>Func</tt> for each of the currently defined key shortcuts. <tt>Data</tt> is passed as is to <tt>Func</tt> </div></li> <li><a name='Foreach_Unfiltered_12_'></a> <div class='profile'><b>procedure</b> <span class='name'>Foreach_Unfiltered</span> (Data : System.Address; Func : Gtk_Accel_Map_Foreach);</div> <div class='comment'>Loops over all entries in the accelerator map, and execute <tt>Func</tt> on each. </div></li> </ul> </div> <!-- subprograms --> </div> <!-- notebook_page1 --> <div id='notebook_page2' class='notebookPage'> <a name='Signals'></a> <div id='signals'> <h2>Signals</h2> <ul> <li><div class='name'>changed</div> <div class='profile'><b>procedure</b> <span class='name'>Handler</span> (Map : Gtk_Accel_Map; Accel_Path : String; Accel_Key : Gdk_Key_Type; Accel_Mods : Gdk_Modifier_Type);</div> <div class='comment'> Notifies of a change in the global accelerator map. The path is also used as the detail for the signal, so it is possible to connect to changed::accel_path. <div></li> </ul> </div> <!-- signals --> </div> <!-- notebook_page2 --> <div id='notebook_page3' class='notebookPage'> </div> <!-- notebook_page3 --> </div> <!-- documentation --> <div id='rightSide'> <div id='Index'> <h2>Alphabetical Index</h2> <ul> <li><a href='#Add_Entry_5_' onclick='return switchPage("page1")'>Add_Entry</a></li> <li><a href='#Add_Filter_10_' onclick='return switchPage("page1")'>Add_Filter</a></li> <li><a href='#Change_Entry_7_' onclick='return switchPage("page1")'>Change_Entry</a></li> <li><a href='#Foreach_11_' onclick='return switchPage("page1")'>Foreach</a></li> <li><a href='#Foreach_Unfiltered_12_' onclick='return switchPage("page1")'>Foreach_Unfiltered</a></li> <li><a href='#Get_1_' onclick='return switchPage("page1")'>Get</a></li> <li><a href='#Get_Type_2_' onclick='return switchPage("page1")'>Get_Type</a></li> <li><a href='#Load_4_' onclick='return switchPage("page1")'>Load</a></li> <li><a href='#Lock_Path_8_' onclick='return switchPage("page1")'>Lock_Path</a></li> <li><a href='#Lookup_Entry_6_' onclick='return switchPage("page1")'>Lookup_Entry</a></li> <li><a href='#Save_3_' onclick='return switchPage("page1")'>Save</a></li> <li><a href='#Unlock_Path_9_' onclick='return switchPage("page1")'>Unlock_Path</a></li> </ul> </div> <!-- Index --> </div> <!-- rightSide --> <script language='javascript'>switchPage('page1'); adjust_height()</script> </body> </html>