# A newbie with some question

**URL:** <https://www.ruby-forum.com/t/a-newbie-with-some-question/163811>\
**Category:** wxRuby\
**Created:** [March 25, 2009, 3:06am UTC](https://www.ruby-forum.com/t/a-newbie-with-some-question/163811 "2009-03-25T03:06:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hendra\_kusuma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/5f8ce5/32.png) [@hendra\_kusuma](https://www.ruby-forum.com/u/hendra_kusuma)\
**Post date:** [March 25, 2009, 3:06am UTC](https://www.ruby-forum.com/t/a-newbie-with-some-question/163811/1 "2009-03-25T03:06:21Z")

</div>

Hi, I’m new here

I’m planing to use wxruby to create a database program  
with sqlite as backend  
My system is Ubuntu 8.04, ruby 1.8.6 and wxruby-2.0.0  
I choose to use xrc file as GUI definition  
but somehow wxsugar didn’t work with my system  
(xrcise is not a known command)

So I write ruby code to load the xrc file manually (thanks google) and  
it  
works, with some problem though

so here is my question

1. Tab-navigation is not working (I pressed tab and the focus is not  
moving  
to next widget). How do I get this working?

2. I cannot get a menu-item widget to work

> @menu = @finder.call(“menuItem\_quit”)

does not work

Thanks

here is my code :

### 

require ‘rubygems’  
require ‘wx’

class Frame \< Wx::Frame  
def initialize()  
super()  
xml = Wx::XmlResource.get  
xml.flags = 2  
xml.init\_all\_handlers  
xml.load(“siswa.xrc”)  
xml.load\_frame\_subclass(self, parent, “Siswa”)

```
    @finder = lambda do | x |
        int_id = Wx::xrcid(x)
        begin
            Wx::Window.find_window_by_id(int_id, self) ||

```

int\_idvt\_button(button\_save) { save() }  
rescue RuntimeError  
int\_id  
end  
end

```
    @txtNis = @finder.call("textCtrl_nis")
    @txtNama = @finder.call("textCtrl_nama")

    button_quit = @finder.call("button_quit")

     evt_button(button_quit) { quit() }

end

def quit()
    self.close()
end

```

end

Wx::App.run do  
a = Frame.new().show  
end

### 

and this is the xrc file

### 
\<?xml version="1.0" encoding="UTF-8" standalone="yes" ?\> wxDEFAULT\_FRAME\_STYLE|wxTAB\_TRAVERSAL 480,640 Siswa MenuBar \_Operation \_Quit 2 2 10 10 0 1 wxEXPAND 5 2 2 5 5 1 1 5 Nis 1 wxEXPAND 5 0 1 5 Nama 1 wxEXPAND 5 0 1 5 wxVERTICAL 1 wxEXPAND 5 \_Quit 0
