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/container.cmod

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

#include 

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

#include "gtk2.h"

/* Global variables
 */

#define tObjImpl_WIDGET tObj

/*! @module GUI */
/*! @module GTK2 */
/*! @class Container
 *!   
 *! Base class for widgets which contain other widgets
 *!
 *! @b{ Object Hierarchy @}
 *!
 *! @[Object] -> @[Widget] -> Container
 *!
 *! @b{ Signal Prototypes @}
 *!
 *! @i{"add"@} void user_function (Container container, Widget widget, mixed user_data)
 *!
 *! @i{"check-resize"@} void user_function (Container container, mixed user_data)
 *!
 *! @i{"remove"@} void user_function (Container container, Widget widget, mixed user_data)
 *!
 *! @i{"set-focus-child"@} void user_function (Container container, Widget widget, mixed user_data)
 */

PIKECLASS Container
 program_flags PROGRAM_USES_PARENT;
{
  INHERIT Widget;

  /*! @decl void add(Widget widget)
   *!
   *! Adds widget to this Container. Typically used for simple
   *! containers such as Window, Frame, or Button; for more
   *! complicated layout containers such as Box or Table,
   *! this function will pick default packing parameters that may
   *! not be correct. So consider functions such as Box->pack_start()
   *! and Table->attach() as an alternative to add() in those cases.
   *! A widget may be added to only one container at a time; you can't
   *! place the same widget inside two different containers.
   *!
   *! FIXME: implement Frame, Button, Box, Table
   */
  PIKEFUN void add(Widget widget)
  {
    gtk_container_add(GTK_CONTAINER(GTK2_LOW),
      GTK_WIDGET(
        ((struct Object_struct*)get_storage(Pike_sp[-args].u.ptr, Object_program))->data
      ));
    pop_n_elems(args);
  }

  /*! @decl void remove(Widget widget)
   *!
   *! Removes widget from this Container. widget must be inside this
   *! Container. Note that this Container will own a reference to
   *! widget, and that this may be the last reference held; so removing
   *! a widget from its container can destroy that widget. If you want
   *! to use widget again, you need to add a reference to it while it's
   *! not inside a container, using g_object_ref(). If you don't want to
   *! use widget again it's usually more efficient to simply destroy it
   *! directly using destroy() since this will remove it from the
   *! container and help break any circular reference count cycles.
   *!
   *! FIXME: implement g_object_ref();
   */
  PIKEFUN void remove(Widget widget)
  {
    gtk_container_remove(GTK_CONTAINER(GTK2_LOW),
      GTK_WIDGET(
        ((struct Object_struct*)get_storage(Pike_sp[-args].u.ptr, Object_program))->data
      ) );
    pop_n_elems(args);
  }





  INIT
  {
  }

  EXIT
  {
  }

}

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

void pike_init_gtk2_container(void)
{
  INIT
}

void pike_exit_gtk2_container(void)
{
  EXIT
}


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