[ruby-gnome2-doc-cvs] [Hiki] create - GladeXML

Back to archive index

ruby-****@sourc***** ruby-****@sourc*****
2004年 4月 28日 (水) 14:45:57 JST


-------------------------
REMOTE_ADDR = 128.88.255.106
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp//?GladeXML
-------------------------
= class GladeXML
GladeXML allows dynamic loading of user interfaces from XML descriptions.

== Object Hierarchy
* Object
  * GLib::Instantiatable
    * GLib::Object
      * GladeXML

== Class Methods
--- GladeXML.new(file_or_buffer, root = nil, domain = nil, source = GladeXML::FILE) {|handler| ... }
    Creates a new GladeXML object (and the corresponding widgets) from the Glade XML file or a String of the XML.  
    Optionally it will only build the interface from the widget node root (if it is not nil).  
    This feature is useful if you only want to build say a toolbar or menu from the Glade XML file, but not the window it is embedded in.  
    Note also that the XML parse tree is cached to speed up creating another GladeXML object for the same file

    The additional block is connected to all signal handlers.
    It recieves the signal handler name as the only argument.
    A common block is 

    {|handler| method(handler)} 

    which calls the method with the same name as the signal handler.
    * file_or_buffer: a file name If source is GladeXML::FILE, a String of Glade XML if source is GladeXML::BUFFER.
    * root: the widget node in fname to start building from.
    * domain: the translation domain for the XML file.
    * source: GladeXML::FILE or GladeXML::BUFFER
    * Returns: a GladeXML instance

--- GladeXML.require(library)
    Ensure that a required library is available. 
    If it is not already available, libglade will attempt to dynamically load a module that contains the handlers for that library.
    * library: the required library.
    * Returns: self

--- GladeXML.provide(library)
    This method should be called by a module to assert that it provides wrappers for a particular library.  
    This should be called by the register_widgets() function of a libglade module so that it isn't loaded twice, for instance.
    * library: the provided library.
    * Returns: self

--- GladeXML.set_custom_widget_handler(setting)
    Turns the custom widget handler on or off. This is internal use only.
    * setting: true or false
    * Returns: self

== Instance Methods
--- get_widget(name)
    This method is used to get a reference to the Gtk::Widget corresponding to name in the interface description. 
    You would use this if you have to do anything to the widget after loading.
    * name: the widget's name(String) in the glade tree.
    * Returns: a reference(Gtk::Widget) to name or nil if name does not exist
--- [name]
    This is the same as get_widget(name).
    * name: the widget's name(String) in the glade tree.
    * Returns: a reference(Gtk::Widget) to name or nil if name does not exist

--- filename
    Gets the name of the original Glade XML file.
    * Returns: the name of the glade file
    * Returns: self

--- connect(source, target, signal_name, handler_name, signal_data, after = false)
    Connect a handler method to a signal in the Glade XML file with the given signal handler name.
    * source: the object(GLib::Instantiatable) to connect the signal to.
    * target: the object(GLib::Instantiatable) which the handler method is defined. 
    * signal_name: the name of the signal.
    * handler_name: the name of the handler method to connect.  
    * signal_data: the string value of the signal data given in the XML file.  
    * after: true if the connection should be made with GLib::Instantiatable#signal_connect_after, otherwise with GLib::Instantiatable#signal_connect.  
    * Returns: self

--- custom_creation_methods
    Gets an Array of the custom creation methods in the GladeXML object.
    * Returns: custom creation methods.(Array of Strings)

--- widget_names
    Gets an Array of the widget names in the GladeXML object.
    * Returns: widget names.

== Constants
--- BUFFER
    Buffer mode to create a new GladeXML. This is used with GladeXML.new.
--- FILE
    File mode to create a new GladeXML. This is used with GladeXML.new.


* 2004-04-28 Change pageid. Some modified. ((<Masao>))
* 2004-04-27 Revised some methods. ((<Masao>))
* 2004-04-24 Initial release. ((<jawebada>))






ruby-gnome2-cvs メーリングリストの案内
Back to archive index