Re: [ooc-compiler] gtk-hello-world with oo2c?
Brought to you by:
mva
|
From: Frank H. <hr...@te...> - 2008-12-21 13:38:48
|
Hi Stewart, I surely would appreciate copies of our past discussion as well as some of your own examples. With an example of the main program, the implementation an event callback procedure and the placement of a gadget, I am done. I was too short with my question about FOREIGN/INTERFACE. What I wanted to know is: when would you compile a C wrapper into a library and call it from an INTERFACE module, and when would you write it as a FOREIGN module. From what you write, the latter is the better. Otherwise, FOREIGN module wouldn't make sense anyway, I guess. -- Frank Hrebabetzky +55 / 48 / 3235 1106 Florianopolis, Brazil Stewart Greenhill wrote: > Hi Frank, > > We had some discussion about this back in 2004. I have the emails of the > conversation, along with some attachments which include some code that > you wrote. I can send you this if it would help. > > I've done a couple of translations of the GTK interfaces. I'm not sure > how they work with recent GTK versions, but you're welcome to give them > a try. > > INTERFACE modules are for calling C APIs using the original C semantics. > In most cases data types such as structures, strings, etc can be passed > safely between OOC and C. > > FOREIGN modules are for implementing Oberon-2 objects using external > code. Use these if you want to provide an object-oriented wrapper around > some C library. This is used extensively by OOC's own library modules. > > If you need to do some GUI programming, VisualOberon is well worth a > look. It implements many nice widgets and is portable across Win32, Mac > OSX, and unix/X. > > Cheers, > Stewart > > Frank Hrebabetzky wrote: >> Some years ago I experimented with calling gtk from oo2c, but lost all >> sources. Is there any example around? Ideally it would be something >> like the second gtk-hello-world program at >> http://library.gnome.org/devel/gtk-tutorial/stable/c39.html#SEC-HELLOWORLD. >> What are the criteria of choice between INTERFACE and FOREIGN modules? > |