Hi,

You probably want GetLabel rather than GetText.
GetText returns string + control characters, which isn't necessarily what you expect. (e.g. it will include platform and version specific escaping in addition to any control chars you explicitly included.)
GetLabel returns string without control chars.

NOTE: The above methods are for Wx::MenuItem. For Wx::Menu, the GetLabel method has the opposite meaning.

Regards

Mark

On 17/05/2010 05:28, Gabor Szabo wrote:
On Mon, May 17, 2010 at 12:01 AM, Gabor Szabo<szab...@gmail.com>  wrote:
On Sun, May 16, 2010 at 11:26 PM, Johan Vromans<jvrom...@squirrel.nl>  wrote:
Gabor Szabo<szab...@gmail.com>  writes:

In the menus of Padre sometime we show names of files including underscores.
Anyway, if I call the GetText method on the menu object it return blog__0014.pod

I just added an underscore to a menu text in one of my programs and it
shows exactly with one underscore.

Am I misunderstanding the problem?

In the menu it shows correctly but if you call  $item->GetText on the freshly
created menu object it returns it with 2 underscores.

At least in our code.



The same happens in
http://svn.perlide.org/padre/trunk/Padre/share/examples/wx/30_editor.pl
which is a very simple text editor if I add

        my $e = $edit->Append( 997,       "A_B" );
        print $e->GetText, "\n";

after line 90   $edit->Append( 998,       "&Setup" );


Gabor

Reply via email to