[wxruby-users] Problem centering a label

(gmail) Alejandro Michelin Salomon amichelins at gmail.com
Thu Mar 19 16:33:01 EDT 2009


Hi

 

I have frame.

Inside i want to put a static text as title, centered.

I use two sizers, one vertical an other horizontal.

 

But title is not centered, is put to left.

 

My code is :

 

require 'wx';

 

class TarefasNova < Wx::Panel

    def initialize(parent)

        rect = parent.get_client_rect();

 

        super( parent, 1011, Wx::Point.new( 0, 0 ),  rect.get_size(),
SIMPLE_BORDER, "NovaTarefa" );

 

        sizer = Wx::BoxSizer.new(Wx::VERTICAL );

        box   = Wx::BoxSizer.new(Wx::HORIZONTAL);

 

        label = Wx::StaticText.new( self, :label => "CADASTRO DE TAREFAS
(NOVA)", :size => [250,-1] );

 

        box.add( label, 1, Wx::ALIGN_CENTER_VERTICAL, 5);

 

        sizer.add_item(box, 0, Wx::ALIGN_CENTER|Wx::ALL, 5);

     end

end

 

How to make my title centered in the panel?

 

Alejandro Michelin Salomon



  _____  

avast! Antivirus <http://www.avast.com> : Outbound message clean. 


Virus Database (VPS): 090319-0, 19/03/2009
Tested on: 19/03/2009 17:32:59
avast! - copyright (c) 1988-2009 ALWIL Software.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/wxruby-users/attachments/20090319/4b4bc2ce/attachment.html>


More information about the wxruby-users mailing list