| 導購 | 订阅 | 在线投稿
分享
 
 
 

Perl/TkFAQ-9.Perl/Tk中有哪些类型的组件

2008-05-18 21:55:25  編輯來源:互聯網  简体版  手機版  評論  字體: ||
 
 
  原文:

  9. What widget types are available under perl/Tk?

  The following Tk widget primitives are available under perl/Tk:

  Button

  Canvas

  Checkbutton

  Entry

  Frame

  Label

  Listbox

  Menu

  Menubutton

  Message

  Radiobutton

  Scale

  Scrollbar

  Text

  Toplevel

  The following are Tix widget primitives available under perl/Tk:

  HList

  InputOnly

  There are (a lot of) other [compound|composite|constructs] available too. You can also synthesize new widgets out of these primitives using perl5's object-oriented multiple inheritance features. You can even build entirely new widget primitives from raw C (XS) code then use and re-use that. (Perl 5 is extremely configurable.)

  A good introduction to the primitives and how they may be used in conjunction with each other may be found in the widget demo script. Note that all the widget demos have a "Show Code" button. To help figure out what is happening in the script you may, when the window appears, edit the text and instrument the code with print statements and then simply press "Rerun Demo". Another place to see examples of the primitives (on the web) is at the image supplement to this FAQ at the following URL:

  http://www.perltk.org/contrib/ptkIMG.html

  译文:

  9. Perl/Tk中有哪些类型的组件?

  Perl/Tk中的基本组件包括以下类型:

  l Button

  l Canvas

  l Checkbutton

  l Entry

  l Frame

  l Label

  l Listbox

  l Menu

  l Menubutton

  l Message

  l Radiobutton

  l Scale

  l Scrollbar

  l Text

  l Toplevel

  另外,还有几种复合的组件

  l Hlist

  l InputOnly

  (译者注:初学Tk的朋友要了解以上组件的外观,可以看这里:http://www.perlchina.net/cgi-bin/gforum/gforum.cgi?post=4628#4628)

  同时,还有很多其它的(混合的,复合的或新构建的)。并且,利用Perl5面向对象编程的可遗传性质,你完全可以自己用这些基本的组件构建出新的综合组件。甚至,你还可以使用原始C语言代码构建出全新的组件,然后重复的使用它(Perl5是具有极强的可塑性的)。

  其实,组件的演示脚本(译者注:在命令行中键入widget)就是对这些基本组件的用法、以及它们如何联合使用等问题的很好的介绍说明。请注意,所有的组件演示程序都有一个“Show Code”(显示代码)的按钮。你可以在阅读了它们的原始代码以后,在那个窗口中直接修改,并且只要简单的再点击一下“Rerun Demo”的按钮就可以立刻看到你修改后的效果了。
 
 
 
  原文:   9. What widget types are available under perl/Tk?   The following Tk widget primitives are available under perl/Tk:   Button   Canvas   Checkbutton   Entry   Frame   Label   Listbox   Menu   Menubutton   Message   Radiobutton   Scale   Scrollbar   Text   Toplevel   The following are Tix widget primitives available under perl/Tk:   HList   InputOnly   There are (a lot of) other [compound|composite|constructs] available too. You can also synthesize new widgets out of these primitives using perl5's object-oriented multiple inheritance features. You can even build entirely new widget primitives from raw C (XS) code then use and re-use that. (Perl 5 is extremely configurable.)   A good introduction to the primitives and how they may be used in conjunction with each other may be found in the widget demo script. Note that all the widget demos have a "Show Code" button. To help figure out what is happening in the script you may, when the window appears, edit the text and instrument the code with print statements and then simply press "Rerun Demo". Another place to see examples of the primitives (on the web) is at the image supplement to this FAQ at the following URL:   http://www.perltk.org/contrib/ptkIMG.html   译文:   9. Perl/Tk中有哪些类型的组件?   Perl/Tk中的基本组件包括以下类型:   l Button   l Canvas   l Checkbutton   l Entry   l Frame   l Label   l Listbox   l Menu   l Menubutton   l Message   l Radiobutton   l Scale   l Scrollbar   l Text   l Toplevel   另外,还有几种复合的组件   l Hlist   l InputOnly   (译者注:初学Tk的朋友要了解以上组件的外观,可以看这里:http://www.perlchina.net/cgi-bin/gforum/gforum.cgi?post=4628#4628)   同时,还有很多其它的(混合的,复合的或新构建的)。并且,利用Perl5面向对象编程的可遗传性质,你完全可以自己用这些基本的组件构建出新的综合组件。甚至,你还可以使用原始C语言代码构建出全新的组件,然后重复的使用它(Perl5是具有极强的可塑性的)。   其实,组件的演示脚本(译者注:在命令行中键入widget)就是对这些基本组件的用法、以及它们如何联合使用等问题的很好的介绍说明。请注意,所有的组件演示程序都有一个“Show Code”(显示代码)的按钮。你可以在阅读了它们的原始代码以后,在那个窗口中直接修改,并且只要简单的再点击一下“Rerun Demo”的按钮就可以立刻看到你修改后的效果了。
󰈣󰈤
 
 
>>返回首頁<<
 
 
 
 
 熱帖排行
 
 
王朝网络微信公众号
微信扫码关注本站公众号 wangchaonetcn
 
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味著赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
© 2005- 王朝網路 版權所有