<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0051)http://www.pcdog.com/edu/linux/2005/09/d028190.html -->
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>Linux 使用基本知识:用Tk编写简单的GUI程序</TITLE><!-- Copyright 2007 Pcdog.com. All rights reserved. -->
<META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK
href="Linux 使用基本知识用Tk编写简单的GUI程序.files/pcdog2007page.css" type=text/css
rel=stylesheet>
<META content="MSHTML 6.00.2900.3268" name=GENERATOR></HEAD>
<BODY>
<DIV id=masthead>
<DIV id=globalNav>
<LI><A href="http://www.pcdog.com/diy/" target=_blank>硬件咨询</A> </LI>
<LI><A href="http://www.pcdog.com/edu/pc-accidence/" target=_blank>电脑技巧</A>
</LI>
<LI><A href="http://www.pcdog.com/edu/photo-design/" target=_blank>图像处理</A>
</LI>
<LI><A href="http://www.pcdog.com/edu/web-design/" target=_blank>网页设计</A> </LI>
<LI><A href="http://www.pcdog.com/edu/net-program/" target=_blank>网络开发</A> </LI>
<LI><A href="http://www.pcdog.com/edu/program-develop/" target=_blank>桌面开发</A>
</LI>
<LI><A href="http://www.pcdog.com/edu/database-develop/" target=_blank>数据库开发</A>
</LI>
<LI><A href="http://www.pcdog.com/network/" target=_blank>网络技术</A> </LI></DIV>
<DIV id=breadCrumb>您现在的位置: <A
href="http://www.pcdog.com/">pcdog首页</A> > <A title=操作系统
href="http://www.pcdog.com/edu/os/index.html">操作系统</A> > <A title=Linux
href="http://www.pcdog.com/edu/linux/index.html">Linux</A> >
正文</DIV></DIV><BR><!-- end masthead -->
<DIV id=content>
<H1 id=pageName>Linux 使用基本知识:用Tk编写简单的GUI程序</H1>
<DIV class=feature>
<P>来源: 作者: 2005-09-28 出处:<A href="http://www.pcdog.com/"
target=_blank>pcdog.com</A></P></DIV>
<DIV class=keyword_list>
<SCRIPT type=text/javascript><!--
google_ad_client = "pub-1572879403720716";
google_alternate_color = "F5FAFA";
google_ad_width = 468;
google_ad_height = 15;
google_ad_format = "468x15_0ads_al_s";
google_ad_channel ="3984443469";
google_color_border = "F5FAFA";
google_color_bg = "F5FAFA";
google_color_link = "000000";
google_color_url = "F5FAFA";
google_color_text = "000000";
//--></SCRIPT>
<SCRIPT src="Linux 使用基本知识用Tk编写简单的GUI程序.files/show_ads.js" type=text/javascript>
</SCRIPT>
</DIV>
<DIV class=keyword_list></DIV>
<DIV class=page_list></DIV>
<DIV class=story>
<P>Tk是TCL程序设计语言对GUI的扩展,它简单而又功能强大。例如,可以使用pico来编辑Tk代码文本文件。<BR> <BR> $ pico
try_tk<BR> <BR> 然后键入下面的代码。<BR> <BR> #!/usr/bin/wish <BR> <BR>
<DIV class=ad0>
<DIV id=ad_pcdog_big></DIV></DIV> button .my_button -text "Hello World"
-command exit <BR> <BR> pack
.my_button<BR> <BR> 第一行告诉shell如何运行该文本文件,后面两行是一段简单的Tk代码。首先创建一个名称为“my_button”的按钮,并将其保存在类继承关系的根结点处。该按钮上显示文字“Hello
World”,而且在按下它时执行exit命令。第二行程序用来调整窗口大小使其可以包含按钮。<BR> <BR> 保存该文件,并把文件属性修改为可执行。<BR> <BR> $
chmod a+x try_tk<BR> <BR> 现在,就可以在X Terminal中执行该程序了。<BR> <BR> $ ./try_tk
<BR> <BR>
<P></P>
<P> </P>
<P><BR><FONT color=#0000ff>更多内容请看PCdog.com--</FONT><A
href="http://www.pcdog.com/special/1358/01/index.html" target=_blank><FONT
color=#ff0033>Linux应用技巧</FONT></A><FONT color=#ff0000>专题</FONT><BR><SPAN
id=ad_pcdog_big_code>
<SCRIPT type=text/javascript><!--
google_ad_client = "pub-1572879403720716";
google_ad_width = 336;
google_ad_height = 280;
google_ad_format = "336x280_as";
google_ad_type = "text_image";
google_ad_channel ="2957605308";
google_alternate_ad_url ="http://www.pcdog.com/js/336.htm";
google_color_border = "F5FAFA";
google_color_bg = "F5FAFA";
google_color_link = "1F3A87";
google_color_url = "0000FF";
google_color_text = "000000"
google_language = 'zh-CN';
//--></SCRIPT>
<SCRIPT src="Linux 使用基本知识用Tk编写简单的GUI程序.files/show_ads.js" type=text/javascript>
</SCRIPT>
</SPAN>
<SCRIPT type=text/javascript>
document.getElementById('ad_pcdog_big').innerHTML=document.getElementById('ad_pcdog_big_code').innerHTML;
document.getElementById('ad_pcdog_big_code').innerHTML="";
</SCRIPT>
</P></DIV>
<DIV class=page_list></DIV>
<DIV class=pre_next_art>上一篇:<A title="Linux 使用基本知识:编写简单的python"
href="http://www.pcdog.com/edu/linux/2005/09/d028189.html" target=_blank>Linux
使用基本知识:编写简单的python</A><BR>下一篇:<A title="Linux 使用基本知识:编写简单的perl"
href="http://www.pcdog.com/edu/linux/2005/09/d028191.html" target=_blank>Linux
使用基本知识:编写简单的perl</A><BR></DIV>
<DIV id=picasa_pic></DIV>
<DIV class=pic_area><IFRAME marginWidth=0 marginHeight=0
src="Linux 使用基本知识用Tk编写简单的GUI程序.files/CAN4G5SF.htm" frameBorder=0 width="100%"
scrolling=no height=130></IFRAME></DIV></DIV><!--end content -->
<DIV id=navBar>
<DIV class=sectionHead>相关专题</DIV>
<DIV class=relatedLinks>·<A class=link_topics title=Linux应用技巧
href="http://www.pcdog.com/special/1358/01/" target=_blank>Linux应用技巧</A> <SPAN
class=link_topics_remark>(1123篇文章)</SPAN><BR></DIV>
<DIV id=advert><A href="http://www.pcdog.com/2007hot/picasa/" target=_blank><IMG
height=80 alt=图像处理软件picasa src="Linux 使用基本知识用Tk编写简单的GUI程序.files/mypicasaad.jpg"
width=320 border=0></A><BR>
<DIV id=ggad336></DIV></DIV>
<DIV class=sectionHead>热门排行文章</DIV>
<DIV class=relatedLinks>·<A title=学堂:当前Linux系统运行的各种参数
href="http://www.pcdog.com/edu/linux/23/03/b320943.html"
target=_blank>学堂:当前Linux系统运行的各种参数</A> <SPAN
class=link_hot_reviews>(0次浏览)</SPAN><BR>·<A title=实例说明:Linux系统终端scp命令的用法
href="http://www.pcdog.com/edu/linux/23/03/u320942.html"
target=_blank>实例说明:Linux系统终端scp命令的用</A> <SPAN
class=link_hot_reviews>(0次浏览)</SPAN><BR>·<A title=关于Linux系统下内存泄漏的检查方法
href="http://www.pcdog.com/edu/linux/23/03/d320941.html"
target=_blank>关于Linux系统下内存泄漏的检查方法</A> <SPAN
class=link_hot_reviews>(0次浏览)</SPAN><BR>·<A title=新手学堂:Linux系统下一些简单实用命令
href="http://www.pcdog.com/edu/linux/23/03/a320940.html"
target=_blank>新手学堂:Linux系统下一些简单实用</A> <SPAN
class=link_hot_reviews>(0次浏览)</SPAN><BR>·<A title=人人都可以使用的Linux防火墙
href="http://www.pcdog.com/edu/linux/23/03/s320919.html"
target=_blank>人人都可以使用的Linux防火墙</A> <SPAN
class=link_hot_reviews>(0次浏览)</SPAN><BR>·<A title=Linux主机服务器被入侵后需采取的措施
href="http://www.pcdog.com/edu/linux/23/03/y320918.html"
target=_blank>Linux主机服务器被入侵后需采取的措</A> <SPAN
class=link_hot_reviews>(0次浏览)</SPAN><BR>·<A title="“疯狂的企鹅” 看Linux安全的未来"
href="http://www.pcdog.com/edu/linux/23/03/f320917.html" target=_blank>“疯狂的企鹅”
看Linux安全的未来</A> <SPAN class=link_hot_reviews>(0次浏览)</SPAN><BR>·<A
title=五个顶级Linux安全工具 href="http://www.pcdog.com/edu/linux/23/03/y320916.html"
target=_blank>五个顶级Linux安全工具</A> <SPAN
class=link_hot_reviews>(0次浏览)</SPAN><BR>·<A title=Linux系统开防火墙时自动开启相对应端口
href="http://www.pcdog.com/edu/linux/23/03/y320915.html"
target=_blank>Linux系统开防火墙时自动开启相对应</A> <SPAN
class=link_hot_reviews>(0次浏览)</SPAN><BR>·<A title="学习园地:Linux ext2/ext3文件系统详解"
href="http://www.pcdog.com/edu/linux/23/03/b320902.html"
target=_blank>学习园地:Linux ext2/ext3文件系统</A> <SPAN
class=link_hot_reviews>(0次浏览)</SPAN></DIV>
<DIV class=sectionHead>最新技术文章</DIV>
<DIV class=relatedLinks>·<A title="Linux/unix 下Vsftpd服务器故障排除攻略"
href="http://www.pcdog.com/edu/linux/24/03/y321134.html"
target=_blank>Linux/unix 下Vsftpd服务器故障排除攻略</A> 03-21<BR>·<A
title="Linux操作系统下TCP keepa
没有合适的资源?快使用搜索试试~ 我知道了~
Tk编写简单的GUI程序
共8个文件
htm:3个
js:3个
css:1个
需积分: 12 52 下载量 28 浏览量
2008-12-14
20:11:50
上传
评论
收藏 40KB RAR 举报
温馨提示
Tk是TCL程序设计语言对GUI的扩展,它简单而又功能强大。例如,可以使用pico来编辑Tk代码文本文件
资源推荐
资源详情
资源评论
收起资源包目录
Tk编写简单的GUI程序.rar (8个子文件)
Linux 使用基本知识用Tk编写简单的GUI程序.htm 12KB
Linux 使用基本知识用Tk编写简单的GUI程序.files
clickeye.js 15KB
pcdog2007page.css 6KB
end.js 637B
mypicasaad.jpg 7KB
click.htm 628B
CAN4G5SF.htm 6KB
show_ads.js 52KB
共 8 条
- 1
资源评论
blessme83
- 粉丝: 2
- 资源: 14
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功