⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 example-1.pl

📁 Developing with Gnome一书examples例子代码
💻 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 + -