Home modules.gotpike.org
Username: Password: [Create Account]
[Forgot Password?]

Modules

ADT
Database
GTK2
GUI
IP
PiJAX
Public
Sql
Stdio
Subversion
System
Tools
Xosd
lua
v4l2
wx

Recent Changes

Public.Parser.XML2 1.50
Public.ZeroMQ 1.1
Public.Template.Mustache 1.0
Public.Protocols.XMPP 1.4
Sql.Provider.jdbc 1.0

Popular Downloads

Public.Parser.JSON2 1.0
Public.Parser.JSON 0.2
GTK2 2.23
Public.Web.FCGI 1.8
Public.Parser.XML2 1.48


Module Information
GUI.GTK2
Viewing contents of GUI_GTK2-0.1/alignment.cmod

#include "global.h"
#include "svalue.h"
#include "interpret.h"

#include 

/* This must be included last! */
#include "module.h"

#include "gtk2.h"

/*! @module GUI */
/*! @module GTK2 */
/*! @class Alignment
 *! 
 *! A widget which controls the alignment and size of its child
 *!
 *! @b{ Object Hierarchy @}
 *!
 *! @[Object] -> @[Widget] -> @[Container] -> @[Bin]
 *! -> Alignment
 */

PIKECLASS Alignment
 program_flags PROGRAM_USES_PARENT;
{
  INHERIT Bin;

  /*! @decl void create(float xalign, float yalign, float xscale, float yscale)
   *!
   *! Creates a new Alignment
   *!
   *! @param xalign
   *!    the horizontal alignment of the child widget, from 0 (left) to 1 (right).
   *! @param yalign
   *!    the vertical alignment of the child widget, from 0 (top) to 1 (bottom).
   *! @param xscale
   *!    the amount that the child widget expands horizontally to fill up unused@
   *!    space, from 0 to 1. A value of 0 indicates that the child widget should@
   *!    never expand. A value of 1 indicates that the child widget will expand@
   *!    to fill all of the space allocated for the Alignment.
   *! @param yscale 
   *!    the amount that the child widget expands vertically to fill up unused@
   *!    space, from 0 to 1. The values are similar to xscale.
   */
  PIKEFUN void create(float xalign, float yalign, float xscale, float yscale)
  {
    GTK2_LOW=(void*)gtk_alignment_new(xalign,yalign,xscale,yscale);
    pop_n_elems(args);
  }

  /*! @decl void set(float xalign, float yalign, float xscale, float yscale)
   *!
   *! Sets the Alignment values
   *!
   *! @param xalign
   *!    the horizontal alignment of the child widget, from 0 (left) to 1 (right).
   *! @param yalign
   *!    the vertical alignment of the child widget, from 0 (top) to 1 (bottom).
   *! @param xscale
   *!    the amount that the child widget expands horizontally to fill up unused@
   *!    space, from 0 to 1. A value of 0 indicates that the child widget should@
   *!    never expand. A value of 1 indicates that the child widget will expand@
   *!    to fill all of the space allocated for the Alignment.
   *! @param yscale 
   *!    the amount that the child widget expands vertically to fill up unused@
   *!    space, from 0 to 1. The values are similar to xscale.
   */
  PIKEFUN void set(float xalign, float yalign, float xscale, float yscale)
  {
    gtk_alignment_set(GTK_ALIGNMENT(GTK2_LOW),xalign,yalign,xscale,yscale);
    pop_n_elems(args);
  }

  /*! @decl int get_top_padding()
   *!
   *! Gets the padding for the top of the widget
   *!
   *! @returns
   *!    the padding for the top of the widget
   */
  PIKEFUN int get_top_padding()
  {
    guint i;
    gtk_alignment_get_padding(GTK_ALIGNMENT(GTK2_LOW),&i,NULL,NULL,NULL);
    RETURN i;
  }

  /*! @decl int get_bottom_padding()
   *!
   *! Gets the padding for the bottom of the widget
   *!
   *! @returns
   *!    the padding for the bottom of the widget
   */
  PIKEFUN int get_bottom_padding()
  {
    guint i;
    gtk_alignment_get_padding(GTK_ALIGNMENT(GTK2_LOW),NULL,&i,NULL,NULL);
    RETURN i;
  }

  /*! @decl int get_left_padding()
   *!
   *! Gets the padding for the left of the widget
   *!
   *! @returns
   *!    the padding for the left of the widget
   */
  PIKEFUN int get_left_padding()
  {
    guint i;
    gtk_alignment_get_padding(GTK_ALIGNMENT(GTK2_LOW),NULL,NULL,&i,NULL);
    RETURN i;
  }

  /*! @decl int get_right_padding()
   *!
   *! Gets the padding for the right of the widget
   *!
   *! @returns
   *!    the padding for the right of the widget
   */
  PIKEFUN int get_right_padding()
  {
    guint i;
    gtk_alignment_get_padding(GTK_ALIGNMENT(GTK2_LOW),NULL,NULL,NULL,&i);
    RETURN i;
  }

  /*! @decl void set_padding(int top, int bottom, int left, int right)
   *!
   *! Sets the padding on the different sides of the widget. The padding@
   *! adds blank space to the sides of the widget. For instance, this can@
   *! be used to indent the child widget towards the right by adding padding@
   *! on the left.
   *!
   *! @param top
   *!    the padding at the top of the widget
   *! @param bottom
   *!    the padding at the bottom of the widget
   *! @param left
   *!    the padding at the left of the widget
   *! @param right
   *!    the padding at the right of the widget
   */
  PIKEFUN void set_padding(int top, int bottom, int left, int right)
  {
    gtk_alignment_set_padding(GTK_ALIGNMENT(GTK2_LOW),top,bottom,left,right);
    pop_n_elems(args);
  }

  INIT
  {
  }

  EXIT
  {
  }

}

/*! @endclass */
/*! @endmodule */
/*! @endmodule */

void pike_init_gtk2_alignment(void)
{
  INIT
}

void pike_exit_gtk2_alignment(void)
{
  EXIT
}


gotpike.org | Copyright © 2004 - 2019 | Pike is a trademark of Department of Computer and Information Science, Linköping University