Sophie

Sophie

distrib > Fedora > 15 > x86_64 > by-pkgid > 0d2c760c00774fa1d350bb3c66520f68 > files > 210

GtkAda-doc-2.14.1-4.fc15.noarch.rpm

<?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.Aspect_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.Aspect_Frame
</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='_' /><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='_' /><a class='tree' onclick='treetoggle(this)'><img src='treeopen.png' alt='[-]' /></a><a href='gtk-frame.html'>Gtk_Frame_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='childtree2.png' alt='  '/><img src='childtree.png' alt='_' />Gtk_Aspect_Frame_Record</li></ul>
</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-aspect_frame.html'>Gtk_Aspect_Frame</a> is the same type of widget as a frame, but it
constrains its child to a specific aspect ratio between its width
and its height.
<p>
This ratio can either be given explicitly by the user, or chosen from the
widget's initial size request (might be different from the one if was
actually given).
<p>
  </div> <!-- description -->

  <a name='Types'></a>
  <div id='types'>
   <h2>Types</h2>
   <ul>
     <li><a name='Gtk_Aspect_Frame_'></a>
         <div class='profile'><b>type</b> Gtk_Aspect_Frame <b>is</b> <b>access</b> <b>all</b> Gtk_Aspect_Frame_Record'Class;</div>
         <div class='comment'></div></li>
     <li><a name='Gtk_Aspect_Frame_Record_'></a>
         <div class='profile'><b>type</b> Gtk_Aspect_Frame_Record <b>is</b> <b>new</b> <a href='gtk-frame.html'>Gtk.Frame.Gtk_Frame_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>
  (Aspect_Frame : <b>out</b> Gtk_Aspect_Frame;
   Label        : UTF8_String;
   Xalign       : Gfloat;
   Yalign       : Gfloat;
   Ratio        : Gfloat;
   Obey_Child   : Boolean);</div>
<div class='comment'>Create a new <tt>Aspect_Frame</tt>.
If <tt>Label</tt> is the empty string, then the frame won't have any title.
<tt>Xalign</tt> and <tt>Yalign</tt> are constrained to the range 0.0 .. 1.0 and specify
the alignment of the child inside the frame (0.0 means either left or
top aligned, 1.0 means right or bottom aligned).
<tt>Ratio</tt> is the ratio width/height for the child of the frame.
If <tt>Obey_Child</tt> is True, then <tt>Ratio</tt> is ignored and the effective ratio
is taken from the child's requisition (ie the ideal size it asked
for at creation time).
</div></li>
     <li><a name='Initialize_2_'></a>
<div class='profile'><b>procedure</b> <span class='name'>Initialize</span>
  (Aspect_Frame : <b>access</b> Gtk_Aspect_Frame_Record'Class;
   Label        : UTF8_String;
   Xalign       : Gfloat;
   Yalign       : Gfloat;
   Ratio        : Gfloat;
   Obey_Child   : Boolean);</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='gtk.html'>Gtk.Gtk_Type</a>;</div>
<div class='comment'>Return the internal value associated with a <a href='gtk-aspect_frame.html'>Gtk_Aspect_Frame</a>.
</div></li>
     <li><a name='Set_4_'></a>
<div class='profile'><b>procedure</b> <span class='name'>Set</span>
  (Aspect_Frame : <b>access</b> Gtk_Aspect_Frame_Record;
   Xalign       : Gfloat;
   Yalign       : Gfloat;
   Ratio        : Gfloat;
   Obey_Child   : Boolean);</div>
<div class='comment'>Modify the frame's parameters (see the description of these parameters
for <a href='gtk-aspect_frame.html#Gtk_New_1_'>Gtk_New</a>.
</div></li>
     <li><a name='Get_Ratio_5_'></a>
<div class='profile'><b>function</b> <span class='name'>Get_Ratio</span>
  (Aspect_Frame : <b>access</b> Gtk_Aspect_Frame_Record) <b>return</b> Gfloat;</div>
<div class='comment'>Return the current ratio for the frame (width / height)
</div></li>
     <li><a name='Get_Xalign_6_'></a>
<div class='profile'><b>function</b> <span class='name'>Get_Xalign</span>
  (Aspect_Frame : <b>access</b> Gtk_Aspect_Frame_Record) <b>return</b> Gfloat;</div>
<div class='comment'>Return the current X alignment for the frame.
0.0 means the child is left aligned, 1.0 that it is right aligned.
</div></li>
     <li><a name='Get_Yalign_7_'></a>
<div class='profile'><b>function</b> <span class='name'>Get_Yalign</span>
  (Aspect_Frame : <b>access</b> Gtk_Aspect_Frame_Record) <b>return</b> Gfloat;</div>
<div class='comment'>Return the current Y alignment for the frame.
1.0 means the child is top aligned, 1.0 that it is bottom aligned.
</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'>Obey_Child_Property</div>
            <div class='profile'>Boolean</div>
            <div class='comment'>Force aspect ratio to match that of the frame's child
<br><b>See:</b> <a href='gtk-aspect_frame.html#Set_4_'>Set</a> and <a href='gtk-aspect_frame.html#Get_Ratio_5_'>Get_Ratio</a></div></li>
        <li><div class='name'>Ratio_Property</div>
            <div class='profile'>Gfloat</div>
            <div class='comment'>Aspect ratio if obey_child is FALSE
<br><b>See:</b> <a href='gtk-aspect_frame.html#Set_4_'>Set</a> and <a href='gtk-aspect_frame.html#Get_Ratio_5_'>Get_Ratio</a></div></li>
        <li><div class='name'>Xalign_Property</div>
            <div class='profile'>Gfloat</div>
            <div class='comment'>X alignment of the child
<br><b>See:</b> <a href='gtk-aspect_frame.html#Set_4_'>Set</a> and <a href='gtk-aspect_frame.html#Get_Xalign_6_'>Get_Xalign</a></div></li>
        <li><div class='name'>Yalign_Property</div>
            <div class='profile'>Gfloat</div>
            <div class='comment'>Y alignment of the child
<br><b>See:</b> <a href='gtk-aspect_frame.html#Set_4_'>Set</a> and <a href='gtk-aspect_frame.html#Get_Xalign_6_'>Get_Xalign</a></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_Ratio_5_' onclick='return switchPage("page1")'>Get_Ratio</a></li>
   <li><a href='#Get_Type_3_' onclick='return switchPage("page1")'>Get_Type</a></li>
   <li><a href='#Get_Xalign_6_' onclick='return switchPage("page1")'>Get_Xalign</a></li>
   <li><a href='#Get_Yalign_7_' onclick='return switchPage("page1")'>Get_Yalign</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_4_' onclick='return switchPage("page1")'>Set</a></li>
  </ul>
 </div> <!-- Index -->
</div> <!-- rightSide -->

   <script language='javascript'>switchPage('page1');
adjust_height()</script>
 </body>
</html>