[Glade-devel] libglade usage



On Fri, 9 Jan 2004, James Henstridge wrote:

On 8/01/2004 10:13 PM, Damon Chaplin wrote:

On Thu, 2004-01-08 at 03:41, James Henstridge wrote:

Libglade's autoconnect function looks up function names in the global
symbol table.  By default, functions in the main executable do not
appear there, so would not normally be visible.

The flags returned by "pkg-config --libs libglade-2.0" should include a
linker flag to export the apps symbols for use by things like
autoconnect() (for linux systems, the flag is -Wl,--export-dynamic).

Is the autoconnect stuff known to work across all platforms now? I seem
to remember it was uncertain initially.
(I know we didn't use it in Evolution, but I can't remember why.)

I don't know if it works on all platforms.  I know it works on a fair
number of them though (possibly all the interesting unix platforms,
even).  Python uses this same feature (exporting the main app's symbols)
to handle extension modules, so if Python works on the system, libglade
will probably do so as well.

The one system I am not sure about is Windows.  Shared libraries are
handled quite differently there, so I don't know the answer (I am sure
someone does though ...).

Autoconnect does not work in GTK 1.2 on Windows.  I ported libglade 0.17
to Windows, and manual connect worked, so I know it wasn't a symbol export
problem, but autoconnect never worked.  I don't know what works in GTK
2.x on Windows.

If it is reliable, are the other glade_xml_connect_* functions really
necessary any more? Why would you use them? I think this needs to be
documented better.

Quite aside from the not-working-on-all-platforms problem, I've seen
applications that modified callback chains on the fly to change
application behavior.  This technique has some advantages and depends on
glade_xml_connect_*, so those functions should not be removed.

DM

P.S.

<bitchmode>
I've seen entirely too many suggestions on this list along the lines of "I
don't use that feature so delete it."  Consider for a moment that Glade is
a tool used by many different people, representing numerous different
styles and techniques, and stop advocating removing features you don't
personally use.

There are multiple ways of doing most things.  Anybody who uses any flavor
of UNIX should know this.  Nor is the blind spot restricted to UNIX users.
People complain that certain Microsoft products have too many ways of
accomplishing things, and they're ignoring this principle as well.
Different people think differently and your applications should take this
into account, not merely at the developer level, but right out to the
userlevel.
 </bitchmode>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]