KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /usr/share/gtk-doc/html/libglade/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/gtk-doc/html/libglade/libglade-embedding.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Embedding Libglade Interfaces</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="index.html" title="Libglade Reference Manual">
<link rel="up" href="libglade-notes.html" title="Libglade Programming Notes">
<link rel="prev" href="libglade-extending.html" title="Extending Libglade">
<link rel="next" href="libglade-dtd.html" title="Glade 2.0 File Format">
<meta name="generator" content="GTK-Doc V1.6 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="libglade-notes.html" title="Libglade Programming Notes">
<link rel="chapter" href="libglade-dtd.html" title="Glade 2.0 File Format">
<link rel="part" href="libglade-lib.html" title="Part&#160;I.&#160;Libglade Library Reference">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
<td><a accesskey="p" href="libglade-extending.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="libglade-notes.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Libglade Reference Manual</th>
<td><a accesskey="n" href="libglade-dtd.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr></table>
<div class="sect1" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="libglade-embedding"></a>Embedding Libglade Interfaces</h2></div></div></div>
<p>Sometimes you will only want to use libglade for a small
      part of your program.  If it is just for some dialogs, this is
      easy -- you just generate the dialogs from the interface files
      when needed (note that libglade caches the XML parse tree
      between calls to <code class="function">glade_xml_new</code>, so you will
      not suffer the performance hit of parsing a particular XML file
      more than once).</p>
<p>On the other hand, you may want to use libglade to
      generate just part of the UI, such as the menubar or a notebook
      or something.  Libglade allows you to build only part of the
      interface if you want to.  The second argument to
      <code class="function">glade_xml_new</code> specifies the name of the
      base widget to build the interface from.  This way we can limit
      the widgets that are constructed by libglade.</p>
<p>For the menubar example, we would create a dummy window in
      Glade, and insert a menubar widget into the window.  We would
      then name the menubar in glade ("menubar" would be a good choice
      for the widget name ), and customise it as much as we want.  Now
      in the program, we can use the following code:</p>
<pre class="programlisting">
GladeXML *xml;
GtkWidget *menubar;

xml = glade_xml_new("some-interface-file", "menubar", NULL);

glade_xml_signal_autoconnect(xml);

menubar = glade_xml_get_widget(xml, "menubar");
/* do whatever we want to with the menubar */
</pre>
<p>From here, we can do what ever we want with the menubar
      widget.  The dummy window we created in Glade is never created,
      so does not affect the program.  You can also use similar code
      to only build a single dialog from a glade file that contains
      many dialogs.</p>
<p>One thing to note -- if you don't want a widget to be
      displayed as soon as it is constructed with
      <code class="function">glade_xml_new</code>, you should set the
      <em class="parameter"><code>visible</code></em> property on that widget to "no"
      in Glade.  This is the correct solution to the problem (putting
      a hack into libglade so that it never shows the toplevel windows
      is not The Right Thing).</p>
</div>
</body>
</html>

Anon7 - 2021