Re: [glade--]Rearragement of code (dialog's widgets as members)



Mark Jones schrieb:
Christof wrote:

triendl klaus schrieb:

glademm is already able to do this task - just set a widget in glade to protected or even public.

Is this information that well hidden?


but what would be great is if glademm would allow creating normal members - not only pointers. what do you think?

This was part of glademm-0.4.x? I stopped maintaining that code because with gtkmm-1.2, the recommended way to allocate widgets was on heap. It simplified things a lot since it was possible to rearrange the creation order easily (otherwise you would have to reorder the member variables).

A lot of more complicated widgets still rely on other widgets being created first (internal objects (e.g. Adjustment), sometimes children or parent).


Well, I just tried what Triendl suggested and it creates the code I was looking for and had been doing by hand.

Concerning what Christof brought up about object order of creation.  I believe the order remains the same since they are just pointers and since the pointers are given objects in the exact same spot as before.  The only difference is where the pointer itself is declared, but initialization is at the same location, so the order of creation remains the same, right?  I performed a diff of the two different versions of code created and the assignment line is in the same spot.


Hmmm. Sounds like a misunderstanding. Admittedly I don't understand, what you are talking about. (Current glademm is not able to inline widgets no matter how hard you try.)

But I was talking about changing
  class window1_glade { Gtk::SpinButton *spin; ... };
to
  class window1_glade { Gtk::SpinButton spin; ... };
which I thought what Klaus meant when he spoke about normal members.

This is very difficult to do right since the order of members in the class determines the order of widget creation, not the order of generated statements in the ctor.

Also some widgets simply do not work when inlined. (but I can't tell for sure which ones, maybe the problem was with gnomemm-1.0 widgets and does not exist any more)

   Christof




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