Re: [Vala] Copy function produces segmentation fault

2011-05-18 Thread Luca Bruno
On Tue, May 17, 2011 at 01:55:57PM -0600, Lewis Gunsch wrote:
 Hi,
 
 I have been writing a Vapi for the ZeroMQ library: http://www.zeromq.org/. I
 would eventually like it to be distributed with Vala itself, and would
 propose myself as the maintainer.
 
 See the vapi here:
 https://github.com/lgunsch/zmq-vala/blob/master/libzmq.vapi

Would you add a link to http://live.gnome.org/Vala/ExternalBindings ?

 Although, I am having some trouble getting the MSG.Msg.copy() message copy
 function to work correctly. It produces a segmentation fault. I am unsure
 how to go about fixing this issue. You can see the docs for the libraries
 copy function below.
 
 http://api.zeromq.org/2-1:zmq-msg-copy

Try with:
[CCode (instance_pos = 2)]
public int copy (out Msg dest);

Use as:
Msg copy;
int res = somemsg.copy (out copy);

-- 
http://www.debian.org - The Universal Operating System


signature.asc
Description: Digital signature
___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Setting image on a button?

2011-05-18 Thread Sébastien Wilmet
Hello,

On Tue, May 17, 2011 at 08:10:55PM -0500, Damien Radtke wrote:
 Ah, maybe I should've been more clear. It works if the image is the only
 thing on the button, but I want to have both text and the image, and it
 doesn't work if the button already has text on it (even if I use
 image.show()).

Is the following code what you want to achieve?

Button button = new Button.with_label (Clear All);
Image image = new Image.from_stock (Stock.CLEAR, IconSize.MENU);
button.set_image (image);
button.show_all ();


pgpP58C860hmD.pgp
Description: PGP signature
___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Setting image on a button?

2011-05-18 Thread Damien Radtke
Yep. Doesn't work.

On Wed, May 18, 2011 at 4:58 AM, Sébastien Wilmet 
sebastien.wil...@gmail.com wrote:

 Hello,

 On Tue, May 17, 2011 at 08:10:55PM -0500, Damien Radtke wrote:
  Ah, maybe I should've been more clear. It works if the image is the only
  thing on the button, but I want to have both text and the image, and it
  doesn't work if the button already has text on it (even if I use
  image.show()).

 Is the following code what you want to achieve?

 Button button = new Button.with_label (Clear All);
 Image image = new Image.from_stock (Stock.CLEAR, IconSize.MENU);
 button.set_image (image);
 button.show_all ();

 ___
 vala-list mailing list
 vala-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/vala-list


___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


[Vala] vala, libpeas, GIR

2011-05-18 Thread august

Hi there,

I've been playing around with vala, libpeas, and plugins loaded on
the fly through libseed (javascript) and python.  

The way you make plugins in libpeas  is through extensions.  These
can be defined through an interface.  It looks something like this:

public interface MyActivatable : Object {
public abstract ScriptableWindow window { get; set; }
public abstract void activate ();
public abstract void deactivate ();
}

Since libpeas doesn't really handle Vala code, I've been trying to
write vala that compiles close to the same C code that libpease
wants.

The above interface works to some extent, but I did
noticed that the  GIR file that  vala produces is not the same as
what libpeas has.  They have a default interface called Activatable
whos GIR file looks like so (section): 

 field name=activate
callback name=activate
  return-value transfer-ownership=none
type name=none c:type=void/
  /return-value
  parameters
parameter name=activatable transfer-ownership=none
  type name=Activatable c:type=PeasActivatable*/
/parameter
  /parameters
/callback
  /field

The GIr that vala produces looks like this however:

callback name=my_activatable_activate 
c:type=my_activatable_activate
  return-value transfer-ownership=none
type name=none/
  /return-value
/callback

 It is missing the field tags altogether.  Since they are using some 
sort
of automatic means of generating the GIR file, I wonder where these field
statems come from.  I was told on the #libpeas IRC that the GIR creation is off
in vala.   Any ideas or help on this? 

There is something wrong in the GIR that causes all python plugins to 
crash when they use MyActivatable instead of the default Activatable from 
libpeas.

thanks -august.
___
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list