From: Alpha Blue Date: 2010-01-21T05:56:17+09:00 Subject: Re: WxRuby and DialogBlocks Questions Well, I've made some headway and have created a default template that is usable with DialogBlocks, Ruby 1.9.1, and Netbeans 6.8. I'm going to go ahead and attach the template for anyone else that comes after me that may find issues with getting started with WxRuby and DialogBlocks. Requirements for the Template: Ruby 1.9.1 DialogBlocks Netbeans 6.8 Un-rar the template into any directory and open the folder with netbeans. The entire folder structure will appear as this: \GuiTemplate --\frames (for frame initialization) --\icons (for storing icons) --\images (for storing images) --\lib (for source files) ---- main.rb (your main source file) ---- wxhelper.rb (a helper file that loads your rb from xrc source) ---- wxhelper_template.rb (the template I found which you can use for reference) --\nbproject (the netbeans project directory) --\spec (rspec test folder) --\test (normal test folder) --\ui (for your xrc and rb files that contain the GUI elements) ---- gui_base_classes.rb (the rb file that holds all of the xrc information) ---- gui_base_classes.xrc (the xml source from dialogblocks) ---- gui_base_project.pjd (the DialogBlocks project file) ---- main_gui_window.xrc (the first frame xrc file) LICENSE (lic file) Rakefile (contains a lot of rake tasks which I'll show below) README (shows pre-reqs) start (the file you run to start your gui) ============================== After you download and open this up, test it out by going to the GuiTemplate folder and running the command : ruby start A gui window should open. If so, then everything checks out fine. Commands you can run: Type rake --description or D to see the description of all the rake tasks. The default rake task is set for rake project_update which you can perform just by simply typing the command "rake" all by itself. Running rake project_update will automatically rebuild your ui/gui_base_classes.rb file from ui/gui_base_classes.xrc so that as you design in DialogBlocks you can just run the rake task from NB and you can test your app out after running the task. Once you open the project in netbeans you can right-click on the project when you want to start a new project and go to properties. You can rename the project (you'll receive a warning about hidden files and subversion - just ignore this) and you have your new project handy. To start working on it in DialogBlocks graphic designer, browse to YourProject\ui\gui_base_project.pjd and you are up and running. =========================== Hopefully, this will simplify the needs for others that want to design graphical programs with this combination of software. Take care. Attachments: http://www.ruby-forum.com/attachment/4397/GuiTemplate.rar -- Posted via http://www.ruby-forum.com/.