There are too many interesting and beautiful small programs in Ubuntu. I really want to know how the talented programmers do it, so I want to learn how to develop the linux interface program. The campus network is terrible when accessing foreign websites. Fortunately, the students used Netcom to access the Internet. They first went to some tutorials and materials and tried to compile a helloworld applet. As expected, errors are inevitable! By using the dir (gtk) lookup function and adding a bit of speculation, I changed the example and finally understood the examples.
There are too many interesting and beautiful small programs in Ubuntu. I really want to know how the talented programmers do it, so I want to learn how to develop the linux interface program.
The campus network was terrible when accessing foreign websites. Fortunately, the students used Netcom to access the Internet. They first went to some tutorials and materials and tried to compile a hello world applet. As expected, errors are inevitable! After using the dir (gtk) lookup function and a bit of speculation, I changed the example. Finally, I realized that those examples were from the old gtk version, currently, the function names in version 2.0 have changed many times.
Gtkhello. py
From gtk import * # importing all the widgets from gtk
Window = Window (WINDOW_TOPLEVEL) # create a top level window
Window. connect ("destroy", main_quit) # quit the event loop on destruction
Window. set_border_width (10) # set padding round child widget
Button = Button ("Hello World") # A button with the "Hello World" label
Window. add (button) # add button to window
Window. show_all () # Show the window with his widgets
Main () # enter the main event loop