|
|
|
|
 关于 Gtk2::TextView ? - knoppix [ 2004-10-05 17:52 | 46 byte(s)]
 Re: 关于 Gtk2::TextView ? - Viperii [ 2004-10-05 19:02 | 637 byte(s)]
 Re: 关于 Gtk2::TextView ? - knoppix [ 2004-10-06 23:45 | 95 byte(s)]
 TextView 的 WrapMode 应该怎样设置呢? - knoppix [ 2004-10-06 16:41 | 288 byte(s)]
 Re: TextView 的 WrapMode 应该怎样设置呢? - Viperii [ 2004-10-06 18:45 | 39 byte(s)]
 Re: TextView 的 WrapMode 应该怎样设置呢? - knoppix [ 2004-10-06 23:00 | 72 byte(s)]
|
|
|
|
[Original]
[Print]
[Top]
|
谁有使用 Gtk2::TextView 的例子代码?
|
|
|
----
Welcome to the world of choices and performance.
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
#!/usr/bin/perl -w
use strict;
use Glib ':constants';
use Gtk2 -init;
my $window = Gtk2::Window->new;
my $scroll = Gtk2::ScrolledWindow->new;
my $textview = Gtk2::TextView->new;
my $vbox = Gtk2::VBox->new;
$window->add ($vbox);
$vbox->add ($scroll);
$scroll->add ($textview);
$window->show_all;
$window->signal_connect (destroy => sub {Gtk2->main_quit});
Gtk2->main;
|
|
|
----
Where is the RED pill? I want OUT!
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
TextView 的 WrapMode 应该怎样设置呢?
我曾看到这样的写法:
$self->set_wrap_mode('word');
以及这样的写法:
$textview->set_wrap_mode($opts->{wrap_mode} || 'word');
WrapMode 究竟可以设哪些值呢?
|
|
|
----
Welcome to the world of choices and performance.
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
谢谢,我试了一下,设为"word"很好用,中文能自动分行。
|
|
|
----
Welcome to the world of choices and performance.
|
|
[Original]
[Print]
[Top]
|
|
[Original]
[Print]
[Top]
|
呵呵,apt-get install libgtk2-perl-doc 后,全是例子,包括详细的 TextView 例子,嘿嘿。
|
|
|
----
Welcome to the world of choices and performance.
|
|
[Original]
[Print]
[Top]
|
|
|