-
Notifications
You must be signed in to change notification settings - Fork 0
/
hello_world_3.py
58 lines (37 loc) · 1.02 KB
/
hello_world_3.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# -*- coding: utf-8 -*-
import pygtk;
pygtk.require( '2.0' );
import gtk;
def delete_event( widget, data ):
return False;
def destroy( widget, data = None ):
gtk.main_quit();
def the_new_window( widget,data = None ):
new = gtk.Window();
new.set_title( "نافذتنا الجديده" );
msg = gtk.Label( "هذا برنامجي الاول مع PyGTK" );
msg.show();
new.add( msg );
new.show();
# ... #
window = gtk.Window();
# ... #
window.set_title( "مرحباً بالعالم" );
window.connect( 'delete_event', delete_event );
window.connect( 'destroy', destroy );
# ... #
box1 = gtk.HBox();
window.add( box1 );
# ... #
hello_world_button = gtk.Button( "مرحباً بالعالم" );
hello_world_button.connect( 'clicked', the_new_window ); # New line
box1.pack_start( hello_world_button );
hello_world_button.show();
# ... #
hello_world_button_2 = gtk.Button( "الزر الثاني" );
box1.pack_start( hello_world_button_2 );
hello_world_button_2.show();
# ... #
box1.show();
window.show();
gtk.main();