Tuesday, March 30, 2010

FXRuby 'FRAME' type examples

I created a good working UI using foxGUIb 1.0.0 for an app that I've wanted to create for a while now.  The problem I have with the source code generated is that it's hard to customise.  When something doesn't look quite right, I'm competing with several layers for clarity and what I see in the generated source code doesn't match what I see built with the tool.

I gave up trying to make it work for me and decided to just start from scratch with plain FXRuby.  I'm using the foxGUIb layout as my 'spec' or template to build the app using simpler code.  The problem now, of course, is that I don't know FXRuby and am learning it as I go.  Google is my friend, coupled with the many examples available from the FXRuby docs.

While working with FXGroupBox, I was trying to figure out what the different frameStyle types did. e.g. FRAME_GROOVE, FRAME_LINE,  FRAME_RAISED, FRAME_RIDGE,  FRAME_SUNKEN, FRAME_THICK, and FRAME_NORMAL

Google turned up this example from the "FXRuby: Create Lean and Mean GUIs with Ruby" book.  I love online examples! =)

Can you find the error in the code?

1 comment:

  1. Whoops! I swapped the "raised thick frame" and "sunken thick frame" windows, didn't I? Oh well.

    Paul, also note that there's a free sample chapter of the book at the Pragmatic Programmer's site, plus a different free chapter here. And if you want to buy the book, well, that's even better. ;)

    ReplyDelete