Re: Multiple Toolbars

Keith Brown <[email protected]> Sat, 19 Nov 2016 10:25:18 -0500
Newsgroups gmane.comp.lang.perl.wxperl
Message-ID <[email protected]>
Oops! I spoke too soon. Works under Linux but not Windows. Back to the 
drawing board I guess.


On 11/16/2016 1:47 PM, Keith Brown wrote:
> Got it. Here's the new code (with a bit of help from wxGlade):
>
>     $this->{toolbar2}
>         = Wx::ToolBar->new( $this, -1, wxDefaultPosition, wxDefaultSize,
>         wxNO_BORDER | wxHORIZONTAL | wxTB_FLAT, $ID_TOOLBAR2 );
>     $this->SetToolBar( $this->{toolbar2} );
>     my $toolbar2 = $this->{toolbar2};
>     $toolbar2->AddTool(
>         $ID_DRAW_SPECTRUM,
>         "draw",
>         Wx::Bitmap->new( $ProgramPath . "spectrum.png", 
> wxBITMAP_TYPE_PNG ),
>         wxNullBitmap,
>         wxITEM_NORMAL,
>         "draw spectrum"
> .
>
> .
>
> .
>
>     $this->{toolbar1}
>         = Wx::ToolBar->new( $this, -1, wxDefaultPosition, wxDefaultSize,
>         wxNO_BORDER | wxHORIZONTAL | wxTB_FLAT, $ID_TOOLBAR1 );
>     $this->SetToolBar( $this->{toolbar1} );
>     my $toolbar1 = $this->{toolbar1};
>     $toolbar1->AddTool( $ID_QUIT, "exit",
>         Wx::Bitmap->new( $ProgramPath . "exit.png", wxBITMAP_TYPE_PNG ),
>         wxNullBitmap, wxITEM_NORMAL, "exit" );
> .
>
> .
>
> .
>
>     $toolbar2->Realize();
>     $toolbar1->Realize();
>
>
>
> On 11/09/2016 04:23 PM, Keith Brown wrote:
>> Hi all. I'm trying to fit too many icons into one toolbar so I'd like 
>> to break it up into two toobars. Here's what I've done:
>>
>> $this->CreateToolBar(wxNO_BORDER|wxHORIZONTAL|wxTB_FLAT, $ID_TOOLBAR1);
>>  my $toolbar1 = $this->GetToolBar();
>>  $toolbar1->AddTool( $ID_QUIT, "exit", 
>> Wx::Bitmap->new($ProgramPath."exit.png", wxBITMAP_TYPE_PNG), 
>> wxNullBitmap, wxITEM_NORMAL, "exit" );
>> .
>>
>> .
>>
>> .
>>
>> $toolbar1->Realize();
>> $this->CreateToolBar(wxNO_BORDER|wxHORIZONTAL|wxTB_FLAT, $ID_TOOLBAR2);
>> my $toolbar2 = $this->GetToolBar();
>> $toolbar2->AddTool( $ID_APPLY_IDENT, "apply trig", 
>> Wx::Bitmap->new($ProgramPath."apptrig.png", wxBITMAP_TYPE_PNG), 
>> wxNullBitmap, wxITEM_NORMAL, "apply trig\nidentities" );
>> .
>>
>> .
>>
>> .
>>
>> $toolbar2->Realize();
>> .
>> .
>> .
>>
>>
>> This results in only one toolbar being displayed with all icons 
>> appearing in it. How might I go about splitting them up into two?
>>