How to create a searchable list in FXRuby?

I’m trying to make a searchable list in FXRuby. The list needs to have a search bar where you can search for items, and a new window needs to open if you click a specific item. Here’s the code so far:

def initialize(app, title, w, h)
	super(app, title, :width => w, :height => h)
	data = (0..9).to_a.repeated_permutation(3).map{|x,y,z| "#{x}#{y}#{z}"}
	hframe = FXVerticalFrame.new(self, :opts => LAYOUT_FILL)
	boxes = FXList.new(hframe,
		:opts => LIST_NORMAL|LIST_EXTENDEDSELECT)
	a = 0
	while a < 1000
		count = DB["coord#{data[a]}"].count
		boxes.appendItem("Box #{a}, coordinates #{data[a]}, items: #{count}")
		a += 1
	end
	bin = FXLabel.new(hframe, "Unassigned items")
end
def create
	super
	show (PLACEMENT_SCREEN)
end

Any suggestions? Thanks :slight_smile:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs