> I don't know about writing widgets in separate files. I suppose it may be
> useful in some situations, but I'm not sure its useful enough to go in
Glade.

> The thing I was going to do was to add component structs, which contain
pointers
> to all the widgets in the window. Someone has sent me a patch to do this,
so
> it may get added soon.

I really like that idea.

> We could also let the user add their own data to the struct, and we could
> automatically pass it to all signal handlers as the data argument.

Would this be done using a glist of (void *) in the struct
    struct AppData(
        {glade-defined stuff},
        glist *user_data
    )
or would there be an editor in glade to add individual data fields?  Or
would the user directly modify the struct in the file?

> Yes, it will be complicated. In this case you could detect when the
property
> has changed and ask the user if they want to move the file to the new
position.

That's not actually that hard, but it may confuse the user.  For example, if
we default the file name to <widget-name>.c/.h, and they change the widget
name, we would want to change the file names.  We would, of course, ask the
user.  Or we could force the user to give a file name initially and not
change the file name unless the user asks.

> We could honour the 'show' property of the toplevel widgets, like libglade
does.

That works.

> Though we'd need a way for the user to get a pointer to the auto-created
windows.

In Delphi, if a form is autocreated then a static variable of the type of
the form is added to the form's declaration.  When the form is auto-created,
the static variable is assigned a pointer to the newly created instance.
You can always create new ones on the stack, but the static variable is not
changed.

Example:

unit TestForm_impl;

// <snip>  Interface declarations

type
  TTestForm = class(TForm)   // <-- Class name is TTestForm
  end;

var   // <-- In pascal, "var" means "global"
  TestForm: TTestForm;   // <-- Instance variable of type TTestForm.

// <snip>  Class implementation

end.

*** END EXAMPLE

We could do something similar in C/C++/Perl/etc.

John

+---------------------------------------------------------------------+
To unsubscribe from this list, send a message to [EMAIL PROTECTED]
with the line "unsubscribe glade-devel" in the body of the message.

Reply via email to