Permalink
Browse files

Added constructor to ItemFactory

  • Loading branch information...
1 parent 6de734c commit 6768e27d62b71bd4d2f53487dfa63b75ca3d3025 n ddrylliog committed Oct 21, 2009
Showing with 24 additions and 5 deletions.
  1. +2 −0 gtk/Gtk.ooc
  2. +16 −4 gtk/ItemFactory.ooc
  3. +6 −1 hiworld.ooc
View
2 gtk/Gtk.ooc
@@ -51,6 +51,8 @@ gtk_quit_add_destroy: extern func (Int, _GObject)
GBool: cover from gboolean
GInt: cover from gint
+GUInt: cover from guint
+GLong: cover from glong
GULong: cover from gulong
GPointer: cover from gpointer
GChar: cover from gchar
View
20 gtk/ItemFactory.ooc
@@ -5,15 +5,27 @@ ItemFactory: cover from GtkItemFactory* {
new: static extern(gtk_item_factory_new) func(type: Type,path: GChar*,accel_group: AccelGroup) -> This
-
-
createItems: extern(gtk_item_factory_create_items) func(nitems: GInt,entry: ItemFactoryEntry )
getWidget: extern(gtk_item_factory_get_widget) func(widget: GChar*) -> Widget
}
-ItemFactoryEntry: cover from GtkItemFactoryEntry* {
-
+ItemFactoryEntry: cover from GtkItemFactoryEntry {
+
+ path, accelerator : extern GChar*
+ callback: extern Func
+ callbackAction: extern(callback_action) GUInt
+ itemType: extern(item_type) GChar*
+ extraData: extern(extra_data) GPointer
+
+ new: static func (.path, .accelerator, .callback, .callbackAction) -> This {
+ this : This
+ this path = path
+ this accelerator = accelerator
+ this callback = callback
+ this callbackAction = callbackAction
+ return this
+ }
}
View
7 hiworld.ooc
@@ -1,11 +1,16 @@
+
+
import gtk/[Gtk, Window, Button]
main: func {
win := Window new("Hi")
win setUSize(400, 200) .connect("delete_event", exit)
button := Button new("Oh, really?")
- button connect("clicked", func { g_print("What's so funny ?\n") }) .setBorderWidth(50)
+ button connect("clicked", func {
+ g_print("What's so funny ?\n")
+ Exception new("Oh it's the end of the world") throw()
+ }) .setBorderWidth(50)
win add(button) .showAll()
Gtk main()

0 comments on commit 6768e27

Please sign in to comment.