GUI Using Python – PyGTK And Glade

2y ago
106 Views
9 Downloads
1.96 MB
60 Pages
Last View : 13d ago
Last Download : 2m ago
Upload by : Kaydence Vann
Transcription

Pycon India 2009,IIScGUI Using Python – PyGTK and GladeA. Jai Sathish il.com

thonPyQt

No StandardGUI Tool available

There aresome factorsthat decidesthe GUI tool

Money

ORLinux UserWindows User

Linux and Windows User

A GNOME User

A KDE User

WhatisPyGTK ?

YPyGTK

Easy to create your own GUI

PyGTK is Free Open Source Software

PyGTK supports Multiplatform Applications

WhatisGTK ?

GTK (GIMP ToolKit)

Libraryfor creatingGraphical User Interfaces

PyGTKProgrammingBasics

ImportrequiredLibraries

Create a Window

PackWidgets into it

SetAppropriate SignalstoWidgets

Connect SignalstoCallback Functions

Uses main loopto startGTK eventprocessing loop

Putting it all togetherimport pygtkpygtk.require('2.0')import gtkclass WelcomeMsg:def init (self):window gtk.Window()window.set title("Welcome")window.set border width(10)window.set size request(200,100)window.connect("destroy", self.quit)#import libraries#create a windowvbox gtk.VBox()window.add(vbox)button gtk.Button("Press Me come To Pycon India2009,IISc")vbox.pack start(button,True,True,0)#pack widgets

button uit)vbox.pack start(button,True,True,5)#connect signals to callbackwindow.show all()def printMessage(self,widget,data):print data#callback functiondef quit(self,widget):gtk.main quit()#callback functiondef main(self):gtk.main()if name " main ":p WelcomeMsg()p.main()#main loop

Run in the terminalpython filename.py

END of PyGTK

WELCOMEToGLADE

GLADE

WhatisGlade ?

AUserInterfaceDesigner

GLADE

RapidApplicationDevelopmentTool

Used in ManyProgramming Languages

UserInterfacesare storedinXML format

GLADEGUIDesigning

A Drag&DropInterface

Design starts by addingi. Top Levelsii. Containersiii. Controls and Displays

Top Levels

Containers

ControlsandDisplays

Set the glade filedef init (self):self.gladefile "glade file name"self.wTree gtk.glade.XML(self.gladefile)

Create a dictionaryand Connect itdic {"on mainWindow destroy" : gtk.main quit,}self.wTree.signal autoconnect(dic)

Resources

http://wiki.python.org/moin/GuiProgramming

http://www.pygtk.org/

http://glade.gnome.org/

Mailing list IRC Forums

We thankandfor pictures

Pycon India 2009,IISc GUI Using Python –

Related Documents:

PyGTK GUI library and Python programming language in general. About this tutorial . for rapid prototyping. Currently, PyGTK is one of the most popular bindings for the GTK library. . most of the GUI software in the open source world is created in Qt or in GTK . The GTK is an object ori

Python 2 versus Python 3 - the great debate Installing Python Setting up the Python interpreter About virtualenv Your first virtual environment Your friend, the console How you can run a Python program Running Python scripts Running the Python interactive shell Running Python as a service Running Python as a GUI application How is Python code .

Python Programming for the Absolute Beginner Second Edition. CONTENTS CHAPTER 1 GETTING STARTED: THE GAME OVER PROGRAM 1 Examining the Game Over Program 2 Introducing Python 3 Python Is Easy to Use 3 Python Is Powerful 3 Python Is Object Oriented 4 Python Is a "Glue" Language 4 Python Runs Everywhere 4 Python Has a Strong Community 4 Python Is Free and Open Source 5 Setting Up Python on .

Python is readable 5 Python is complete—"batteries included" 6 Python is cross-platform 6 Python is free 6 1.3 What Python doesn't do as well 7 Python is not the fastest language 7 Python doesn't have the most libraries 8 Python doesn't check variable types at compile time 8 1.4 Why learn Python 3? 8 1.5 Summary 9

programming in Python, using Tkinter . There are several GUI interfaces available in Python: Tkinter is the Python interface to the Tk GUI toolkit. wxPython is an open-source Python interface for wxWindows. JPython is a Python port for Java which gives Python scripts access

site "Python 2.x is legacy, Python 3.x is the present and future of the language". In addition, "Python 3 eliminates many quirks that can unnecessarily trip up beginning programmers". However, note that Python 2 is currently still rather widely used. Python 2 and 3 are about 90% similar. Hence if you learn Python 3, you will likely

There are currently two versions of Python in use; Python 2 and Python 3. Python 3 is not backward compatible with Python 2. A lot of the imported modules were only available in Python 2 for quite some time, leading to a slow adoption of Python 3. However, this not really an issue anymore. Support for Python 2 will end in 2020.

1 Certificate Specification NFQ Level 5 Business Administration 5M2468 1. Certificate Details Title Business Administration Teideal as Gaeilge Riarachán Gnó Award Type Major Code 5M2468 Level 5 Credit Value 120 Purpose The purpose of this award is to enable the learner to acquire the knowledge, skills and competence to work independently and under