#include <xml.h>
|
virtual | ~Xml () |
|
GladeXML * | gobj () |
| Provides access to the underlying C GObject.
|
|
const GladeXML * | gobj () const |
| Provides access to the underlying C GObject.
|
|
GladeXML * | gobj_copy () |
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
|
|
std::string | get_filename () const |
|
Gtk::Widget * | get_widget (const Glib::ustring &name) |
| Get a widget from the Glade file.
|
|
template<class T_Widget > |
T_Widget * | get_widget (const Glib::ustring &name, T_Widget *&widget) |
| More convenient way of getting a widget from the Glade file.
|
|
template<class T_Widget > |
T_Widget * | get_widget_derived (const Glib::ustring &name, T_Widget *&widget) |
| This provides a pointer to a widget whose details are specified in the Glade file, but which is implemented by your own derived class.
|
|
Glib::ListHandle< Gtk::Widget * > | get_widget_prefix (const Glib::ustring &name) |
|
void | reparent_widget (const Glib::ustring &name, Gtk::Container &container) |
| Take the widget from the glade-generated container and put it in another container.
|
|
std::string | relative_file (const std::string &filename) const |
|
void | connect_clicked (const Glib::ustring &name, const sigc::slot< void > &slot_) |
| Connect a Gtk::Button's clicked signal or a Gtk::MenuItem's activated signal to a slot.
|
|
|
static Glib::RefPtr< Xml > | create (const std::string &filename, const Glib::ustring &root=Glib::ustring(), const Glib::ustring &domain=Glib::ustring()) |
| Loads a Glade XML file.
|
|
static Glib::RefPtr< Xml > | create_from_buffer (const char *buffer, int size, const Glib::ustring &root=Glib::ustring(), const Glib::ustring &domain=Glib::ustring()) |
| Reads glade XML data from memory.
|
|
static Glib::ustring | get_widget_name (Gtk::Widget &widget) |
|
static Glib::RefPtr< Xml > | get_widget_tree (Gtk::Widget &widget) |
|
|
| Xml (const std::string &filename, const Glib::ustring &root, const Glib::ustring &domain) |
| Loads a glade XML file.
|
|
| Xml (const char *buffer, int size, const Glib::ustring &root, const Glib::ustring &domain) |
| Reads glade XML data from memory.
|
|
Gtk::Widget * | get_widget_checked (const Glib::ustring &name, GType type) |
|
GtkWidget * | get_cwidget (const Glib::ustring &name) |
|
virtual GType | lookup_type_vfunc (const Glib::ustring &classname) |
|
|
(Note that these are not member symbols.)
|
Glib::RefPtr< Gnome::Glade::Xml > | wrap (GladeXML *object, bool take_copy=false) |
| A Glib::wrap() method for this object.
|
|
◆ Error
◆ ~Xml()
virtual Gnome::Glade::Xml::~Xml |
( |
| ) |
|
|
virtual |
◆ Xml() [1/2]
Gnome::Glade::Xml::Xml |
( |
const std::string & | filename, |
|
|
const Glib::ustring & | root, |
|
|
const Glib::ustring & | domain ) |
|
protected |
Loads a glade XML file.
- Exceptions
-
◆ Xml() [2/2]
Gnome::Glade::Xml::Xml |
( |
const char * | buffer, |
|
|
int | size, |
|
|
const Glib::ustring & | root, |
|
|
const Glib::ustring & | domain ) |
|
protected |
Reads glade XML data from memory.
- Exceptions
-
◆ connect_clicked()
void Gnome::Glade::Xml::connect_clicked |
( |
const Glib::ustring & | name, |
|
|
const sigc::slot< void > & | slot_ ) |
Connect a Gtk::Button's clicked signal or a Gtk::MenuItem's activated signal to a slot.
For instance:
refXml->connect_button("button", sigc::mem_fun(*this, &ExampleWindow::on_button_clicked) );
- Parameters
-
name | The name of the widget. |
pslot | The slot to connect to. |
◆ create()
static Glib::RefPtr< Xml > Gnome::Glade::Xml::create |
( |
const std::string & | filename, |
|
|
const Glib::ustring & | root = Glib::ustring(), |
|
|
const Glib::ustring & | domain = Glib::ustring() ) |
|
static |
Loads a Glade XML file.
This will instantiate the widgets in the XML file. You can use the root parameter to only instantiate a certain widget and its children. The returned Xml object keeps pointers to the instantiated widgets which you can retrieve with get_widget().
Note that the Xml object does not delete the widgets it instantiates, but instead leaves the responsibility to you. See get_widget(). This means that you can safely let the Xml object go out of scope after you have retrieved the pointers you need from it.
- Exceptions
-
◆ create_from_buffer()
static Glib::RefPtr< Xml > Gnome::Glade::Xml::create_from_buffer |
( |
const char * | buffer, |
|
|
int | size, |
|
|
const Glib::ustring & | root = Glib::ustring(), |
|
|
const Glib::ustring & | domain = Glib::ustring() ) |
|
static |
Reads glade XML data from memory.
- Exceptions
-
- See also
- create()
◆ get_cwidget()
GtkWidget * Gnome::Glade::Xml::get_cwidget |
( |
const Glib::ustring & | name | ) |
|
|
protected |
◆ get_filename()
std::string Gnome::Glade::Xml::get_filename |
( |
| ) |
const |
◆ get_widget() [1/2]
Gtk::Widget * Gnome::Glade::Xml::get_widget |
( |
const Glib::ustring & | name | ) |
|
Get a widget from the Glade file.
For instance:
Gtk::Table* pTable = dynamic_cast<Gtk::Table*>(refXml->get_widget("mytable"));
Note that you are responsible for deleting top-level widgets (windows and dialogs). Other widgets are instantiated as managed so they will be deleted automatically if you add them to a container.
- Parameters
-
name | The name of the widget. |
- Returns
- A pointer to the widget, or
0
on failure.
◆ get_widget() [2/2]
template<class T_Widget >
T_Widget * Gnome::Glade::Xml::get_widget |
( |
const Glib::ustring & | name, |
|
|
T_Widget *& | widget ) |
|
inline |
More convenient way of getting a widget from the Glade file.
It allows for a shorter syntax with less repetition. For instance:
Gtk::Table* pTable = 0;
refXml->get_widget("mytable", pTable);
This method prints a warning message to the console if the widget doesn't exist or has the wrong type, so you don't need to check that manually.
Note that you are responsible for deleting top-level widgets (windows and dialogs) instantiated by the Xml object. Other widgets are instantiated as managed so they will be deleted automatically if you add them to a container widget.
- Parameters
-
name | The name of the widget. |
- Return values
-
widget | A pointer to the widget, or 0 on failure. |
- Returns
- The value of widget.
◆ get_widget_checked()
Gtk::Widget * Gnome::Glade::Xml::get_widget_checked |
( |
const Glib::ustring & | name, |
|
|
GType | type ) |
|
protected |
◆ get_widget_derived()
template<class T_Widget >
T_Widget * Gnome::Glade::Xml::get_widget_derived |
( |
const Glib::ustring & | name, |
|
|
T_Widget *& | widget ) |
|
inline |
This provides a pointer to a widget whose details are specified in the Glade file, but which is implemented by your own derived class.
Your class must have a constructor like so:
DerivedDialog::DerivedDialog(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade)
: Gtk::Dialog(cobject)
For instance:
Gtk::DerivedBox* pBox = 0;
refXml->get_widget_derived("mybox", pBox);
- Parameters
-
name | The name of the widget. |
- Return values
-
widget | A pointer to the widget, or 0 on failure. |
- Returns
- The value of widget.
◆ get_widget_name()
static Glib::ustring Gnome::Glade::Xml::get_widget_name |
( |
Gtk::Widget & | widget | ) |
|
|
static |
◆ get_widget_prefix()
Glib::ListHandle< Gtk::Widget * > Gnome::Glade::Xml::get_widget_prefix |
( |
const Glib::ustring & | name | ) |
|
◆ get_widget_tree()
static Glib::RefPtr< Xml > Gnome::Glade::Xml::get_widget_tree |
( |
Gtk::Widget & | widget | ) |
|
|
static |
◆ gobj() [1/2]
GladeXML * Gnome::Glade::Xml::gobj |
( |
| ) |
|
|
inline |
Provides access to the underlying C GObject.
◆ gobj() [2/2]
const GladeXML * Gnome::Glade::Xml::gobj |
( |
| ) |
const |
|
inline |
Provides access to the underlying C GObject.
◆ gobj_copy()
GladeXML * Gnome::Glade::Xml::gobj_copy |
( |
| ) |
|
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
◆ lookup_type_vfunc()
virtual GType Gnome::Glade::Xml::lookup_type_vfunc |
( |
const Glib::ustring & | classname | ) |
|
|
protectedvirtual |
- interface for changing the custom widget handling */
◆ relative_file()
std::string Gnome::Glade::Xml::relative_file |
( |
const std::string & | filename | ) |
const |
◆ reparent_widget()
void Gnome::Glade::Xml::reparent_widget |
( |
const Glib::ustring & | name, |
|
|
Gtk::Container & | container ) |
Take the widget from the glade-generated container and put it in another container.
◆ wrap()
A Glib::wrap() method for this object.
- Parameters
-
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |
- Returns
- A C++ instance that wraps this C instance.
The documentation for this class was generated from the following file: