# Wxruby effect like fxshutter

**URL:** <https://www.ruby-forum.com/t/wxruby-effect-like-fxshutter/130044>\
**Category:** wxRuby\
**Created:** [February 24, 2008, 9:13pm UTC](https://www.ruby-forum.com/t/wxruby-effect-like-fxshutter/130044 "2008-02-24T21:13:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gerapcik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/edb3f5/32.png) [@gerapcik](https://www.ruby-forum.com/u/gerapcik)\
**Post date:** [February 24, 2008, 9:13pm UTC](https://www.ruby-forum.com/t/wxruby-effect-like-fxshutter/130044/1 "2008-02-24T21:13:16Z")

</div>

hi,  
i was searching for an efect in wxruby like fxshutter from fxruby.  
[http://www.fxruby.org/doc/examples.html](http://www.fxruby.org/doc/examples.html)

is it possible to build an skeleton like this in wxruby?

i am ruby beginner

---

<div class="post-metadata">

**Author:** ![gerapcik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/edb3f5/32.png) [@gerapcik](https://www.ruby-forum.com/u/gerapcik)\
**Post date:** [February 25, 2008, 12:41am UTC](https://www.ruby-forum.com/t/wxruby-effect-like-fxshutter/130044/2 "2008-02-25T00:41:17Z")

</div>

Hello Gerard,

Currently, there is nothing like that implemented in wxRuby. However,  
it  
shouldn’t be to hard in which to implement it. It would all have to be  
hand  
written, with buttons, and custom drawing. Right now, I don’t have time  
to  
write up an example. Sorry.

L8ers,  
Mario S.

---

<div class="post-metadata">

**Author:** ![gerapcik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/edb3f5/32.png) [@gerapcik](https://www.ruby-forum.com/u/gerapcik)\
**Post date:** [February 25, 2008, 12:40pm UTC](https://www.ruby-forum.com/t/wxruby-effect-like-fxshutter/130044/3 "2008-02-25T12:40:42Z")

</div>

Gerard Rakoczy wrote:

> i was searching for an efect in wxruby like fxshutter from fxruby.  
> [http://www.fxruby.org/doc/examples.html](http://www.fxruby.org/doc/examples.html)  
> The nearest thing is wxToolBook, which allows multiple pages to be  
> controlled (like a notebook), but using icon tools rather than tabs to  
> switch between windows.

Unfortunately this is one of the few new classes in wxWidgets 2.8 that  
isn’t currently ported in wxRuby. You could probably create a similar  
effect by using a ToolBar + using a Sizer to contain the main window,  
and swap and hide/show panels.

alex

---

<div class="post-metadata">

**Author:** ![gerapcik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/edb3f5/32.png) [@gerapcik](https://www.ruby-forum.com/u/gerapcik)\
**Post date:** [March 5, 2008, 10:37am UTC](https://www.ruby-forum.com/t/wxruby-effect-like-fxshutter/130044/4 "2008-03-05T10:37:55Z")

</div>

That’s what i was looking for… thank you Mario, nice example 🙂

---

<div class="post-metadata">

**Author:** ![gerapcik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/edb3f5/32.png) [@gerapcik](https://www.ruby-forum.com/u/gerapcik)\
**Post date:** [March 4, 2008, 10:12pm UTC](https://www.ruby-forum.com/t/wxruby-effect-like-fxshutter/130044/5 "2008-03-04T22:12:37Z")

</div>

Hey guys,

Well, I got some time to put something simple together. Fortunatly  
Alex,  
it’s not a fully attached type of deal, as looking at the original Fox  
example, it’s just like utilizing Wx::Notebook. What I’ve done, is a  
simple  
bit of code, that works similar to how FXShutter works, except for a few  
differences.

One, it’s wxRuby, not Fox, so keep that in mind, but the basics of it,  
are  
these:

shutter.rb  
Creates the class Wx::Shutter  
It has three Methods within it:

Wx::Shutter.new(parent,id)

Creates a New Shutter Object.

Wx::Shutter#add\_header(title)

Creates a New Header Button, which will toggle the associated list of  
items  
with it. Returns the instance of Wx::Button used.

Wx::Shutter#add\_item(header,text,icon=NullBitmap)

Add’s a new item to the Header in question (Using the returned  
Wx::Button).

There is a Custom event created for notifying the programmer of when an  
item  
has been selected within the headings.

ShutterEvent

ShutterEvent#header

Returns the Header Wx::Button associated with it.

ShutterEvent#item

Returns the 0 based index to item selected within the program itself.

Included, is a simple example, that just shows how it works, with events  
executing and such, you should be able to use shutter.rb to do what you  
want, all you need to do, is create each panel, and hide them all, then  
simply show the one your interested in, or associated to the item in the  
list.

Hope this helps you out, it’s not perfect, but has similar ideas as to  
what  
is being used in Fox.

L8ers,
