[Glade-devel] Embedding the design window
- From: tristan.van.berkom at gmail.com (Tristan Van Berkom)
- Subject: [Glade-devel] Embedding the design window
- Date: Thu Dec 22 13:54:20 2005
Lluis Sanchez wrote:
[...]
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#).
I see.
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.
Ahem...
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
Cute ;)
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.
Ah yes, thats because it looks for the toplevel flag and itterates
down from there, this is easy to change (anyway we need support for
top-level non-gtkwidget objects like GtkAdjustment, GtkSizeGroup etc)
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.
It seems like just special-casing GtkWindow a little will get us there
without having to use a different type of container to "mock" the
GtkWindow... also maybe a "containing" plug widget...
Now I'm wondering if we can offer some kind of sane API for IDE's here
to make it easy to implement; It seems that we need to optionally embed
toplevel in other widgets that will respond well to resizes,
for example: say you wanted to display a notebook where each tab
was an open project in glade; in each tab you display a GtkHBox
inside a scrolled window which lists the toplevels from top down;
the issue I see is that those GtkWindows that are "non-toplevels"
will want to resize to fill up the space in the GtkHBox
So we'd need to have a "top-level" container that would resize while
adding extra "gray space" outside the window (and draw a cute border);
and keep the GtkWindow's "default size" (or current natural size) as its
"size-request" (therefore refusing to shrink).
What do you think ?
Cheers,
-Tristan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]