[Glade-users] how i click and open a file into textview?

On Sun, Oct 24, 2004 at 10:40:57PM -0700, Aaron Yang wrote:

  after i insert a textview widget inside a window,
does anyone know what i should do to display the
contents of any file inside the widget?

  thanks in advance.

yes, sure.

imagine you have a button to show a help message.

sub on_conf_help_button_clicked {
    my ($class, $data, $object, $instance, $event) = @_;
    my $form = $__PACKAGE__::all_forms->{$instance};
$::HELP_LABEL="Aide sur la configuration";

$::HELP_TEXT="Ces valeurs sont enregistrees dans un fichier qui est lu au demarr
programme. Les modifications sont donc effectives au demarrage

my $help = help_window->new;
} # End of sub on_conf_help_button_clicked

and in the programmeUI.pm, you place

    # Construct a GtkWindow 'help_window'

# Construct a GtkLabel 'help_label'
$widgets->{'help_label'} = new Gtk::Label($::HELP_LABEL);


# Construct a GtkText 'help_text'
$widgets->{'help_text'}->insert(undef, $widgets->{'help_text'}->style->text('normal'), undef, $::HELP_TEXT);

at the good place.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]