Freebsd Porter 手冊

Total Page:16

File Type:pdf, Size:1020Kb

Freebsd Porter 手冊 FreeBSD Porter 手冊 The FreeBSD Documentation Project FreeBSD Porter 手冊 由 修訂: 1b0aa22683 2016-03-29 01:37:53 +0000 由 Kevin Lo. 版權 © 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 The FreeBSD Documentation Project 版權所有 Redistribution and use in source (XML DocBook) and 'compiled' forms (XML, HTML, PDF, PostScript, RTF and so forth) with or without modication, are permitted provided that the following conditions are met: 1. Redistributions of source code (XML DocBook) must retain the above copyright notice, this list of conditions and the following disclaimer as the rst lines of this le unmodied. 2. Redistributions in compiled form (transformed to other DTDs, converted to PDF, PostScript, RTF and other formats) must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 重要 THIS DOCUMENTATION IS PROVIDED BY THE FREEBSD DOCUMENTATION PROJECT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FREEBSD DOCUMENTATION PROJECT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. FreeBSD 是 FreeBSD 基金會的註冊商標。 UNIX 是 The Open Group 在美國和其他國家的註冊商標。 Sun, Sun Microsystems, Java, Java Virtual Machine, JDK, JRE, JSP, JVM, Netra, OpenJDK, Solaris, StarOce, SunOS 和 VirtualBox 是 Sun Microsystems, Inc. 在美國和其他國家的註冊商標。 Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this document, and the FreeBSD Project was aware of the trademark claim, the designations have been followed by the “™” or the “®” symbol. ii 內容目錄 1. 楔子 ...................................................................................................................................... 1 2. 製作新的 Port ......................................................................................................................... 3 3. 打造 Port 快速上手篇 .............................................................................................................. 5 3.1. 編寫 Makefile ........................................................................................................... 5 3.2. 撰寫說明檔 .................................................................................................................. 6 3.3. 產生 checksum 檔 ......................................................................................................... 7 3.4. 測試 Port ..................................................................................................................... 8 3.5. 以 portlint 來作檢查 Port ............................................................................................. 8 3.6. 提交新的 Port .............................................................................................................. 8 4. Slow Porting .......................................................................................................................... 11 4.1. How Things Work ......................................................................................................... 11 4.2. 取得原始碼 ................................................................................................................ 12 4.3. Modifying the Port ....................................................................................................... 12 4.4. Patching ..................................................................................................................... 13 4.5. 設定 .......................................................................................................................... 15 4.6. 處理使用者輸入 .......................................................................................................... 15 5. 設定 Makele ........................................................................................................................ 17 5.1. The Original Source ...................................................................................................... 17 5.2. 命名 .......................................................................................................................... 17 5.3. 分類 .......................................................................................................................... 22 5.4. The Distribution Files .................................................................................................... 27 5.5. MAINTAINER ................................................................................................................ 41 5.6. COMMENT ..................................................................................................................... 42 5.7. PORTSCOUT .................................................................................................................. 42 5.8. 相依性 ....................................................................................................................... 42 5.9. MASTERDIR .................................................................................................................. 48 5.10. Man Pages ................................................................................................................. 49 5.11. Info Files ................................................................................................................... 49 5.12. Makele Options ......................................................................................................... 49 5.13. Specifying the Working Directory ................................................................................... 62 5.14. Conict Handling ........................................................................................................ 62 5.15. Installing Files ............................................................................................................ 63 6. Special Considerations ............................................................................................................. 67 6.1. Staging ...................................................................................................................... 67 6.2. Bundled Libraries ......................................................................................................... 67 6.3. 共用函式庫 ................................................................................................................ 69 6.4. Ports with Distribution Restrictions or Legal Concerns .......................................................... 69 6.5. Building Mechanisms .................................................................................................... 71 6.6. 使用 GNU Autotools ..................................................................................................... 73 6.7. 使用 GNU gettext ....................................................................................................... 74 6.8. 使用 Perl .................................................................................................................... 75 6.9. 使用 X11 .................................................................................................................... 77 6.10. 使用 GNOME ............................................................................................................. 79 6.11. GNOME 元件 ............................................................................................................. 81 6.12. 使用 Qt .................................................................................................................... 84 6.13. 使用 KDE .................................................................................................................. 87 6.14. 使用 Java .................................................................................................................. 88 6.15. 網路應用程式, Apache 和 PHP ..................................................................................... 91 6.16. 使用 Python .............................................................................................................. 94 6.17. 使用 Tcl/Tk ............................................................................................................... 95 6.18. 使用 Emacs ............................................................................................................... 95 6.19. 使用 Ruby ................................................................................................................. 96 6.20. 使用 SDL .................................................................................................................. 96 6.21. 使用 wxWidgets ......................................................................................................... 97 6.22. 使用 Lua ................................................................................................................. 102 6.23. 使用 iconv .............................................................................................................. 103 內容目錄 6.24. 使用 Xfce ...............................................................................................................
Recommended publications
  • Beginning Portable Shell Scripting from Novice to Professional
    Beginning Portable Shell Scripting From Novice to Professional Peter Seebach 10436fmfinal 1 10/23/08 10:40:24 PM Beginning Portable Shell Scripting: From Novice to Professional Copyright © 2008 by Peter Seebach All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN-13 (pbk): 978-1-4302-1043-6 ISBN-10 (pbk): 1-4302-1043-5 ISBN-13 (electronic): 978-1-4302-1044-3 ISBN-10 (electronic): 1-4302-1044-3 Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1 Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. Lead Editor: Frank Pohlmann Technical Reviewer: Gary V. Vaughan Editorial Board: Clay Andres, Steve Anglin, Ewan Buckingham, Tony Campbell, Gary Cornell, Jonathan Gennick, Michelle Lowman, Matthew Moodie, Jeffrey Pepper, Frank Pohlmann, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh Project Manager: Richard Dal Porto Copy Editor: Kim Benbow Associate Production Director: Kari Brooks-Copony Production Editor: Katie Stence Compositor: Linda Weidemann, Wolf Creek Press Proofreader: Dan Shaw Indexer: Broccoli Information Management Cover Designer: Kurt Krames Manufacturing Director: Tom Debolski Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013.
    [Show full text]
  • An Introduction to the X Window System Introduction to X's Anatomy
    An Introduction to the X Window System Robert Lupton This is a limited and partisan introduction to ‘The X Window System’, which is widely but improperly known as X-windows, specifically to version 11 (‘X11’). The intention of the X-project has been to provide ‘tools not rules’, which allows their basic system to appear in a very large number of confusing guises. This document assumes that you are using the configuration that I set up at Peyton Hall † There are helpful manual entries under X and Xserver, as well as for individual utilities such as xterm. You may need to add /usr/princeton/X11/man to your MANPATH to read the X manpages. This is the first draft of this document, so I’d be very grateful for any comments or criticisms. Introduction to X’s Anatomy X consists of three parts: The server The part that knows about the hardware and how to draw lines and write characters. The Clients Such things as terminal emulators, dvi previewers, and clocks and The Window Manager A programme which handles negotiations between the different clients as they fight for screen space, colours, and sunlight. Another fundamental X-concept is that of resources, which is how X describes any- thing that a client might want to specify; common examples would be fonts, colours (both foreground and background), and position on the screen. Keys X can, and usually does, use a number of special keys. You are familiar with the way that <shift>a and <ctrl>a are different from a; in X this sensitivity extends to things like mouse buttons that you might not normally think of as case-sensitive.
    [Show full text]
  • A First Course to Openfoam
    Basic Shell Scripting Slides from Wei Feinstein HPC User Services LSU HPC & LON [email protected] September 2018 Outline • Introduction to Linux Shell • Shell Scripting Basics • Variables/Special Characters • Arithmetic Operations • Arrays • Beyond Basic Shell Scripting – Flow Control – Functions • Advanced Text Processing Commands (grep, sed, awk) Basic Shell Scripting 2 Linux System Architecture Basic Shell Scripting 3 Linux Shell What is a Shell ▪ An application running on top of the kernel and provides a command line interface to the system ▪ Process user’s commands, gather input from user and execute programs ▪ Types of shell with varied features o sh o csh o ksh o bash o tcsh Basic Shell Scripting 4 Shell Comparison Software sh csh ksh bash tcsh Programming language y y y y y Shell variables y y y y y Command alias n y y y y Command history n y y y y Filename autocompletion n y* y* y y Command line editing n n y* y y Job control n y y y y *: not by default http://www.cis.rit.edu/class/simg211/unixintro/Shell.html Basic Shell Scripting 5 What can you do with a shell? ▪ Check the current shell ▪ echo $SHELL ▪ List available shells on the system ▪ cat /etc/shells ▪ Change to another shell ▪ csh ▪ Date ▪ date ▪ wget: get online files ▪ wget https://ftp.gnu.org/gnu/gcc/gcc-7.1.0/gcc-7.1.0.tar.gz ▪ Compile and run applications ▪ gcc hello.c –o hello ▪ ./hello ▪ What we need to learn today? o Automation of an entire script of commands! o Use the shell script to run jobs – Write job scripts Basic Shell Scripting 6 Shell Scripting ▪ Script: a program written for a software environment to automate execution of tasks ▪ A series of shell commands put together in a file ▪ When the script is executed, those commands will be executed one line at a time automatically ▪ Shell script is interpreted, not compiled.
    [Show full text]
  • Translate's Localization Guide
    Translate’s Localization Guide Release 0.9.0 Translate Jun 26, 2020 Contents 1 Localisation Guide 1 2 Glossary 191 3 Language Information 195 i ii CHAPTER 1 Localisation Guide The general aim of this document is not to replace other well written works but to draw them together. So for instance the section on projects contains information that should help you get started and point you to the documents that are often hard to find. The section of translation should provide a general enough overview of common mistakes and pitfalls. We have found the localisation community very fragmented and hope that through this document we can bring people together and unify information that is out there but in many many different places. The one section that we feel is unique is the guide to developers – they make assumptions about localisation without fully understanding the implications, we complain but honestly there is not one place that can help give a developer and overview of what is needed from them, we hope that the developer section goes a long way to solving that issue. 1.1 Purpose The purpose of this document is to provide one reference for localisers. You will find lots of information on localising and packaging on the web but not a single resource that can guide you. Most of the information is also domain specific ie it addresses KDE, Mozilla, etc. We hope that this is more general. This document also goes beyond the technical aspects of localisation which seems to be the domain of other lo- calisation documents.
    [Show full text]
  • Ten Steps to Linux Survival
    Ten Steps to Linux Survival Bash for Windows People Jim Lehmer 2015 Steps List of Figures 5 -1 Introduction 13 Batteries Not Included .............................. 14 Please, Give (Suggestions) Generously ...................... 15 Why? ........................................ 15 Caveat Administrator ............................... 17 Conventions .................................... 17 How to Get There from Here ........................... 19 Acknowledgments ................................. 20 0 Some History 21 Why Does This Matter? .............................. 23 Panic at the Distro ................................. 25 Get Embed With Me ................................ 26 Cygwin ....................................... 26 1 Come Out of Your Shell 29 bash Built-Ins .................................... 30 Everything You Know is (Almost) Wrong ..................... 32 You’re a Product of Your Environment (Variables) . 35 Who Am I? .................................. 36 Paths (a Part of Any Balanced Shrubbery) .................... 37 Open Your Shell and Interact ........................... 38 Getting Lazy .................................... 39 2 File Under ”Directories” 43 Looking at Files .................................. 44 A Brief Detour Around Parameters ........................ 46 More Poking at Files ............................... 47 Sorting Things Out ................................ 51 Rearranging Deck Chairs ............................. 55 Making Files Disappear .............................. 56 2 touch Me .....................................
    [Show full text]
  • Automating Admin Tasks Using Shell Scripts and Cron Vijay Kumar Adhikari
    AutomatingAutomating adminadmin taskstasks usingusing shellshell scriptsscripts andand croncron VijayVijay KumarKumar AdhikariAdhikari vijayvijay@@kcmkcm..eduedu..npnp HowHow dodo wewe go?go? IntroductionIntroduction toto shellshell scriptsscripts ExampleExample scriptsscripts IntroduceIntroduce conceptsconcepts atat wewe encounterencounter themthem inin examplesexamples IntroductionIntroduction toto croncron tooltool ExamplesExamples ShellShell The “Shell” is a program which provides a basic human-OS interface. Two main ‘flavors’ of Shells: – sh, or bourne shell. It’s derivatives include ksh (korn shell) and now, the most widely used, bash (bourne again shell). – csh or C-shell. Widely used form is the very popular tcsh. – We will be talking about bash today. shsh scriptscript syntaxsyntax The first line of a sh script must (should?) start as follows: #!/bin/sh (shebang, http://en.wikipedia.org/wiki/Shebang ) Simple unix commands and other structures follow. Any unquoted # is treated as the beginning of a comment until end-of-line Environment variables are $EXPANDED “Back-tick” subshells are executed and `expanded` HelloHello WorldWorld scriptscript #!/bin/bash #Prints “Hello World” and exists echo “Hello World” echo “$USER, your current directory is $PWD” echo `ls` exit #Clean way to exit a shell script ---------------------------------------- To run i. sh hello.sh ii. chmod +x hello.sh ./hello.sh VariablesVariables MESSAGE="Hello World“ #no $ SHORT_MESSAGE=hi NUMBER=1 PI=3.142 OTHER_PI="3.142“ MIXED=123abc new_var=$PI echo $OTHER_PI # $ precedes when using the var Notice that there is no space before and after the ‘=‘. VariablesVariables contcont…… #!/bin/bash echo "What is your name?" read USER_NAME # Input from user echo "Hello $USER_NAME" echo "I will create you a file called ${USER_NAME}_file" touch "${USER_NAME}_file" -------------------------------------- Exercise: Write a script that upon invocation shows the time and date and lists all logged-in users.
    [Show full text]
  • Java 11 Single-File Applications
    Java 11 Single-File Applications Replacing bash with a syntax I actually know Steve Corwin Corwin Technology LLC Why use Java instead of shell script? Frustration. # ...working shell script... VALUES=($RESULTS) V500S=${VALUES[0]} V504S=${VALUES[1]} COUNT500S=$(echo "${V500S//[$'\t\r\n ']}") COUNT504S=$(echo "${V504S//[$'\t\r\n ']}") echo "\"$SERVER\", \"$COUNT500S\", \"$COUNT504S\"" Basics of single-file applications JEP 330: https://openjdk.java.net/jeps/330 • Java 11 • Java app where everything is within a single file, including public static void main(String[] args) { • invoke using java or shebang Begin with HelloWorld (where else?) public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, world! I am a plain .java file!"); } } $ /home/scorwin/apps/java/jdk- 11.0.1/bin/java HelloWorld.java • standard main() method • my default is Java 8 Shebang HelloWorldShebang: #!/home/scorwin/apps/java/jdk-11.0.1/bin/java -- source 11 public class HelloWorldShebang { public static void main(String[] args) { System.out.println("Hello, world! I have a shebang but no file extension."); } } $ ./HelloWorldShebang • shebang must include --source option • file must be marked executable • Eclipse doesn’t recognize as Java code Shebang with .java HelloWorldShebang.java: //#!/home/scorwin/apps/java/jdk-11.0.1/bin/java -- source 11 public class HelloWorldShebang { public static void main(String[] args) { System.out.println("Hello, world! I have a shebang and a file extension."); } } • with the shebang line commented out:
    [Show full text]
  • Tour of the Terminal: Using Unix Or Mac OS X Command-Line
    Tour of the Terminal: Using Unix or Mac OS X Command-Line hostabc.princeton.edu% date Mon May 5 09:30:00 EDT 2014 hostabc.princeton.edu% who | wc –l 12 hostabc.princeton.edu% Dawn Koffman Office of Population Research Princeton University May 2014 Tour of the Terminal: Using Unix or Mac OS X Command Line • Introduction • Files • Directories • Commands • Shell Programs • Stream Editor: sed 2 Introduction • Operating Systems • Command-Line Interface • Shell • Unix Philosophy • Command Execution Cycle • Command History 3 Command-Line Interface user operating system computer (human ) (software) (hardware) command- programs kernel line (text (manages interface editors, computing compilers, resources: commands - memory for working - hard-drive cpu with file - time) memory system, point-and- hard-drive many other click (gui) utilites) interface 4 Comparison command-line interface point-and-click interface - may have steeper learning curve, - may be more intuitive, BUT provides constructs that can BUT can also be much more make many tasks very easy human-manual-labor intensive - scales up very well when - often does not scale up well when have lots of: have lots of: data data programs programs tasks to accomplish tasks to accomplish 5 Shell Command-line interface provided by Unix and Mac OS X is called a shell a shell: - prompts user for commands - interprets user commands - passes them onto the rest of the operating system which is hidden from the user How do you access a shell ? - if you have an account on a machine running Unix or Linux , just log in. A default shell will be running. - if you are using a Mac, run the Terminal app.
    [Show full text]
  • NRPE: Unable to Read Output
    NRPE - NRPE: Unable To Read Output Article Number: 620 | Rating: 3.3/5 from 7 votes | Last Updated: Mon, Jul 17, 2017 at 12:35 AM Pr o ble m De s c r ipt io n This KB article addresses the following NRPE error: NRPE: Unable To Read Output As s ume d Kno wle dge The following KB article contains an explanation of how NRPE works and may need to be referenced to completely understand the problem and solution that is provided here: NRPE - Agent and Plugin Explained Tr o uble s ho o t ing The Er r o r This error implies that NRPE did not return any character output. Common causes are incorrect plugin paths in the nrpe.cfg file or that the remote host does not have NRPE installed. There are also cases where the wrong interpreter is invoked when running the remote plugin. Rarely, it is caused by trying to run a plugin that requires root privileges. Inc orre c t Plugin Pat hs Log onto the remote host as root and check the plugin paths in /usr/local/nagios/etc/nrpe.cfg. Try to browse to the plugin folder and make sure the plugins are listed. Sometimes when installing from a package repo, the commands in nrpe.cfg will have a path to a distribution specific location. If the nagios-plugins package was installed from source or moved over from another remote host, they me be located in a different directory. The default location for the nagios-plugins can be found at /usr/local/nagios/libexec/.
    [Show full text]
  • X 윈도 시스템 (X Window System)
    GNU/Linux X 윈도 시스템 (X Window System) Seo, Doo-Ok Clickseo.com [email protected] 목차 X 윈도 시스템 자유-오픈소스SW 패키지 2 운영체제 (1/5) 컴퓨터 소프트웨어 구성 시스템 소프트웨어와 응용 소프트웨어 Software System Software Application Software 운영체제 범용 소프트웨어 시스템 운영 프로그램 특정 목적 소프트웨어 시스템 지원 프로그램 시스템 개발 프로그램 3 운영체제 (2/5) 운영체제(OS, Operating System) 자원 관리(resource management) • 프로세스 관리 • 메모리 관리 (Memory management) “시스템 성능의 최적화” – 가상 메모리(Virtual memory) •장치관리: 디바이스 드라이버(Device drivers) •파일관리: 디스크 접근 및 파일 시스템 • 네트워크 및 보안 4 운영체제 (3/5) 운영체제 : 인터페이스 “사용자 편리성의 최적화” 사용자 인터페이스(User Interface) • 컴퓨터 하드웨어와 사용자(프로그램 또는 사람)간 인터페이스 제공 • CLI (Command Line Interface) • GUI (Graphical User Interface) [ CLI, Bash (Bourne-Again Sell) - UNIX Shell ] [ GUI, X11 and KDE ] 5 운영체제 (4/5) X 윈도 데스크톱 환경 : GNOME [ 출처 : GNOME, gnome.org ] 6 운영체제 (5/5) X 윈도 데스크톱 환경 : KDE [ 출처 : “KDE Plasma 5”, KDE, WIKIPEDIA. ] 7 X 윈도 시스템 X 윈도 시스템 디스플레이 서버 클라이언트 라이브러리 X 윈도 매니저 X 윈도 데스크톱 환경 자유-오픈소스SW 패키지 8 X 윈도 시스템 (1/2) X Window System : X11, X 주로 유닉스 계열 운영체제에서 사용되는 윈도 시스템 • 네트워크 프로토콜(X 프로토콜)에 기반한 그래픽 사용자 인터페이스 – GUI 환경의 구현을 위한 기본적인 프레임워크를 제공 • 1984년, 아데나 프로젝트(Athena Project)의 일환으로 시작 – 플랫폼 독립적으로 작동하는 그래픽 시스템 개발을 위해 DEC, IBM, MIT가 공동으로 진행 • 1986년, X10.4 공개 • 1987년, X11 발표 X 컨소시엄(X Consortium) • X11 버전 개정 : X11R2, X11R6 버전 발표 • 1996년 12월, X11R6.3 버전을 끝으로 X 컨소시엄 해체 일반적인 POSIX 시스템 : /etc/X11 • 현재, GNU/Linux를 비롯한 유닉스의 대부분이 X 윈도 시스템을 사용 9 X 윈도 시스템 (2/2) 클라이언트-서버 모델(Client-Server model) X 윈도 시스템은 사용자 컴퓨터에서 서버가 실행되는 반면 클라이언트는 원격 시스템에서 실행될 수 있다.
    [Show full text]
  • Teleporting in an X Window System Environment
    Teleporting in an X Window System Environment Tristan Richardson,∗ Frazer Bennett,∗ Glenford Mapp,∗ and Andy Hopper∗† ∗ Olivetti Research Laboratory y University of Cambridge Old Addenbrooke's Site Computer Laboratory 24a Trumpington Street Pembroke Street Cambridge Cambridge CB2 1QA CB2 3QG United Kingdom United Kingdom November 1993 Abstract Teleporting is the ability to redirect a windowing environment to different computer displays. This paper describes the implementation of a teleporting system developed at Olivetti Research Laboratory (ORL). We outline two particular features of the system that make it powerful. First, it operates with existing applications, which will run without any modification. Second, it incorporates sophisticated techniques of personnel and equipment location which make it simple to use. Teleporting may represent a development in attempts to achieve a ubiquitous, personalised computing environment for all. 1 Introduction In the near future, communication networks will make it possible to access computing services from almost anywhere in the world. In addition, the number of computers readily available within an office is increasing. We would like to allow individuals to make use of such networked computing facilities as they move from place to place, whilst retaining the familiarity of their own computing environment. A windowing environment offers a coherent means of interacting with a computer via a screen, keyboard and mouse. Typically, a user would run any number of applications within such a windowing environment. Traditionally, these applications have been bound to one display, offering output at and accepting input from only one fixed point within the building (i.e. the display on which they were started).
    [Show full text]
  • Learning Perl Tk.Pdf
    Learning Perl/Tk Nancy Walsh Beijing • Cambridge • Farnham • Köln • Paris • Sebastopol • Taipei • Tokyo Learning Perl/Tk by Nancy Walsh Copyright (c) 1999 O'Reilly & Associates, Inc. All rights reserved. Printed in the United States of America. Published by O'Reilly & Associates, Inc., 101 Morris Street, Sebastopol, CA 95472. Editor:Linda Mui Editorial and Production Services: TIPS-Technical Publishing, Inc. Production Editor: Ellie Fountain Maden Printing History: January 1999: First Edition. March 1999: Minor corrections. Nutshell Handbook, the Nutshell Handbook logo, and the O'Reilly logo are registered trademarks of O'Reilly & Associates. The use of an emu image in association with Perl/ Tk is a trademark of O'Reilly & Associates, Inc. Permission may be granted for non- commercial use; please inquire by sending mail to [email protected]. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O'Reilly & Associates, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book, the publisher assumes no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein. This book is printed on acid-free paper with 85% recycled content, 15% post-consumer waste. O'Reilly & Associates is committed to using paper with the highest recycled content available consistent with high quality. ISBN: 1-56592-314-6:[5/99] Table of Contents Preface xi 1. Introduction to Perl/Tk 1 A Bit of History About Perl (and Tk) 1 Perl/Tk for Both Unix and Windows 95/NT 2 Why Use a Graphical Interface? 2 Why Use Perl/Tk? 3 Installing the Tk Module 5 Creating Widgets 6 Coding Style 8 Displaying a Widget 9 The Anatomy of an Event Loop 9 Hello World Example 10 Using exit Versus Using destroy 12 Naming Conventions for Widget Types 12 Using print for Diagnostic/Debugging Purposes 13 Designing Your Windows (A Short Lecture) 14 2.
    [Show full text]