/usr/share/gtk-doc/html/libglade/libglade-embedding.html is in libglade2-dev 1:2.6.4-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Embedding Libglade Interfaces</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.74.3">
<link rel="home" href="index.html" title="Libglade - Graphical Interface Description Loader API">
<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.12 (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 I. 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 - Graphical Interface Description Loader API</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>
<div class="footer">
<hr>
Generated by GTK-Doc V1.12</div>
</body>
</html>
|