Re: [Vala] PanelApplet example



I am also trying to create an example panel applet in vala but have
not succeeded. The example looks like this:

panel.vala

using GLib;
using Panel;


public class MainApplet : GLib.Object {

        public static bool panelFactory(Applet applet, string iid, pointer userData) {
                var button = new Gtk.Button();
                applet.add(button);
                applet.show_all();
                return false;
        }
        
        public static int main (string[] args) {
                return Applet.factory_main("OAFIID:Vala_Applet_Factory",
typeof(Panel.Applet), MainApplet.panelFactory, "1.0");
        }
}

panel.server

<oaf_info>

        <oaf_server iid="OAFIID:Vala_Applet_Factory" type="exe"
location="/home/quikee/projects/panel">
                <oaf_attribute name="repo_ids" type="stringv">
                        <item value="IDL:Bonobo/GenericFactory:1.0"/>
                        <item value="IDL:Bonobo/Unknown:1.0"/>
                </oaf_attribute>
                <oaf_attribute name="name" type="string" value="Vala Panel Example"/>
                <oaf_attribute name="description" type="string" value="Vala Panel Example"/>
        </oaf_server>

        <oaf_server iid="OAFIID:Vala_Applet" type="factory"
location="OAFIID:Vala_Applet_Factory">
                <oaf_attribute name="repo_ids" type="stringv">
                        <item value="IDL:GNOME/Vertigo/PanelAppletShell:1.0"/>
                        <item value="IDL:Bonobo/Control:1.0"/>
                        <item value="IDL:Bonobo/Unknown:1.0"/>
                </oaf_attribute>
                <oaf_attribute name="name" type="string" value="Vala Panel Example"/>
                <oaf_attribute name="description" type="string" value="Vala Panel Example"/>
                <oaf_attribute name="panel:category" type="string" value="Utility"/>
                <oaf_attribute name="panel:icon" type="string" value="computer.png"/>
        </oaf_server>

</oaf_info>

The example just seg. faults if it is executed. Any ideas what might be wrong?

Best regards,
Tomaz


On Feb 5, 2008 1:36 AM, Andreas Sliwka <andreas sliwka gmail com> wrote:
Greetings,
 I'm looking for an example on how to create a PanelApplet with vala.
Any help would be greatly appreciated.

Jürg,
 in your blog you wrote on August 25th 2007 that you had such an
example, would this still compile with the latest vala version?

Best regards,
_______________________________________________
Vala-list mailing list
Vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]