Discussion:
[Gtk2hs-users] g_object_get_property.... Could it be changed to safe?
J H
2013-11-04 05:26:53 UTC
Permalink
Hi all-

I've used bindings-gobject to create a new widget with its own property...
And everything worked great with gtk2hs except one small thing. "get"
(which wraps g_object_get_property) is declared as an unsafe ffi call, so
when it tried to call my haskell getter function, it failed. Upon simply
deleting the word "unsafe" from line 126 in System/Glib/Properties.chs,
everything worked.

Is this something that could be changed in the official release?

thanks

Jamshid
Daniel Wagner
2013-11-05 03:27:20 UTC
Permalink
Hm. At the moment, gtk2hs doesn't really support creating new widgets
from within Haskell. So it doesn't surprise me that something breaks if
you find a way to do that. I'm personally pretty happy turning unsafe
FFI calls to safe ones; but is this the only thing that will need to
change? I wonder what other unsafe calls assume that all widgets are
implemented in C?

~d
Post by J H
Hi all-
I've used bindings-gobject to create a new widget with its own
property... And everything worked great with gtk2hs except one small
thing.  "get" (which wraps g_object_get_property) is declared as an
unsafe ffi call, so when it tried to call my haskell getter function,
it failed.  Upon simply deleting the word "unsafe" from line 126 in
System/Glib/Properties.chs, everything worked.
Is this something that could be changed in the official release?
thanks
Jamshid
------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform
that
developers love is also attractive to malware creators. Download this
white
paper to learn more about secure code signing practices that can help
keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Gtk2hs-users mailing list
https://lists.sourceforge.net/lists/listinfo/gtk2hs-users
J H
2013-11-07 03:38:03 UTC
Permalink
So far, this is all I have run into, but admittedly I haven't done
extensive testing.

If you want, I can get my lib further along, and do more testing and give
you a summary of what I find. It might be easier to get a handle on how
big of a conversion project this will be at that time....

thanks
Jamshid
Post by Daniel Wagner
Hm. At the moment, gtk2hs doesn't really support creating new widgets
from within Haskell. So it doesn't surprise me that something breaks if
you find a way to do that. I'm personally pretty happy turning unsafe
FFI calls to safe ones; but is this the only thing that will need to
change? I wonder what other unsafe calls assume that all widgets are
implemented in C?
~d
Post by J H
Hi all-
I've used bindings-gobject to create a new widget with its own
property... And everything worked great with gtk2hs except one small
thing. "get" (which wraps g_object_get_property) is declared as an
unsafe ffi call, so when it tried to call my haskell getter function,
it failed. Upon simply deleting the word "unsafe" from line 126 in
System/Glib/Properties.chs, everything worked.
Is this something that could be changed in the official release?
thanks
Jamshid
------------------------------------------------------------------------------
Post by J H
Android is increasing in popularity, but the open development platform
that
developers love is also attractive to malware creators. Download this
white
paper to learn more about secure code signing practices that can help
keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
Post by J H
_______________________________________________
Gtk2hs-users mailing list
https://lists.sourceforge.net/lists/listinfo/gtk2hs-users
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models.
Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and
register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Gtk2hs-users mailing list
https://lists.sourceforge.net/lists/listinfo/gtk2hs-users
Continue reading on narkive:
Loading...