[Glade-devel] How glade should name new widgets



Hi Tristan!

On Sun, Apr 2, 2017 at 7:49 AM, Tristan Van Berkom
<tristan at upstairslabs.com> wrote:
Does this explanation solve the issue ?


Almost. It sure helps though.

Let me explain how the glade-anjuta integration works, so that it will
be more clear what the problem is. There are 3 ways that the
integration creates code to help the programmer: automatic member
widgets generation and callback generation (two different ways). I
recommend you to try anjuta, create a gtk application project, open
the callbacks.[ch] files and the .ui file to better see how the
integration works. Now, let me explain what anjuta does on automatic
callback/member widgets generation.

For automatic member widgets generation the user must double click a
widget (actually any object, but I'll call it widget for now) on the
glade inspector. When that happens, code will automatically be created
to include this widget as a private member of the associated class.
The name of the member is the same of the widget. So, if the widget
has no id strange things happens.

For automatic callback generation there are two ways to do it: the
user drags and drops a signal from glade to the source code editor
where it is wanted the callback to be created or the user
double-clicks the signal name and the callback code is automatically
created on the file of the associated class. The first parameter of
the callback has the same name of the widget. So, if the widget has no
id strange things happens.

From what I see, glade_widget_ensure_name creates a name for a widget
if it does not have one. This seems very good, but we would have the
call it before anjuta receives the signals to create member widgets or
callbacks. I think the best way to solve the issue is for glade the
call glade_widget_ensure_name on widgets before anjuta does anything
with id-less widgets. If you do not oppose it, I'll implement this
change. Do you agree wit it?




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