A newbie with some question


#1

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