Hi everyone,
I’m using DialogBlocks as my GUI designer for creating XRC files that I
will use with WxRuby and wx_sugar to create my UI ruby file with. I’ve
gone through several tutorials to understand how Ruby and WX work
together, along with DialogBlocks and am feeling a bit more comfortable
with it all.
But, I have some questions for more seasoned veterans that are using a
similar setup as I am. I am a very organized person so I like to start
with organization in my projects. As I’ve never created a Ruby built
GUI before, let me start with a few areas that I’d like to address and
gather some input from those that respond.
Project Outline:
My first project is going to be porting over some code I created in
another language and adding quite a few revisions to it. My goal is to
create a cross-platform program that can be used on Windows, Linux, and
Mac. The old source program is composed of one file only, and was built
using AutoIt, which utilizes a similar build for GUI elements that WX
uses. For instance, AutoIt starts with a parent frame and WX starts
with a parent frame. I already have the entire look created and so
designing that look in DialogBlocks should be fairly simple.
Project Organizational Structure:
This is my first concern. I’m not sure how I should setup my folder
structures for my project. I could do:
\project
…\lib
…\icons
…\images
…\ui
etc…
… but I’m not sure how I should piece this out so that it’s compatible
with WxRuby. I figured I could put my xrc and rb UI files in \ui. I
could put icons in icons, images in images, and lib could contain the
meat of my rb project files. But, I’m not sure this is the proper way
to go and so I’d like some feedback on how some of the veterans setup
their project workspace and what they do to fit it all together.
DialogBlocks:
I took some notes from some of the wikis I browsed and put together the
following below:
In DBLK, all top-level Frames, Dialogs and Panels become RUBY CLASSES.
The name you type in the class field within DBLK becomes the class name
in your Ruby program. Likewise, for the controls “within†a container,
the DBLK class name becomes the name of a Ruby module in your program
that will be used to extend the control.
From my understanding of this, it’s saying that whatever I type in the
class field within dialogblocks for any frame, dialog, or panel, in my
ruby code, I will use the name as a class. And, likewise, for any
control within a container, the name I use in the class field becomes a
ruby module name in my ruby code.
I have quite a few questions about this. First, with GUI driven ruby
applications does it matter where I place my modules and classes? Can I
place all of them in one file? Or, should I keep the modules and
classes in separate files?
Secondly, is there a list of what is actually classified as a frame,
dialog, panel, or control for dialogblocks? I tend to confuse some of
these elements.
Summary:
Rather than ask a lot more questions at this moment, I’m just trying to
get to a comfort level of just setting up my project, feeling out how I
want to progress, and then get into some further questions. I would
appreciate any responses to the ones I have outlined already and any
links to particular in-depth tutorials, if available.
Thank you.