Professional Documents
Culture Documents
Gnome Asia Training 2014
Gnome Asia Training 2014
Summary
TM
Summary
Overview
TM
Summary
Platform libraries
TM
Summary
Development tools
TM
Summary
Before we start
TM
Summary
Hello world!
Import GObject-Introspection
Show a window
Run the GTK+ main loop
The application must be killed externally!
TM
Summary
# ! / u s r / b i n / python3
from g i . r e p o s i t o r y import Gtk
window = Gtk . Window ( )
window . s h o w _ a l l ( )
Gtk . main ( )
TM
Summary
TM
Summary
# Continued from p r e v i o u s s l i d e .
app = PythonApp ( )
e x i t _ s t a t u s = app . run ( None )
sys . e x i t ( e x i t _ s t a t u s )
TM
Summary
TM
# Continued from p r e v i o u s s l i d e .
app = PythonApp ( )
e x i t _ s t a t u s = app . run ( None )
sys . e x i t ( e x i t _ s t a t u s )
Summary
Application menus
TM
# Continued from p r e v i o u s s l i d e .
def o n _ a c t i v a t e ( s e l f , app ) :
s e l f . window . s h o w _ a l l ( )
def o n _ h e l l o _ w o r l d ( s e l f , a c t i o n =None , param=None ) :
print ( " Hello world ! " )
def o n _ q u i t ( s e l f , a c t i o n =None , param=None ) :
self . quit ()
app = PythonApp ( )
e x i t _ s t a t u s = app . run ( None )
sys . e x i t ( e x i t _ s t a t u s )
Summary
TM
Summary
TM
Summary
TM
[ Desktop ]
Name=My Python App
Comment= S h o r t d e s c r i p t i o n o f t h i s a p p l i c a t i o n
Keywords=python ; e d i t o r ;
Type= A p p l i c a t i o n
Exec=pythongnomeapp
I c o n =pythongnomeapp
C a t e g o r i e s =Gtk ;GNOME; U t i l i t y ;
dist_bin_SCRIPTS = pythongnomeapp
desktopdir = $( datadir ) / applications
dist_desktop_DATA = pythongnomeapp . desktop
Summary
TM
Summary
Translations
TM
Summary
User help
TM
Summary
Further resources
TM
Settings management
TM
New widgets
TM