← Back to team overview

gladex team mailing list archive

[Question #82398]: Libglade - Warning (converting to Ruby)

 

New question #82398 on Gladex:
https://answers.launchpad.net/gladex/+question/82398

Hi Folks,

Upon first generating my first (Ruby) code for a GladeXML file using Kubuntu with Ruby 1.8.7, the program runs fine, but when i run the file through Konsole, I get the following error:

BEGIN ERROR MESSAGE:

-desktop:~/Desktop/RUBY STUFF/rubyGUItest$ ruby sitelookupV.rb
sitelookupV.rb: line 18
   libglade-WARNING **:Expected <glade-interface>.  Got <interface>.
sitelookupV.rb: line 18
   libglade-WARNING **:did not finish in PARSER_FINISH state
sitelookupV.rb:18:in `initialize': could not load glade file /home/tandl/Desktop/RUBY STUFF/rubyGUItest/sitelookupV0-1.glade (IOError)
        from sitelookupV.rb:18:in `new'
        from sitelookupV.rb:18:in `initialize'
        from sitelookupV.rb:26:in `new'
        from sitelookupV.rb:26

END ERROR MESSAGE

Do you have any ideas what the problem might be?  I have the first experimental code i'm trying to run here:

BEGIN CODE SNIPPET:
#!/usr/bin/env ruby

require 'pathname'
PROG_DIR = File.dirname(Pathname.new(__FILE__).realpath.to_s)+"/"
$:.push(PROG_DIR)

require 'libglade2'
require 'sitelookupV_callbacks'


class SitelookupVClass
	include GetText

	attr :glade
  
	def initialize(path_or_data, root = nil, domain = nil, localedir = nil, flag = GladeXML::FILE)
		bindtextdomain(domain, localedir, nil, "UTF-8")
		@glade = GladeXML.new(path_or_data, root, domain, localedir, flag) {|handler| method(handler)}
		init_callbacks(@glade)
	end
end

if __FILE__ == $0
	PROG_PATH = PROG_DIR + "sitelookupV0-1.glade"
	PROG_NAME = ""
	SitelookupVClass.new(PROG_PATH, nil, PROG_NAME)
	Gtk.main
end

END CODE SNIPPET

Essentially i'm trying to convert this sample GUI that i've made up into Ruby Code so i can play with it, and hopefully bend it to my will.

I've tried it with libglade2-ruby1.8 as well as (uninstalling libglade2) installing other potential libglade packages, with no avail, getting the same error.  Of course, what i think should happen is the window I designed in Glade should pop up.  It will be useless because it doesn't do anything yet, but I supose that's normal.

Any thoughts?
THANKS FOR YOUR HELP!

-- 
You received this question notification because you are a member of
Gladex Developers, which is an answer contact for Gladex.