📄 example-1.pl
字号:
#!/usr/bin/perl -w# This program displays a simple window and has a simple callback for# when the OK button is clicked.use Glib qw(TRUE FALSE);use Gtk2 '-init'; # The '-init' means Gtk2->init gets called initiallyuse Gtk2::GladeXML;# Just to be pedantic...use strict;use vars qw($main_window);sub ok_button_clicked{ my (undef, undef) = @_; # widget, data are unused print "Thanks for trying out my program.\n"; Gtk2->main_quit;}# No predefined helper functions exist--all must be manually declared.sub gtk_main_quit{ Gtk2->main_quit; return TRUE;} # Init is automatically called #Gtk2->init; # load the interface $main_window = Gtk2::GladeXML->new('example-1.glade'); # connect the signals in the interface; since we didn't declare what # package we were in, perl defaults to 'main'... $main_window->signal_autoconnect_from_package('main'); # start the event loop Gtk2->main;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -