re: get_tab_label

yes thats very usefull indeed, but it still saves the last text file
i have a notebook with multiple opened windows with the following

so when i have 3 tabs open and i want to save the 1st gives me
the right filename but still save the text in the last file to the 1st

heres a snip of my code:

 my ($widget,$file_selection, $name)= @_;

        my $entry_text = $text->get_chars();
        open (FILE, ">$name");
        print FILE "$entry_text\n";
        close FILE;


I use the following to iterate over all the pages in a notebook
looking for one with a particular name:

my @children = $notebook->children;
foreach my $child (@children) {
    if ($notebook->get_tab_label($child->child)->get eq $name) {

So you could use that to get every name. I don't remember if the
children array is page order or not though.

If you want to get the label of an ordered page number:

my @children = $notebook->children;
foreach my $child (@children) {
    if ($notebook->page_num($child->child) == $number) {
        $name = $notebook->get_tab_label($child->child)->get;

Hope this is useful.

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