Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

RFC for Tutorials: Using BoxSizer Layout Manager in wxPerl

by waxhead (Acolyte)
on Apr 19, 2009 at 06:30 UTC ( #758548=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    package SizerExampleFrame;
    
    ...
                        [600, 400],
                    );
    
  2. or download this
    my $vbox = Wx::BoxSizer->new( wxVERTICAL );
    
  3. or download this
        my $pnl1 = Wx::Panel->new($self, -1);
        my $pnl2 = Wx::Panel->new($self, -1);
        my $pnl3 = Wx::Panel->new($self, -1);
        my $pnl4 = Wx::Panel->new($self, -1);
    
  4. or download this
    my $lbl1 = Wx::StaticText->new(    $pnl1,        # parent
                    -1,        # id,
                    "Testing: 1",    # label
                    [5,10],        # position
                );
    
  5. or download this
    my $lbl2 = Wx::StaticText->new(    $pnl2,        # parent
                    -1,        # id,
    ...
                    [5,10],        # position
                );
    
  6. or download this
        # now we want to create a vbox for the 4th panel
        # in this we will put button and other panels
        
        my $pnl4Vbox = Wx::BoxSizer->new( wxVERTICAL );
    
  7. or download this
    my $btnBox = Wx::BoxSizer->new( wxHORIZONTAL );
    my $pnlBtns = Wx::Panel->new( $pnl4,         #parent
    ...
                    0 # border style
                    );
    
  8. or download this
    my $btnButton1 = Wx::Button->new( $pnlBtns, -1, 'Button 1');
    EVT_BUTTON( $pnlBtns, $btnButton1, \&btnButton1Clicked );
    ...
    my $btnButton2 = Wx::Button->new( $pnlBtns, -1, 'Button 2');
    EVT_BUTTON( $pnlBtns, $btnButton2, \&btnButton2Clicked );
    
  9. or download this
        $btnBox->Add( $btnButton1, 1, wxALIGN_BOTTOM, 0 );
        $btnBox->Add( $btnButton2, 1, wxALIGN_BOTTOM, 0 );
    
  10. or download this
        $pnlBtns->SetSizer($btnBox);
    
  11. or download this
        $pnl4->SetSizer($pnl4Vbox);
    
  12. or download this
        $vbox->Add( $pnl1, 1, wxEXPAND | wxALL, 3);
        $vbox->Add( $pnl2, 1, wxEXPAND | wxALL, 3);
        $vbox->Add( $pnl3, 1, wxEXPAND | wxALL, 3);
        $vbox->Add( $pnl4, 1, wxEXPAND | wxALL, 3);
    
  13. or download this
        $self->SetSizer( $vbox );
    
    ...
        
    }
    
  14. or download this
    sub btnButton1Clicked {
            my( $self, $event ) = @_;
    ...
        my( $self, $event ) = @_;
        print "Button 2\n";
    }
    
  15. or download this
    
    
    ...
    
    
    1;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://758548]
Approved by ikegami
Front-paged by Tanktalus
help
Chatterbox?
[Corion]: Meh. I think I have now the parts down that I want from a simple Javascript frontend for single-page- applications with a aPerl backend. But it seems that all Javascript templating modules either don't support two-way binding (which would be nice) or ...
[Corion]: ... don't support server-side precompilation (which means the client has to compile all templates to Javascript themselves), or are giant frameworks that expect to do everything (which is not what I want)
[Corion]: I feel that there is a talk somewhere in there, either about the structure and parts, or how I used several parts to get a complete whole.
[Corion]: Maybe I can still find something that is compatible with handlebars.js (which has JS precompilation) but allows for two-way data binding (which is great for the UI)

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2017-03-30 07:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (355 votes). Check out past polls.