[wxruby-users] Problems with ToolBar Sintaxis

Mario Steele mario at ruby-im.net
Sat Sep 27 07:07:01 EDT 2008


What's going on, is that the Toolbar is not resizing, so you need to either
resize the toolbar yourself, or you need to use Wx::BoxSizer.  Personally,
Wx::BoxSizer is easier to do.

Simply do the following:

box = Wx::BoxSizer.new(Wx::HORIZONTAL)
box.add(@toolBarPrincipal,1,Wx::ALL)
@panel.set_sizer(box)

This will allow the Toolbar to expand to take up as much space as possible,
least you put in another control with the Toolbar itself (Not the Toolbar
Item)

Hope this helps.

On Fri, Sep 26, 2008 at 7:03 PM, Omar Hernandez <lists at ruby-forum.com>wrote:

> First of all, it's my first week learnig ruby and so is for wxruby,also
> this is my first time working with a GUI so please, please, be patient.
>
> I'm having problems with the code for a toolbar, i want to add an item,
> but a don't know how. this is my code for now:
>
>
>  @toolBarPrincipal=ToolBar.new(@panel)
>  @toolBarPrincipal.add_tool(-1, '&Bonzai', Bitmap.new("/home/.......
> icon.ico"))
>
> I've already red the http://wxruby.rubyforge.org/doc/toolbar.html page
> (mi code is basically what comes there.
>
> I want to put it into a panel, named panel. At this point, a litle dot
> is drawn on the top-left corner (under a menu bar) but no icon.
>
> I'd appreciate if you help me. A correction, some code examples or some
> links would be perfect.
>
>
> Thanks!!
>
> Sorry if i'm making a thread that already exists (i searched first)
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> wxruby-users mailing list
> wxruby-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wxruby-users
>



-- 
Mario Steele
http://www.trilake.net
http://www.ruby-im.net
http://rubyforge.org/projects/wxruby/
http://rubyforge.org/projects/wxride/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/wxruby-users/attachments/20080927/72180238/attachment.html>


More information about the wxruby-users mailing list