Perl 列表框

Perl 列表框,第1张

概述use Tk; my $mw = new MainWindow;$lb = $mw->Listbox(-selectmode => "single")->pack( ); $lb->insert('end', qw/red yellow green blue grey/);##绑定到左键<Button-1>$lb->bind('<Button-1>', sub { $lb->config
use Tk; my $mw = new MainWindow;$lb = $mw->ListBox(-selectmode => "single")->pack( ); $lb->insert('end',qw/red yellow green blue grey/);##绑定到左键<button-1>$lb->bind('<button-1>',sub { $lb->configure(-background => $lb->get($lb->curselection( )) ); }); MainLoop列表框参数:-background => colorSets the color of the area behind the text.设置列表框的背景颜色-borderwIDth => amountSets the wIDth of the edges of the Widget. Default is 2.设置列表框的边框宽度-cursor => cursornameSets the cursor to display when the mouse is over the ListBox.改变鼠标放在列表框上时鼠标的形状-exportselection => 0 | 1Determines if the current ListBox selection is made available for the X selection as well. If set to 1,prevents two ListBoxes from having selections at the same time.设置选择构造,如果设置为了,防止两个ListBox同时被选择-Font => FontnameSets the Font of any text displayed within the ListBox.设置文字字型-foreground => colorSets the color of nonselected text displayed in the ListBox.设置文字的颜色-height => amountSets the height of the ListBox.设置列表框的高度-highlightbackground => colorSets the color the highlight rectangle should be when the ListBox does not have the keyboard focus.当列表框不是键盘输入焦点时,设定其颜色-highlightcolor => colorSets the color the highlight rectangle should be when the ListBox does have the keyboard focus.当列表框为键盘输入焦点时,设定其颜色-highlightthickness => amountSets the thickness of the highlight rectangle. Default is 2.设定焦点的宽度,默认值为2-relIEf => 'flat'|'groove'|'raised'|'rIDge'|'sunken'|'solID'Sets the relIEf of the edges of the ListBox.设定输入列表框3D效果-selectbackground => colorSets the color behind any selected text.设定被选择文字背景颜色-selectborderwIDth => amountSets the wIDth of the border around any selected text.设定选取的外框的宽度-selectforeground => colorSets the color of the text in any selected items. 17设定被选择文字的颜色-selectmode => "single" | "browse" | "multiple" | "extended"Affects how many items can be selected at once; also affects some key/mouse bindings for the ListBox (such as Shift-select).设定选择模式-setgrID => 0 | 1Turns gridding off or on for the ListBox. Default is 0.是否开启按网格倍数缩放窗口-takefocus => 0 | 1 | undefDetermines whether the Widget can have keyboard focus. 0 means never,1 means always,undef means dynamic decision.庙宇是否让该列表框成为键盘输入焦点-wIDth => amountSets the wIDth of the ListBox in characters. If amount is 0 or less,the ListBox is made as wIDe as the longest item.设定列表框的宽度-xscrollcommand => callbackAssigns a horizontal Scrollbar to Widget.如果将插字游标左右移动或者调整来加视窗的大小所呼叫的程序-yscrollcommand => callbackAssigns a vertical Scrollbar to Widget.如果将插字游标上下移动或者调整来加视窗的大小所呼叫的程序
总结

以上是内存溢出为你收集整理的Perl 列表框全部内容,希望文章能够帮你解决Perl 列表框所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1274314.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-08
下一篇 2022-06-08

发表评论

登录后才能评论

评论列表(0条)

保存