File tree 1 file changed +35
-0
lines changed
1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+
2
+ # Import all files from
3
+ # tkinter and overwrite
4
+ # all the tkinter files
5
+ # by tkinter.ttk
6
+ from tkinter import *
7
+ from tkinter .ttk import *
8
+
9
+ # creates tkinter window or root window
10
+ root = Tk ()
11
+ root .geometry ('500x500' )
12
+
13
+ # function to be called when button-2 of mouse is pressed
14
+ def pressed2 (event ):
15
+ print ('Button-2 pressed at x = % d, y = % d' % (event .x , event .y ))
16
+
17
+ # function to be called when button-3 of mouse is pressed
18
+ def pressed3 (event ):
19
+ print ('Button-3 pressed at x = % d, y = % d' % (event .x , event .y ))
20
+
21
+ ## function to be called when button-1 is double clocked
22
+ def double_click (event ):
23
+ print ('Double clicked at x = % d, y = % d' % (event .x , event .y ))
24
+
25
+ frame1 = Frame (root , height = 500 , width = 500 )
26
+
27
+ # these lines are binding mouse
28
+ # buttons with the Frame widget
29
+ frame1 .bind ('<Button-2>' , pressed2 )
30
+ frame1 .bind ('<Button-3>' , pressed3 )
31
+ frame1 .bind ('<Double 1>' , double_click )
32
+
33
+ frame1 .pack ()
34
+
35
+ mainloop ()
You can’t perform that action at this time.
0 commit comments