develooper Front page | perl.wxperl.users | Postings from August 2008

Re: Wx::StyledTextCtrl MarkeDefine

Thread Previous | Thread Next
From:
Mattia Barbon
Date:
August 2, 2008 23:03
Subject:
Re: Wx::StyledTextCtrl MarkeDefine
Message ID:
48954A00.2090109@libero.it
Gabor Szabo wrote:
> On Fri, Aug 1, 2008 at 12:34 PM, Mattia Barbon <mattia.barbon@libero.it> wrote:
>> Gabor Szabo wrote:
>>
>>  Hi,
>>
>>> I am probably too tired but I don't understand what can be the problem:
>>>
>>> $page is a Wx::StyledTextCtrl object
>>>
>>> this line works:
>>>
>>>    $page->MarkerAdd($line_number-1, 0);
>>>
>>> though I don't see any visible change on the margin.
>>>
>>> This line
>>>    $page->MarkerDefine(0, wxSTC_MARK_ARROW, "#000000", "#FFFFFF");
>>>
>>> give me
>>> "the invocant must be a reference at lib/Padre/Frame.pm line 659."
>>> exception.
>>>
>>> Wx version 0.84
>>> wxWidgets 2.8.7
>>> Perl 5.8.8
>>> Ubuntu 8.04
>>>
>>> So what's the problem?
>>  There are two problems; one is that the error message should not mention
>> the invocant, but the parameter that gave the error;
> 
> As far as I can tell this is not something I can change.

   Correct.

>> the other
>> is that you should pass wxColor instances for foreground/background.
> 
> This page http://www.yellowbrain.com/stc/markers.html#def
> indicates that I should be able to use either a wxColour object,
> a #RRGGBB string, or a color spec like "white".
> 
> Of course that documentation might not be the best source for the
> perl binding. Is there a better one I could use ?

http://www.lpthe.jussieu.fr/~zeitlin/wxWindows/docs/wxwin_wxstyledtextctrl.html#wxstyledtextctrl
http://docs.wxwidgets.org/trunk/classwx_styled_text_ctrl.html

   This is the documentation for trunk (2.9.0-to-be) but the interface
for wxStyledTextCtrl wrapped by wxPerl has not changed since 2.8.

> If this is the best documentation then I can either try to get the docs fixed
> to indicate the difference in the Perl version or maybe the code can be
> patched to automatically generate a Wx::Colour object if either a an RGB
> value or a color spec like "white" is called.

   This could be done (like it is done for wxPoint/wxSize), but it would
require a check for potential ambiguity with overload resolution in
other parts of the library.

Regards,
Mattia


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About