[Glade-devel] Embedding the design window



El mi?, 21-12-2005 a las 15:54 -0500, Tristan Van Berkom escribi?:
Lluis Sanchez wrote:
Hi,

I've been able to embed the design window by using a hack that involves
removing the top level flag and making some other changes.

It almost works out of the box, but it crashes when clicking on a
widget. The attached patch fixes the crash.

Hi,
     sorry your patch just slipped my mind for about a week,
the thing is; before I make this change, I want to see it in
action.

The code I'm writing is not yet in a public repository since it is still
experimental. However, I can send you the code if you want (btw, it's in
c#).


What other changes (involving removing top-level flag etc) did
you have to make ?

I'm using some code borrowed from the Stetic project. Besides unsetting
the top level flag it seems to assign a new GdkWindow to the window, but
I'm not sure why is it needed for.


Were you able to show all toplevels inside another widget
with drag and maybe resize support ?

Design windows are shown each one in its own tab inside the IDE, so you
can't freely move them (they are in a fixed position in the tab),
although you can resize them. I'm also using some methods from
libmetacity-private to draw the window borders, since they are not drawn
for non top-level windows. Here is a screenshot:

http://primates.ximian.com/~lluis/temp/MonoDevelop.png

I found some problems with the project tree window. Looks like the root
windows are not shown once they have been embedded. I will also need to
somehow hide in the palette the buttons for the Window and Dialog
widgets, since they create a top level window, and once realized it's
too late to make it embeddable.

So, the overall solution is a bit hacky. It would be better if glade-3
was more open in supporting other GUI models. For example, instead of
using a real Gtk.Window as root widget it could use a special container
with the same Gtk.Window properties. This special container could be
then safely embedded in a top level window (like in the current GUI
model) or in any other kind of container.

Lluis.





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