Re: accessible wxruby

  • From: "Stephen S. Disbrow" <info@xxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Wed, 18 Aug 2010 16:15:35 -0500

   Hi,
   This worked thanks.

Steve D.

----- Original Message ----- From: "Jamal Mazrui" <empower@xxxxxxxxx>
To: <ProgrammingBlind@xxxxxxxxxxxxx>
Cc: <JAWSScripts@xxxxxxxxxxxxx>
Sent: Wednesday, August 18, 2010 9:56 AM
Subject: RE: accessible wxruby


Apparently, there is a JAWS bug that causes a weird lockup when the console version of the Ruby interpreter is run, ruby.exe. This does not happen, for example, with NVDA. Try running the GUI-only version of the interpreter, rubyw.exe. For example,

Rubyw.exe test.rb

Or if the .rbw extension is associated with ruby.exe, try just entering

Test.rbw

If anyone has ideas on how to resolve this JAWS problem, e.g., via a scripting change, please let us know. I am copying this to the JAWS scripting list in case anyone there has suggestions as well.

Jamal



-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Stephen S. Disbrow
Sent: Tuesday, August 17, 2010 11:38 PM
To: programmingblind@xxxxxxxxxxxxx
Subject: accessible wxruby

Hi,
If wxruby is accessible why might this program not talk?I'm using JFW 11.

require "rubygems"
require "wx"

class MyFrame < Wx::Frame

  def initialize
    super(nil,                             #Parent
          :title => "RadioBox Example",    #Displays on top of window
          :pos => [150, 25],               #or Wx::DEFAULT_POSITION
          :size => [300, 200]              #or Wx::DEFAULT_SIZE

#For the position and size arguments, you don't need to specify Point and Size #objects anymore. See: wxRuby Overview on the doc page wxruby_intro.html
    )

    panel = Wx::Panel.new(self)    #Parent = self = this Frame

drink_choices = ["coffee", "tea", "juice", "milk"] #labels for radio buttons

    radios = Wx::RadioBox.new(
        panel,                        #Parent
:label => "Drinks", #Label for box surrounding radio buttons
        :pos => [20, 5],
        :size => Wx::DEFAULT_SIZE,
        :choices => drink_choices,    #The labels for the radio buttons
:major_dimension => 1, #Max number of columns(see next line)--try changing it to 2 :style => Wx::RA_SPECIFY_COLS #:major_dimension value applies to columns

#The :major_dimension and :style in combination determine the layout of the #RadioBox. In this case, the maximum number of columns is 1, which means #there can only be one radio button per line. Because there are 4 radio buttons,
        #that means there will be 4 lines, with one radio button per line.

    )

    evt_radiobox(radios.get_id()) {|cmd_event| on_change_radio(cmd_event)}

#When there is an event of type evt_radiobox on the widget with the id radios.get_id(), #the block is called and an "event object" is passed to the block. The block calls #the method on_change_radio(), defined below, relaying the event object to the #method. The event object contains useful information about the radio button
    #that was selected.


    @text_widget = Wx::StaticText.new(
        panel,                  #Parent
        :label => "coffee",
        :pos => [150, 25],
        :size => Wx::DEFAULT_SIZE

        #Store a widget in an instance variable when other
        #methods, like the one below, need access to it.
    )


    show     #equivalent to self.show, makes the frame visible
  end


  def on_change_radio(cmd_event)
    selected_drink = cmd_event.string  #Selected radio's label

#Instead of calling cmd_event.get_string() or cmd_event.set_string(), you can #now call an accessor method with the same name as the property you are trying
    #to get or set. See: wxRuby Overview on the doc page wxruby_intro.html

    @text_widget.label = selected_drink
  end

end


class MinimalApp < Wx::App
  def on_init
    MyFrame.new
  end
end

MinimalApp.new.main_loop    #main_loop() tells wxruby to start reacting
#to radio button selections, button clicks, etc.
                            #on your App.

Steve D.


__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind




__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: