Re: gtk and glade



stan huang wrote:

Hello, how do we use glade to open an existing gtk
application code? is it possible?

In short: no!

If you've worked with Windows previously you might be thinking of Glade
as something like a Windows resource editor which allows to open (most)
binaries and view, modify and store its dialog, menu and other resources
without having the sources of the binary.

However, that's NOT how Glade (nor GTK) work. The Glade utility doesn't
touch any binaries at all. It's purpose is just to create program source
code based on dialog and menu definitions.

Windows binaries can contain standardized resource description lists
which allow external utilities to easily obtain basic information about
dialogs, menus and some other things from a binary. Using that only few
function calls are required to open a dialog in a Windows program. There
are some Windows API functions that can evaluate the resource lists and
create items as specified in them. Capabilities of those resource lists
are limited, however. They don't contain advanced attributes of items.

GTK-based binaries DO NOT contain such standardized and specific
resource data which would allow a utility like Glade (or any other) to
easily extract information about windows, dialogs, menus or other
resources. Instead, in a GTK program those items are created by numerous
GTK function calls during execution of the program. For every button,
label, text entry and every menu item which is to appear inside a window
there are at least 2 (but usually more) GTK functions to be called to
create it and setup some attributes of it.

Though Glade has an own resource file format (the .glade-files) these
are absolutely Glade-specific and mostly only used + available when the
rest of the source is also available, thus at design + build time of a
program. They are no common part of binaries which use GTK.



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