[fxruby-users] FXDataTarget issue Fox 1.2.6

John Reed colotechpro at yahoo.com
Wed Apr 20 00:09:39 EDT 2005

FXRuby question to mailing list 4-19-05


I upgraded from Fox 1.0 to Fox 1.2, and the problem I’m having is getting my radio buttons to work with the new FXDataTarget. 


I just installed the new 1.2.6 FXRuby gem. Here are the details of my system:


OS: XP Professional

ruby 1.8.2 (2004-12-25) [i386-mswin32]


*** LOCAL GEMS ***


fxruby (1.2.6, 1.2.2)

    FXRuby is the Ruby binding to the FOX GUI toolkit.



My application will correctly save and retrieve the radio button data from my database, MySQL, but once the initialize routine runs, the button is set to –1, no choice. When the display comes up, I can see the radio button is set to the correct value from the database, and then it slowly goes blank.


I’ve looked at the upgrade and API documentation. Conceptually, I understand why this happens but I can’t figure out what I need to do. Here are some code snippets:


def initialize




sexDataTarget = FXDataTarget.new(-1)

@sxmrdb = FXRadioButton.new(sexgrp, "Male", sexDataTarget, FXDataTarget::ID_OPTION, ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP)

@sxfrdb = FXRadioButton.new(sexgrp, "Female", sexDataTarget, FXDataTarget::ID_OPTION+1, ICON_BEFORE_TEXT|LAYOUT_SIDE_TOP)




def dbtofields



if @male == "X"

      @sxmrdb.checkState = true



if @female == "X"

      @sxfrdb.checkState = true



The code to call the routines






Thanks for your help,


John Reed


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20050419/95206fd8/attachment.htm

More information about the fxruby-users mailing list