📄 listbox.html
字号:
<HTML><HEAD><TITLE>ListBox</TITLE></HEAD><BODY BGCOLOR=white><DL><DT><I><A HREF="#descr">NAME</A></I></DT><DD><B>ListBox</B> - ListBox widget</DD></DL><DL><DT><I>CREATION</I></DT><DD><A HREF="#descr"><B>ListBox</B></A> <I>pathName</I> ?<I>option value...</I>?</DD></DL><DL><DT><I>STANDARD OPTIONS</I></DT><DD><TABLE CELLSPACING=0 CELLSPACING=0 BORDER=0><TR><TD> <A HREF="options.htm#M-background">-background or -bg</A></TD><TD> <A HREF="options.htm#M-borderwidth">-borderwidth or -bd</A></TD></TR><TR><TD> <A HREF="options.htm#M-cursor">-cursor</A></TR><TD> <A HREF="options.htm#M-highlightbackground">-highlightbackground</A></TR></TR><TR><TD> <A HREF="options.htm#M-highlightcolor">-highlightcolor</A></TR><TD> <A HREF="options.htm#M-highlightthickness">-highlightthickness</A></TR></TR><TR><TD> <A HREF="options.htm#M-relief">-relief</A></TR><TD> <A HREF="options.htm#M-selectbackground">-selectbackground</A></TR></TR><TR><TD> <A HREF="options.htm#M-selectforeground">-selectforeground</A></TR><TD> <A HREF="options.htm#M-takefocus">-takefocus</A></TR></TR><TR><TD> <A HREF="options.htm#M-xscrollcommand">-xscrollcommand</A></TR><TD> <A HREF="options.htm#M-yscrollcommand">-yscrollcommand</A></TR></TR></TABLE></DD></DL><DL><DT><I><A HREF="#wso">WIDGET-SPECIFIC OPTIONS</A></I></DT><DD><TABLE CELLSPACING=0 CELLSPACING=0 BORDER=0><TR><TD> <A HREF="#-deltax">-deltax</A></TR><TD> <A HREF="#-deltay">-deltay</A></TR></TR><TR><TD> <A HREF="#-dragenabled">-dragenabled</A></TR><TD> <A HREF="#-dragendcmd">-dragendcmd</A></TR></TR><TR><TD> <A HREF="#-dragevent">-dragevent</A></TR><TD> <A HREF="#-draginitcmd">-draginitcmd</A></TR></TR><TR><TD> <A HREF="#-dragtype">-dragtype</A></TR><TD> <A HREF="#-dropcmd">-dropcmd</A></TR></TR><TR><TD> <A HREF="#-dropenabled">-dropenabled</A></TR><TD> <A HREF="#-dropovercmd">-dropovercmd</A></TR></TR><TR><TD> <A HREF="#-dropovermode">-dropovermode</A></TR><TD> <A HREF="#-droptypes">-droptypes</A></TR></TR><TR><TD> <A HREF="#-height">-height</A></TR><TD> <A HREF="#-multicolumn">-multicolumn</A></TR></TR><TR><TD> <A HREF="#-padx">-padx</A></TR><TD> <A HREF="#-redraw">-redraw</A></TR></TR><TR><TD> <A HREF="#-selectmode">-selectmode</A></TR><TD> <A HREF="#-width">-width</A></TR></TABLE></DD></DL><DL><DT><I><A HREF="#wc">WIDGET COMMAND</A></I></DT><DD><I>pathName</I> <A HREF="#bindImage"><B>bindImage</B></A> <I>event</I> <I>script</I></DD><DD><I>pathName</I> <A HREF="#bindText"><B>bindText</B></A> <I>event</I> <I>script</I></DD><DD><I>pathName</I> <A HREF="#cget"><B>cget</B></A> <I>option</I></DD><DD><I>pathName</I> <A HREF="#configure"><B>configure</B></A> ?<I>option</I>? ?<I>value</I> <I>option</I> <I>value</I> ...?</DD><DD><I>pathName</I> <A HREF="#delete"><B>delete</B></A> ?<I>arg...</I>?</DD><DD><I>pathName</I> <A HREF="#edit"><B>edit</B></A> <I>item</I> <I>text</I> ?<I>verifycmd</I>? ?<I>clickres</I>? ?<I>select</I>?</DD><DD><I>pathName</I> <A HREF="#exists"><B>exists</B></A> <I>item</I></DD><DD><I>pathName</I> <A HREF="#index"><B>index</B></A> <I>item</I></DD><DD><I>pathName</I> <A HREF="#insert"><B>insert</B></A> <I>index</I> <I>item</I> ?<I>option value...</I>?</DD><DD><I>pathName</I> <A HREF="#item"><B>item</B></A> <I>first</I> ?<I>last</I>?</DD><DD><I>pathName</I> <A HREF="#itemcget"><B>itemcget</B></A> <I>item</I> <I>option</I></DD><DD><I>pathName</I> <A HREF="#itemconfigure"><B>itemconfigure</B></A> <I>item</I> ?<I>option</I>? ?<I>value</I> <I>option</I> <I>value</I> ...?</DD><DD><I>pathName</I> <A HREF="#items"><B>items</B></A> ?<I>first</I>? ?<I>last</I>?</DD><DD><I>pathName</I> <A HREF="#move"><B>move</B></A> <I>item</I> <I>index</I></DD><DD><I>pathName</I> <A HREF="#reorder"><B>reorder</B></A> <I>neworder</I></DD><DD><I>pathName</I> <A HREF="#see"><B>see</B></A> <I>item</I></DD><DD><I>pathName</I> <A HREF="#selection"><B>selection</B></A> <I>cmd</I> ?<I>arg...</I>?</DD><DD><I>pathName</I> <A HREF="#xview"><B>xview</B></A> ?<I>arg...</I>?</DD><DD><I>pathName</I> <A HREF="#yview"><B>yview</B></A> ?<I>arg...</I>?</DD></DL><BR><HR WIDTH="100%"><BR><B><A NAME="descr"></A>DESCRIPTION</B><BR><P><B>ListBox</B> widget uses canvas to display a list of items.Each item is composed of a label with its own font and foreground attributes, and an optionalimage or window. Each item is drawn in a single line, whose height is defined by the<B>deltay</B> option, so they must have at most this height.A item is uniquely identified by a string given at creation (by the<B>insert</B> command). The ListBox can have one or more columns, depending on<B>multicolumn</B> option. The user do not handle columns; the number of columnsis determined following the height of the ListBox in order to see each item vertically.</P><BR><HR WIDTH="50%"><BR><B><A NAME="wso">WIDGET-SPECIFIC OPTIONS</A></B><BR><DL><DT><A NAME="-deltax"><B>-deltax</B></A></DT><DD>Specifies horizontal pad between each columns.</DD></DL><DL><DT><A NAME="-deltay"><B>-deltay</B></A></DT><DD>Specifies vertical size of the items.</DD></DL><DL><DT><A NAME="-dragenabled"><B>-dragenabled</B></A></DT><DD>A boolean specifying if drag is enabled.</DD></DL><DL><DT><A NAME="-dragendcmd"><B>-dragendcmd</B></A></DT><DD>Specifies a command to be called when drag ended.<B>dragendcmd</B> must be a command conforming to the description of theoption <B>dragendcmd</B> of <B>DragSite::<A HREF="DragSite.html#register">register</A></B>.</DD></DL><DL><DT><A NAME="-dragevent"><B>-dragevent</B></A></DT><DD>Specifies the number of the mouse button associated to the drag.Must be <B>1</B>, <B>2</B> or <B>3</B>.</DD></DL><DL><DT><A NAME="-draginitcmd"><B>-draginitcmd</B></A></DT><DD>ListBox has a command wrapper for <I>drag-init</I> events. This command refused the dragif no item is designated. In other cases:<BR>If <B>draginitcmd</B> is empty, it returns:<UL><LI>the value of option <B>dragtype</B> or <I>LISTBOX_ITEM</I> if empty as the data type, <LI><I>{move copy link}</I> as the operations, <LI>the item identifier as the data.</UL>If <B>draginitcmd</B> is not empty, it is called with the following arguments:<UL><LI>the pathname of the listbox,<LI>the identifier of the dragged item,<LI>the toplevel created to represent dragged data.</UL>and must return a value conforming to <B>draginitcmd</B> option described in<B>DragSite::<A HREF="DragSite.html#register">register</A></B>.</DD></DL><DL><DT><A NAME="-dragtype"><B>-dragtype</B></A></DT><DD>Specifies an alternate type of dragged object.</DD></DL><DL><DT><A NAME="-dropcmd"><B>-dropcmd</B></A></DT><DD>ListBox has a command wrapper for <I>drop</I> events. This command stops auto scrollingand extract item and position.<BR>If <B>dropcmd</B> is not empty, it is called with the following arguments:<UL><LI>the pathname of the listbox,<LI>the pathname of the drag source,<LI>a list describing where the drop occurs. It can be:<UL><LI><I>{</I><B>widget</B><I>}</I>,<LI><I>{</I><B>item</B> <I>item}</I> or<LI><I>{</I><B>position</B> <I>index}</I>.</UL><LI>the current operation,<LI>the data type,<LI>the data.</UL></DD></DL><DL><DT><A NAME="-dropenabled"><B>-dropenabled</B></A></DT><DD>A boolean specifying if drop is enabled.</DD></DL><DL><DT><A NAME="-dropovercmd"><B>-dropovercmd</B></A></DT><DD>LsitBox has a command wrapper for <I>drag-over</I> events. This command enables auto scrollingand position extraction during the <I>drag-over</I>.If <B>dropovercmd</B> is not empty, the command is called with the following aguments:<UL><LI>the pathname of the listbox,<LI>the pathname of the drag source,<LI>a list describing where the drop can occur, whose elements are:<UL><LI>the string <I>widget</I> if <B>dropovertype</B> option contains <I>w</I>, else empty string.<LI>the targeted item if drag icon points an item and <B>dropovertype</B> option contains<I>i</I>, else empty string.<LI>an index within two items where drag icon points to if <B>dropovertype</B> optioncontains <I>p</I>, else empty string.<LI>optionally, the preferred method if drop can occur both inside an item and between twoitems. The value is <I>position</I> or <I>item</I>.</UL><LI>the current operation,<LI>the data type,<LI>the data.</UL>The command must return a list with two elements:<UL><LI>the drop status, conforming to those described in <B>dropovercmd</B> option of<B>DropSite::<A HREF="DropSite.html#register">register</A></B>,<LI>the choosen method: <I>widget</I>, <I>item</I> or <I>position</I>.</UL></DD></DL><DL><DT><A NAME="-dropovermode"><B>-dropovermode</B></A></DT><DD>Specifies the type of <I>drop-over</I> interaction. Must be a combination of<B>w</B>, which specifies that drop can occurs everywhere on widget,<B>p</B>, which specifies that drop can occurs between two items,and <B>i</B>, which specifies that drop occurs inside items.</DD></DL><DL><DT><A NAME="-droptypes"><B>-droptypes</B></A></DT><DD>Specifies a list of accepted dropped object/operation.See option <B>droptypes</B> of<B>DropSite::<A HREF="DropSite.html#register">register</A></B>.for more infromation.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -