<?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.Frame</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.Frame </div> <!-- objectName --> <div id='leftSide'> <div id='screenshot'> <h2>Screenshot</h2> <img src='gtk-frame.png' alt='No screeshot'/> </div> <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='_' /><a class='tree' onclick='treetoggle(this)'><img src='treeopen.png' alt='[-]' /></a><a href='gtk-object.html'>Gtk_Object_Record</a></li><ul> <li><img src='childtree2.png' alt=' '/><img src='childtree2.png' alt=' '/><img src='childtree.png' alt='_' /><a class='tree' onclick='treetoggle(this)'><img src='treeopen.png' alt='[-]' /></a><a href='gtk-widget.html'>Gtk_Widget_Record</a></li><ul> <li><img src='childtree2.png' alt=' '/><img src='childtree2.png' alt=' '/><img src='childtree2.png' alt=' '/><img src='childtree.png' alt='_' /><a class='tree' onclick='treetoggle(this)'><img src='treeopen.png' alt='[-]' /></a><a href='gtk-container.html'>Gtk_Container_Record</a></li><ul> <li><img src='childtree2.png' alt=' '/><img src='childtree2.png' alt=' '/><img src='childtree2.png' alt=' '/><img src='childtree2.png' alt=' '/><img src='childtree.png' alt='_' /><a class='tree' onclick='treetoggle(this)'><img src='treeopen.png' alt='[-]' /></a><a href='gtk-bin.html'>Gtk_Bin_Record</a></li><ul> <li><img src='childtree2.png' alt=' '/><img src='childtree2.png' alt=' '/><img src='childtree2.png' alt=' '/><img src='childtree2.png' alt=' '/><img src='childtree2.png' alt=' '/><img src='childtree.png' alt='_' />Gtk_Frame_Record</li></ul> </ul> </ul> </ul> </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> </ul> </li> <li><a href='#Signals' onclick='return switchPage("page2")'>Signals</a></li> <li><a href='#Properties' onclick='return switchPage("page3")'>Properties</a></li> <li><a href='#Testgtk' onclick='return switchPage("page5")'>Testgtk</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> <li id='tab_page3'><a href='#Properties' onclick='return !switchPage("page3")'>Properties</a></li> <li id='tab_page5'><a href='#Testgtk' onclick='return !switchPage("page5")'>Testgtk</a></li> </ul> <!-- notebook --> <div id='notebook_page1' class='notebookPage'> <a name='Description'></a> <div class='description'> <h2>Description</h2> A <a href='gtk-frame.html'>Gtk_Frame</a> is a simple border than can be added to any widget or group of widget to enhance its visual aspect. Optionally, a frame can have a title. <p> This is a very convenient widget to visually group related widgets (like groups of buttons for instance), possibly with a title to explain the purpose of this group. <p> A <a href='gtk-frame.html'>Gtk_Frame</a> has only one child, so you have to put a container like for instance a Gtk_Box inside if you want the frame to surround multiple widgets. <p> </div> <!-- description --> <a name='Types'></a> <div id='types'> <h2>Types</h2> <ul> <li><a name='Gtk_Frame_'></a> <div class='profile'><b>type</b> Gtk_Frame <b>is</b> <b>access</b> <b>all</b> Gtk_Frame_Record'Class;</div> <div class='comment'></div></li> <li><a name='Gtk_Frame_Record_'></a> <div class='profile'><b>type</b> Gtk_Frame_Record <b>is</b> <b>new</b> <a href='gtk-bin.html'>Gtk.Bin.Gtk_Bin_Record</a> <b>with</b> <b>private</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='Gtk_New_1_'></a> <div class='profile'><b>procedure</b> <span class='name'>Gtk_New</span> (Frame : <b>out</b> Gtk_Frame; Label : UTF8_String := "");</div> <div class='comment'>Create a new frame. If <tt>Label</tt> is not the empty string, the frame will have a title. </div></li> <li><a name='Initialize_2_'></a> <div class='profile'><b>procedure</b> <span class='name'>Initialize</span> (Frame : <b>access</b> Gtk_Frame_Record'Class; Label : UTF8_String := "");</div> <div class='comment'>Internal initialization function. See the section "Creating your own widgets" in the documentation. </div></li> <li><a name='Get_Type_3_'></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 value associated with a <a href='gtk-frame.html'>Gtk_Frame</a>. </div></li> <li><a name='Set_Label_4_'></a> <div class='profile'><b>procedure</b> <span class='name'>Set_Label</span> (Frame : <b>access</b> Gtk_Frame_Record; Label : UTF8_String := "");</div> <a name='Get_Label_5_'></a> <div class='profile'><b>function</b> <span class='name'>Get_Label</span> (Frame : <b>access</b> Gtk_Frame_Record) <b>return</b> UTF8_String;</div> <div class='comment'>Change the label of the frame dynamically. If <tt>Label</tt> is the empty string, the frame's label is deleted. </div></li> <li><a name='Set_Label_Widget_6_'></a> <div class='profile'><b>procedure</b> <span class='name'>Set_Label_Widget</span> (Frame : <b>access</b> Gtk_Frame_Record; Label_Widget : <b>access</b> <a href='gtk-widget.html'>Gtk.Widget.Gtk_Widget_Record</a>'Class);</div> <a name='Get_Label_Widget_7_'></a> <div class='profile'><b>function</b> <span class='name'>Get_Label_Widget</span> (Frame : <b>access</b> Gtk_Frame_Record) <b>return</b> <a href='gtk-widget.html'>Gtk.Widget.Gtk_Widget</a>;</div> <div class='comment'>Set the label widget for the frame. This is the widget that will appear embedded in the top edge of the frame as a title. </div></li> <li><a name='Set_Label_Align_8_'></a> <div class='profile'><b>procedure</b> <span class='name'>Set_Label_Align</span> (Frame : <b>access</b> Gtk_Frame_Record; Xalign : Gfloat := 0.0; Yalign : Gfloat := 0.0);</div> <div class='comment'>Change the alignment of the title in the frame. <tt>Xalign</tt> and <tt>Yalign</tt> are both percents that indicate the exact position of the label relative to the top-left corner of the frame. Note that <tt>Yalign</tt> is currently ignored, and the label can only be displayed on the top of the frame (0.0 for <tt>Xalign</tt> means align the label on the left, 1.0 means align the label on the right). </div></li> <li><a name='Get_Label_Align_9_'></a> <div class='profile'><b>procedure</b> <span class='name'>Get_Label_Align</span> (Frame : <b>access</b> Gtk_Frame_Record; Xalign : <b>out</b> Gfloat; Yalign : <b>out</b> Gfloat);</div> <div class='comment'>Return the X and Y alignments of the title in the frame. </div></li> <li><a name='Set_Shadow_Type_10_'></a> <div class='profile'><b>procedure</b> <span class='name'>Set_Shadow_Type</span> (Frame : <b>access</b> Gtk_Frame_Record; The_Type : Gtk_Shadow_Type);</div> <div class='comment'>Change the visual aspect of the frame. </div></li> <li><a name='Get_Shadow_Type_11_'></a> <div class='profile'><b>function</b> <span class='name'>Get_Shadow_Type</span> (Frame : <b>access</b> Gtk_Frame_Record) <b>return</b> Gtk_Shadow_Type;</div> <div class='comment'>Return the visual aspect of the frame. </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> </ul> </div> <!-- signals --> </div> <!-- notebook_page2 --> <div id='notebook_page3' class='notebookPage'> <a name='Properties'></a> <div class='properties'> <h2>Properties</h2> <ul> <li><div class='name'>Label_Property</div> <div class='profile'>UTF8_String</div> <div class='comment'>Text of the frame's label. <br><b>See:</b> <a href='gtk-frame.html#Set_Label_4_'>Set_Label</a> and <a href='gtk-frame.html#Get_Label_5_'>Get_Label</a></div></li> <li><div class='name'>Label_Widget_Property</div> <div class='profile'>Gtk_Widget'Class</div> <div class='comment'>A widget to display in place of the usual frame label. <br><b>See:</b> <a href='gtk-frame.html#Set_Label_Widget_6_'>Set_Label_Widget</a></div></li> <li><div class='name'>Label_Xalign_Property</div> <div class='profile'>Float</div> <div class='comment'>The horizontal alignment of the label </div></li> <li><div class='name'>Label_Yalign_Property</div> <div class='profile'>Float</div> <div class='comment'>The vertical alignment of the label </div></li> <li><div class='name'>Shadow_Property</div> <div class='profile'>Gtk_Shadow_Type</div> <div class='comment'>Appearance of the frameborder. <br><b>See:</b> <a href='gtk-frame.html#Set_Shadow_Type_10_'>Set_Shadow_Type</a></div></li> <li><div class='name'>Shadow_Type_Property</div> <div class='profile'>Enum</div> <div class='comment'>Appearance of the frame border </div></li> </ul> </div> <!-- properties --> </div> <!-- notebook_page3 --> <div id='notebook_page5' class='notebookPage'> <a name='Testgtk'></a> <div id='testgtk'><h2>Testgtk source code</h2><div class='description'>This code is part of testgtk, a demo application packaged with GtkAda. Testgtk demonstrates the various widgets of GtkAda</div><i>-----------------------------------------------------------------------</i> <i>-- GtkAda - Ada95 binding for the Gimp Toolkit --</i> <i>-- --</i> <i>-- Copyright (C) 1998-2000 --</i> <i>-- Emmanuel Briot, Joel Brobecker and Arnaud Charlet --</i> <i>-- --</i> <i>-- This library is free software; you can redistribute it and/or --</i> <i>-- modify it under the terms of the GNU General Public --</i> <i>-- License as published by the Free Software Foundation; either --</i> <i>-- version 2 of the License, or (at your option) any later version. --</i> <i>-- --</i> <i>-- This library is distributed in the hope that it will be useful, --</i> <i>-- but WITHOUT ANY WARRANTY; without even the implied warranty of --</i> <i>-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --</i> <i>-- General Public License for more details. --</i> <i>-- --</i> <i>-- You should have received a copy of the GNU General Public --</i> <i>-- License along with this library; if not, write to the --</i> <i>-- Free Software Foundation, Inc., 59 Temple Place - Suite 330, --</i> <i>-- Boston, MA 02111-1307, USA. --</i> <i>-- --</i> <i>-- --</i> <i>-- --</i> <i>-- --</i> <i>-- --</i> <i>-- --</i> <i>-- --</i> <i>-- --</i> <i>-----------------------------------------------------------------------</i> <b>with</b> Glib; <b>use</b> Glib; <b>with</b> Gtk.Table; <b>use</b> Gtk.Table; <b>with</b> Gtk.Enums; <b>use</b> Gtk.Enums; <b>with</b> Gtk.Frame; <b>use</b> Gtk.Frame; <b>with</b> Gtk.Label; <b>use</b> Gtk.Label; <b>package</b> <b>body</b> Create_Frame <b>is</b> <i> ----------</i> <i> -- Help --</i> <i> ----------</i> <b>function</b> Help <b>return</b> String <b>is</b> <b>begin</b> <b>return</b> "This demo shows the different kinds <b>of</b> shadows that are" & " available <b>for</b> frames, as well as the positions that the label" & " <b>of</b> the frame can have." & ASCII.LF & "Note that the label must be displayed <b>at</b> the top <b>of</b> the frame" & " <b>and</b> can <b>not</b> be displayed elsewhere." & ASCII.LF & "If you want to constrained the child to a specific aspect ratio" & " even <b>when</b> the frame <b>is</b> resized, you should look <b>at</b> the" & " @bGtk_Aspect_Frame@B widget instead."; <b>end</b> Help; <i> ---------</i> <i> -- Run --</i> <i> ---------</i> <b>procedure</b> Run (Frame : <b>access</b> Gtk.Frame.Gtk_Frame_Record'Class) <b>is</b> Table : Gtk_Table; Label : Gtk_Label; Frame2 : Gtk_Frame; <b>begin</b> Gtk.Frame.Set_Label (Frame, "Frames"); Gtk_New (Table, Rows => 3, Columns => 2, Homogeneous => True); Set_Row_Spacings (Table, Spacing => 5); Set_Col_Spacings (Table, Spacing => 5); Set_Border_Width (Table, Border_Width => 10); Add (Frame, Table); <i> -- First frame</i> Gtk_New (Frame2, ""); Set_Shadow_Type (Frame2, Gtk.Enums.Shadow_In); Attach_Defaults (Table, Frame2, 0, 1, 0, 1); Gtk_New (Label, "Shadow_In"); Add (Frame2, Label); <i> -- Second Frame</i> Gtk_New (Frame2, ""); Set_Shadow_Type (Frame2, Gtk.Enums.Shadow_Out); Attach_Defaults (Table, Frame2, 1, 2, 0, 1); Gtk_New (Label, "Shadow_Out"); Add (Frame2, Label); <i> -- Third Frame</i> Gtk_New (Frame2, ""); Set_Shadow_Type (Frame2, Gtk.Enums.Shadow_Etched_In); Attach_Defaults (Table, Frame2, 0, 1, 1, 2); Gtk_New (Label, "Shadow_Etched_In"); Add (Frame2, Label); <i> -- Fourth Frame</i> Gtk_New (Frame2, ""); Set_Shadow_Type (Frame2, Gtk.Enums.Shadow_Etched_Out); Attach_Defaults (Table, Frame2, 1, 2, 1, 2); Gtk_New (Label, "Shadow_Etched_Out"); Add (Frame2, Label); <i> -- Fifth Frame</i> Gtk_New (Frame2, "Title"); Set_Label_Align (Frame2, Xalign => 0.2); Attach_Defaults (Table, Frame2, 0, 1, 2, 3); Gtk_New (Label, "Label_Align: Xalign = 0.2"); Add (Frame2, Label); <i> -- Sixth Frame</i> Gtk_New (Frame2, "Title"); Set_Label_Align (Frame2, Xalign => 0.8); Attach_Defaults (Table, Frame2, 1, 2, 2, 3); Gtk_New (Label, "Label_Align: Xalign = 0.8"); Add (Frame2, Label); Show_All (Frame); <b>end</b> Run; <b>end</b> Create_Frame; </div> <!-- testgtk --> </div> <!-- notebook_page4 --> </div> <!-- documentation --> <div id='rightSide'> <div id='Index'> <h2>Alphabetical Index</h2> <ul> <li><a href='#Get_Label_5_' onclick='return switchPage("page1")'>Get_Label</a></li> <li><a href='#Get_Label_Align_9_' onclick='return switchPage("page1")'>Get_Label_Align</a></li> <li><a href='#Get_Label_Widget_7_' onclick='return switchPage("page1")'>Get_Label_Widget</a></li> <li><a href='#Get_Shadow_Type_11_' onclick='return switchPage("page1")'>Get_Shadow_Type</a></li> <li><a href='#Get_Type_3_' onclick='return switchPage("page1")'>Get_Type</a></li> <li><a href='#Gtk_New_1_' onclick='return switchPage("page1")'>Gtk_New</a></li> <li><a href='#Initialize_2_' onclick='return switchPage("page1")'>Initialize</a></li> <li><a href='#Set_Label_4_' onclick='return switchPage("page1")'>Set_Label</a></li> <li><a href='#Set_Label_Align_8_' onclick='return switchPage("page1")'>Set_Label_Align</a></li> <li><a href='#Set_Label_Widget_6_' onclick='return switchPage("page1")'>Set_Label_Widget</a></li> <li><a href='#Set_Shadow_Type_10_' onclick='return switchPage("page1")'>Set_Shadow_Type</a></li> </ul> </div> <!-- Index --> </div> <!-- rightSide --> <script language='javascript'>switchPage('page1'); adjust_height()</script> </body> </html>