RE: drawing upon a widget



> well, if i understood well, i take a GtkSocket (this is what i am
using...)
> I add in it a gtkdrawable slightly modified to draw upon its parent window
> I use the gtkdrawable to draw things with gtk_draw_*

Hmm.
This time I'm the confused one...

First of all, you don't need a gtkdrawable if there allready exists a class
that draws the appropriate objects for you. I don't know much about the
gtkdrawable, since I've never used it.

Secondly, I think gtk will keep track if it should write upon a parent, or
upon a window of it own, and does so for you - so you shouldn't need to
worry about that yourself.

Third, I'm uncertain about the gtk_socket. You should be able to plug in
another window, running in a different process, into the gtk_socket, and I
don't know how this is handled internally.
( Actually, I don't know if a gtk_socket is able of doing this. I havn't
used gtk_socket. )

Fourth, are you trying to draw upon a different window, from another
process, that is plugged into a socket inside your own application??
I believed that you want'ed to do something simple... ;)

If you really are trying to draw something, on top, of a window that belongs
to another process , you could either let that application plug in a window
from your app, into another socket inside the other app, and draw upon that
window. Or you need to tell the other application to draw things for you.

If not, then I don't really understand what you are trying to do...
Do you wan't do draw upon a gtk_socket while nothing is there?

Then you should be able to add anything you like to the socket, but I don't
know if that will interfere with it's normal behaviour.
Otherwise, you could perhaps create a new class "GtkDrawableSocket" that
inherites from GtkSocket, and that preforms the drawing.

I guess that this is becoming a harder question than I can answer... :(
( Have you downloaded the gtk_examples and the gtk_documents? )

> mm... If you say this could work it probably mean that the drawing is
> done on children first then on containers ... am i right ?
Uhu?
Shouldn't it be, first on container, and then on the containers children?



gtk_draw_* - you mean gtk_draw_arrow, gtk_draw_polygon etc?
I *think* they can draw anywhere on a window ( that they are primitives that
don't care about containers and children ), but only when you have receieved
an expose event.
To use them, I think the best way is to create a new class, which inherites
from gtk_whatever, and then you can use them from a widget_draw function
that you have writtn yourself, for your new class.
I think you will find it hard to use those functions another way.

Okay, slap me someone if I'm talking gibblerich!
This question is out of my knowledge...
// Liss



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