[Vala] error: too many arguments to function

2010-07-22 Thread Dru Moore
Hi all,

Not sure if this is a bug or user error, but I am getting an error
from the c compile stage of my program:
error: too many arguments to function
'hildon_wizard_dialog_set_forward_page_func'

I've output the intermediate c files and it looks to me that valac is
inserting an additional incorrect parameter into the c call.

Is there any quick way to edit the output c and compile to test this?
valac doesn't seem to output a makefile or similar.

Salient code for my problem:

From hildon-1.vapi file

public void set_forward_page_func (Hildon.WizardDialogPageFunc
page_func, void* data, GLib.DestroyNotify destroy);


From hildon-wizard-dialog.h

void
hildon_wizard_dialog_set_forward_page_func  (
HildonWizardDialog *wizard_dialog,
HildonWizardDialogPageFunc page_func,
gpointer data,
GDestroyNotify destroy
);


Form my vala source

this.set_forward_page_func(forward_page_function, app_settings,
(GLib.DestroyNotify)destroy_notify);


From vala's generated c file

hildon_wizard_dialog_set_forward_page_func (
(HildonWizardDialog*) self,
_id_works_first_run_wizard_forward_page_function_hildon_wizard_dialog_page_func,
self,
self-priv-app_settings,
(GDestroyNotify) id_works_first_run_wizard_destroy_notify
);

regards

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


Re: [Vala] error: too many arguments to function

2010-07-22 Thread Jan Hudec

On Wed, July 21, 2010 15:41, Dru Moore wrote:
 Hi all,

 Not sure if this is a bug or user error, but I am getting an error
 from the c compile stage of my program:
 error: too many arguments to function
 'hildon_wizard_dialog_set_forward_page_func'

From hildon-1.vapi file

 public void set_forward_page_func (Hildon.WizardDialogPageFunc
 page_func, void* data, GLib.DestroyNotify destroy);

This is a bug. It should be:

public void set_forward_page_func (owned Hildon.WizardDialogPageFunc
page_func);

The data and destroy arguments are implicit in that.

 Form my vala source

 this.set_forward_page_func(forward_page_function, app_settings,
 (GLib.DestroyNotify)destroy_notify);

Obviously when the 2 extra arguments go away here, they'll go away
in your code too. It will be:

set_forward_page_func(this.forward_page_function);

Note, that there should be no data argument in the
Hildon.WizardDialogPageFunc declaration either. The
C function has it, but it's used to pass the invocant
if passing method or the closure if you pass closure.

-- 
- Jan Hudec b...@ucw.cz

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


Re: [Vala] information on dova

2010-07-22 Thread Martin DeMello
On Wed, Jul 21, 2010 at 7:21 PM, Abderrahim Kitouni a.kito...@gmail.com wrote:
 Hi,
 في ر، 21-07-2010 عند 14:51 +0200 ، كتب andi:
 Hi list,
 I was wondering if anyone could give me or point me at some information
 on dova and its aims. I've been googling for quite some time now and
 read a bit of code in the gitorous repo. Of course, I also found the
 page on live.gnome.org.

 Its aim is mainly to have vala without the quirks and limitations of
 GObject. Vala with dova should be closer to Java and C# than now (but
 it'll still be better ;-))

How will that affect the writing of gtk and gnome apps?

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


Re: [Vala] information on dova

2010-07-22 Thread Frederik
Martin DeMello wrote:
 On Wed, Jul 21, 2010 at 7:21 PM, Abderrahim Kitouni a.kito...@gmail.com 
 wrote:
 Hi,
 في ر، 21-07-2010 عند 14:51 +0200 ، كتب andi:
 Hi list,
 I was wondering if anyone could give me or point me at some information
 on dova and its aims. I've been googling for quite some time now and
 read a bit of code in the gitorous repo. Of course, I also found the
 page on live.gnome.org.
 
 Its aim is mainly to have vala without the quirks and limitations of
 GObject. Vala with dova should be closer to Java and C# than now (but
 it'll still be better ;-))
 
 How will that affect the writing of gtk and gnome apps?

I don't think it's meant for GTK+/GNOME development, nor is it
GObject 3.0. Dova is an alternative object system for Vala,
unrelated and incompatible to GObject, and requires its own library
stack (or runtime bindings).

If you want to write GTK+/GNOME applications you're better off with
Vala's GObject default profile which does not require runtime bindings.

Dova is the answer to how an object system would look like if it was
designed specifically for Vala, without any compatibility
considerations. And it seems to be Jürg's playground for new Vala
features that he will eventually port to the GObject profile once he
considers them to be reasonable.

You can use Dova if you're adventurous and do not need GObject
compatibility.


Best regards,

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


Re: [Vala] Gtk Custom widget: drawing with gtk theme colours

2010-07-22 Thread Harry Van Haaren
Cheers for the XFCE link, didnt know they were doing tut's these days!

I got the following vala code to work:

unowned Gtk.Style style = this.get_style();
// color.x  is a uint16: divide by 65535.0 to get 0-1 range
Gdk.Color color = style.bg[0];
cr.set_source_rgb(color.red/65535.0, color.green/65535.0,
color.blue/65535.0);

probably not the nicest code ever, but it gets the job done.

Gdk.cairo_set_source_color(some_cairo_context, some_gdk_color);   // taken
from the XFCE tutorial

That's a nice convenience function, but I dont really like the non-OOP
style...
Each to their own sure!
-Harry

On Thu, Jul 22, 2010 at 7:20 PM, Mike Massonnet mmasson...@gmail.comwrote:

 Hi,

 2010/7/21 Harry Van Haaren harryhaa...@gmail.com:
  Hey All,
 
  I've designed a couple of widgets now, (in various languanges: python C++
  Vala)
  and googled for many tutorials regarding how to draw custom widgets in
 the
  GTK theme
  colours. I havent found any example code, or tutorial yet...
 
  I hope somebody has a pointer on how I can extract the colours from the
  current theme?

 http://wiki.xfce.org/howto/monochrome-icon#gtk_colors

 HTH,
 Mike

  Cheers, -Harry

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