📄 gtkhandlebox.html
字号:
<HTML><HEAD><TITLE>GtkHandleBox</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.61"><LINKREL="HOME"TITLE="GTK+ Reference Manual"HREF="index.html"><LINKREL="UP"TITLE="GTK+ Widgets and Objects"HREF="gtkobjects.html"><LINKREL="PREVIOUS"TITLE="GtkGammaCurve"HREF="gtkgammacurve.html"><LINKREL="NEXT"TITLE="GtkHButtonBox"HREF="gtkhbuttonbox.html"></HEAD><BODYCLASS="REFENTRY"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLEWIDTH="100%"BORDER="0"BGCOLOR="#000000"CELLPADDING="1"CELLSPACING="0"><TR><THCOLSPAN="4"ALIGN="center"><FONTCOLOR="#FFFFFF"SIZE="5">GTK+ Reference Manual</FONT></TH></TR><TR><TDWIDTH="25%"BGCOLOR="#C00000"ALIGN="left"><AHREF="gtkgammacurve.html"><FONTCOLOR="#FFFFFF"SIZE="3"><B><<< Previous Page</B></FONT></A></TD><TDWIDTH="25%"BGCOLOR="#0000C0"ALIGN="center"><FONTCOLOR="#FFFFFF"SIZE="3"><B><AHREF="index.html"><FONTCOLOR="#FFFFFF"SIZE="3"><B>Home</B></FONT></A></B></FONT></TD><TDWIDTH="25%"BGCOLOR="#00C000"ALIGN="center"><FONTCOLOR="#FFFFFF"SIZE="3"><B><AHREF="gtkobjects.html"><FONTCOLOR="#FFFFFF"SIZE="3"><B>Up</B></FONT></A></B></FONT></TD><TDWIDTH="25%"BGCOLOR="#C00000"ALIGN="right"><AHREF="gtkhbuttonbox.html"><FONTCOLOR="#FFFFFF"SIZE="3"><B>Next Page >>></B></FONT></A></TD></TR></TABLE></DIV><H1><ANAME="GTKHANDLEBOX">GtkHandleBox</A></H1><DIVCLASS="REFNAMEDIV"><ANAME="AEN26892"></A><H2>Name</H2>GtkHandleBox -- a widget for detachable window portions.</DIV><DIVCLASS="REFSYNOPSISDIV"><ANAME="AEN26895"></A><H2>Synopsis</H2><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="SYNOPSIS"> #include <gtk/gtk.h>struct <AHREF="gtkhandlebox.html#GTKHANDLEBOX-STRUCT">GtkHandleBox</A>;<AHREF="gtkwidget.html">GtkWidget</A>* <AHREF="gtkhandlebox.html#GTK-HANDLE-BOX-NEW">gtk_handle_box_new</A> (void);void <AHREF="gtkhandlebox.html#GTK-HANDLE-BOX-SET-SHADOW-TYPE">gtk_handle_box_set_shadow_type</A> (<AHREF="gtkhandlebox.html">GtkHandleBox</A> *handle_box, <AHREF="gtk-standard-enumerations.html#GTKSHADOWTYPE">GtkShadowType</A> type);void <AHREF="gtkhandlebox.html#GTK-HANDLE-BOX-SET-HANDLE-POSITION">gtk_handle_box_set_handle_position</A> (<AHREF="gtkhandlebox.html">GtkHandleBox</A> *handle_box, <AHREF="gtk-standard-enumerations.html#GTKPOSITIONTYPE">GtkPositionType</A> position);void <AHREF="gtkhandlebox.html#GTK-HANDLE-BOX-SET-SNAP-EDGE">gtk_handle_box_set_snap_edge</A> (<AHREF="gtkhandlebox.html">GtkHandleBox</A> *handle_box, <AHREF="gtk-standard-enumerations.html#GTKPOSITIONTYPE">GtkPositionType</A> edge); </PRE></TD></TR></TABLE></DIV><DIVCLASS="REFSECT1"><ANAME="AEN26910"></A><H2>Object Hierarchy</H2><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="SYNOPSIS"> <AHREF="gtkobject.html">GtkObject</A> +----<AHREF="gtkwidget.html">GtkWidget</A> +----<AHREF="gtkcontainer.html">GtkContainer</A> +----<AHREF="gtkbin.html">GtkBin</A> +----GtkHandleBox</PRE></TD></TR></TABLE></DIV><DIVCLASS="REFSECT1"><ANAME="AEN26917"></A><H2>Args</H2><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="SYNOPSIS"> "<AHREF="gtkhandlebox.html#GTKHANDLEBOX--SHADOW">shadow</A>" <AHREF="gtk-standard-enumerations.html#GTKSHADOWTYPE">GtkShadowType</A> : Read / Write</PRE></TD></TR></TABLE></DIV><DIVCLASS="REFSECT1"><ANAME="AEN26922"></A><H2>Signal Prototypes</H2><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="SYNOPSIS"> "<AHREF="gtkhandlebox.html#GTKHANDLEBOX-CHILD-ATTACHED">child-attached</A>" void user_function (<AHREF="gtkhandlebox.html">GtkHandleBox</A> *handlebox, <AHREF="gtkwidget.html">GtkWidget</A> *widget, <AHREF=../glib/glib-basic-types.html#GPOINTER>gpointer</A> user_data);"<AHREF="gtkhandlebox.html#GTKHANDLEBOX-CHILD-DETACHED">child-detached</A>" void user_function (<AHREF="gtkhandlebox.html">GtkHandleBox</A> *handlebox, <AHREF="gtkwidget.html">GtkWidget</A> *widget, <AHREF=../glib/glib-basic-types.html#GPOINTER>gpointer</A> user_data);</PRE></TD></TR></TABLE></DIV><DIVCLASS="REFSECT1"><ANAME="AEN26933"></A><H2>Description</H2><P>The <AHREF="gtkhandlebox.html">GtkHandleBox</A> widget allows a portion of a window to be "tornoff". It is a bin widget which displays its child and a handle thatthe user can drag to tear off a separate window (the <ICLASS="FIRSTTERM">floatwindow</I>) containing the child widget. A thin<ICLASS="FIRSTTERM">ghost</I> is drawn in the original location of thehandlebox. By dragging the separate window back to its originallocation, it can be reattached.</P><P>When reattaching, the ghost and float window, must be alignedalong one of the edges, the <ICLASS="FIRSTTERM">snap edge</I>.This either can be specified by the application programmerexplicitely, or GTK+ will pick a reasonable default basedon the handle position.</P><P>To make detaching and reattaching the handlebox as minimally confusingas possible to the user, it is important to set the snap edge so thatthe snap edge does not move when the handlebox is deattached. Forinstance, if the handlebox is packed at the bottom of a VBox, thenwhen the handlebox is detached, the bottom edge of the handlebox'sallocation will remain fixed as the height of the handlebox shrinks,so the snap edge should be set to <TTCLASS="LITERAL">GTK_POS_BOTTOM</TT>.</P></DIV><DIVCLASS="REFSECT1"><ANAME="AEN26943"></A><H2>Details</H2><DIVCLASS="REFSECT2"><ANAME="AEN26945"></A><H3><ANAME="GTKHANDLEBOX-STRUCT"></A>struct GtkHandleBox</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">struct GtkHandleBox;</PRE></TD></TR></TABLE><P>The <AHREF="gtkhandlebox.html#GTKHANDLEBOX-STRUCT">GtkHandleBox</A> struct contains the following fields.(These fields should be considered read-only. They should never be set byan application.)<DIVCLASS="INFORMALTABLE"><ANAME="AEN26951"></A><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFF0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="LEFT"VALIGN="TOP">GtkShadowType shadow_type;</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">The shadow type for the entry. (See <AHREF="gtkhandlebox.html#GTK-HANDLE-BOX-SET-SHADOW-TYPE">gtk_handle_box_set_shadow_type</A>()).</TD></TR><TR><TDWIDTH="20%"ALIGN="LEFT"VALIGN="TOP">GtkPositionType handle_position;</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">The position of the handlebox's handle with respectto the child. (See <AHREF="gtkhandlebox.html#GTK-HANDLE-BOX-SET-HANDLE-POSITION">gtk_handle_box_set_handle_position</A>())</TD></TR><TR><TDWIDTH="20%"ALIGN="LEFT"VALIGN="TOP">gint snap_edge;</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">A value of type GtkPosition type indicating snap edge for the widget.(See gtk_handle_box_set_snap_edge). The value of -1 indicatesthat this value has not been set.</TD></TR><TR><TDWIDTH="20%"ALIGN="LEFT"VALIGN="TOP"><AHREF=../glib/glib-basic-types.html#GBOOLEAN>gboolean</A> child_detached;</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">A boolean value indicating whether the handlebox'schild is attached or detached.</TD></TR></TBODY></TABLE><P></P></DIV> </P></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN26972"></A><H3><ANAME="GTK-HANDLE-BOX-NEW"></A>gtk_handle_box_new ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING"><AHREF="gtkwidget.html">GtkWidget</A>* gtk_handle_box_new (void);</PRE></TD></TR></TABLE><P>Create a new handle box.</P><DIVCLASS="INFORMALTABLE"><ANAME="AEN26978"></A><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><ICLASS="EMPHASIS">Returns</I> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP">a new <AHREF="gtkhandlebox.html">GtkHandleBox</A>. </TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN26988"></A><H3><ANAME="GTK-HANDLE-BOX-SET-SHADOW-TYPE"></A>gtk_handle_box_set_shadow_type ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">void gtk_handle_box_set_shadow_type (<AHREF="gtkhandlebox.html">GtkHandleBox</A> *handle_box, <AHREF="gtk-standard-enumerations.html#GTKSHADOWTYPE">GtkShadowType</A> type);</PRE></TD></TR></TABLE><P>Sets the type of shadow to be drawn around the borderof the </P><DIVCLASS="INFORMALTABLE"><ANAME="AEN26995"></A><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>handle_box</I></TT> :</TD><TDWIDTH="80%"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -