Re: how to set treeview and drawarea in same position?



this will work:
+----------------------------+
|        GtkWindow           |
| +------------------------+ |
| |   GtkLayout            | |
| | +-------------------+  | |
| | |   GtkTreeView     |  | |
| | |                   |  | |
| | |                   |  | |
| | +-------------------+  | |
| |                        | |
| +------------------------+ |
+----------------------------+
(a treeview in a layout in a window)



this will not work:
+----------------------------+
|        GtkWindow           |
| +---------------+          |
| |   GtkLayout   |          |
| | +-------------------+    |
| | |   GtkTreeView     |    |
| | |                   |    |
| | |                   |    |
| | +-------------------+    |
| |               |          |
| +---------------+          |
+----------------------------+
(a treeview and a layout overlaping 
in a window)




I'm not sure about this
(but I doubt it works):
+--------------------------------+
|       GtkWindow                |
| +----------------------------+ |
| |        GtkLayout           | |
| | +---------------+          | |
| | |GtkDrawingArea |          | |
| | | +-------------------+    | |
| | | |   GtkTreeView     |    | |
| | | |                   |    | |
| | | |                   |    | |
| | | +-------------------+    | |
| | |               |          | |
| | +---------------+          | |
| +----------------------------+ |
+--------------------------------+
(a treeview and a drwaingarea overlaping 
in a layout in a window)


I hope this helps,
        -Tristan


"chen.shengqi" wrote:

it seems that GtkLayout can do this.  the docs say GtkLayout is similar to GtkDrawingArea, but I can not 
catch ConfigureEvent and ExposeEvent . Should I add a GtkDrawingArea to GtkLayout?

Widgets can't overlap in gtk unless
they are GtkWindows (parent of all widgets in a screen
heirarchy). You can add widgets inside other widgets _only_
if the other widgets are GtkContainer implementations.(example
GtkWindow, GtkFixed, GtkScrolledWindow, Gtk[HV]Box ...).

You might want to experiment adding all your widgets to
GtkWindows independantly and then adding your GtkWindows
to a toplevel GtkWindow. (I'm not sure if that works)

Cheers,
-Tristan


"chen.shengqi" wrote:

    thanks for you reply, but in box or table, two widget are in different cells, I want to put a 
treeview on a drawingarea,  example: drawingarea at {10,10,300,300} and treeview at { 50,50,200,200}. 
how can I do this in gtk?

chen.shengqi wrote:

Dear sirs:
       I want to place a treeview in center of a drawingarea some time(treeview  is smaller than 
drawingarea ) , but the container can only accept one object, How can I overcome this?  In windows, 
you can place as many object as you want in a container.


I hope I understand your question right (and I have to doubt it whenever
I think the question is simple enough for me to answer it). To overcome
the limitation of one widget per container, you can use widgets like
boxes and tables - they can take multiple widgets. After that, you can
put the box or table into a container. I don't know anything about
programming in windows, but I guess it's quite different than GTK.
Therefore, it would be best to read the GTK tutorial which you can find
on www.gtk.org to learn the basic concepts before attempting more
complicated stuff. (Basic concepts, so it happens, are my entire
knowledge of GTK :-) )

Cheers
Horror Vacui


,Ù¦-^½éeSËfj)b?        b²Ø-?ªiuëÞ-X¬¶  è?ê+,m§ÿæj)`???¢¸??¨¥?©ÿ-+-Swèþdjs]z÷¥-+-
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

,Ù¦-^½éeSËfj)b?        b²Ø-?ªiuëÞ-X¬¶  è?ê+,m§ÿæj)`???¢¸??¨¥?©ÿ-+-Swèþdjs]z÷¥-+-



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