Re: $notebook->append_page doesn't return page number :-(



On Fri, 2005-04-08 at 15:21, Dawid Zamirski wrote:
Hello

According to the Gtk documentation, the return value of
$notebook->append_page(...); should be an integer that represents the
index of the page that just has been appended (
http://gtk2-perl.sourceforge.net/doc/pod/Gtk2/Notebook.html#integer_notebook_app
). Now I have in my code something like this:

sub onButtonNew_clicked
{
        my $page = $notebook->append_page($gtkwidget1, $gtkwidget2)
        printf($page);
}

.. and I get an error that the argument of printf has undefined
value.. Can someone please explain the proper syntax? Thank You


the behavior of those functions were changed in gtk+ (c) version 2.4.
starting with Gtk2 (perl) version 1.080 that change was bound and faked
out for older versions of gtk+. the docs on the website are for version
1.080 of the Gtk2 bindings and thus show the integer return type, but if
you have an older version that facility will not be supported.

have a look here for the related changes:
http://cvs.sourceforge.net/viewcvs.py/gtk2-perl/gtk2-perl-xs/Gtk2/xs/GtkNotebook.xs?rev=1.14&view=log

i'm going to add some pod doc on this subject to the affected functions.
to avoid future confusion.

-- 
-rm
http://www.neces.com/




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