Re: Gnome2::HRef question.



On Sunday, June 29, 2003, at 07:29 AM, Christian Hamar wrote:

I have a problem. I created a href element with Gnome2::HRef


I want to change the url and the text on it. with this :

$href->set_text($act_fid, $act_fid);

(where act_fid is an url like this:
http://www.something.org/index.php?id=bla...)

Now when i start the program then i got this error message:

Usage: Gnome2::HRef::set_text(href, text) at common/common.gtk.pl line 91.

hm. I'M not usin' good the set_text ??? what is the problem ?

when i want to use set_label then say that '=' isn't good for this entity or
what :)


according to http://developer.gnome.org/doc/API/2.0/libgnomeui/gnomehref.html the operation should be as simple as

   $href->set_url ($new_url);
   $href->set_text ($new_text);

or

   $href->set (url => $new_url,
               text => $new_text);

(just tried those with

$h = Gnome2::HRef->new ('h', 't');
$h->set (url => 'http://sourceforge.net/export/rss2_projnews.php?group_id=64773',
         text => 'gtk2-perl rss feed');

and it worked fine.)

you called set_text with too many parameters. note the fact that you called set_text as a method with two parameters (that's the same as a function with three parameters, since the object is an implicit first parameter), and the usage message showed you how to call it as a function (with two parameters). the Usage: messages for most of the functions in the bindings are automatically generated by xsubpp, which shows you the function syntax, rather than the method syntax. that's basic perl syntax, not me, so sorry if it's confusing.

set_label is deprecated, and if it's in the bindings, then it's a bug. it has been replaced by set_text.




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