How to best implement a custom quad-paned widget?



Greetings everybody!

	Before I start, take a quick look at what I intend to achieve with my
custom widget (named GtkXPaned):

	http://macslow.mine.nu/shots/GtkXPaned-mockup.jpg

	This program seen in the screenshot is currently a workaround using two
GtkHPaned widgets embedded in one GtkVPaned widget. What I want to be
able to do in the end, is to grab the "intersection" of the two
paned-handles and move it around thus causing the resizing of all
embedded children-widgets. I started with GtkXPaned basing it off
GtkPaned and taking clues from GtkHPaned/GtkVPaned of the gtk+-2.6.10
release. I have the new GtkXPaned widget in a "working" state now (gtk+
compiles, GtkXPaned widget is instance-able from a normal gtk+-program).
But it doesn't really do all the things I want it to do yet (e.g.
handle-dragging doesn't work). I have to admit that I'm totally new to
developing custom gtk+-widgets (just reading the "GTK+ 2.0 Tutorial"
atm). So it's a rough ride for me, but without a real-world example I
would never get around learning it.

	Now I wonder what's the best way to represent/paint the "cross"-handle
of GtkXPaned. Should I split it up in two overlapping GdkWindow-widgets
or split it in three parts (e.g. top-bar, horizontal-bar and bottom-bar)
or maybe even split it up in five parts (top-bar, right-bar, bottom-bar,
left-bar and intersection-part)? What gtk_paint_* functions do you
suggest would be best to use for any of those possible split-ups? The
user should get a direct clue from the handles appearance that it not a
GtkVPaned/GtkHPaned. The cross-part at the intersection should probably
be drawn in a gtk_paint_handle-way... maybe like:

	http://macslow.mine.nu/shots/GtkXPaned-handle.jpg 

	I don't intend to release GtkXPaned to the public once it's finished
(unless anybody sees a general need for such a widget... I'm mainly
doing this because it's very handy for me doing a quad-view in a
3D-tool). I know it would also work equally well if put in files
separated from the gtk+ source-tree. But aside from my main goal I'm
also using it as a learning experience for several things... to get a
better understanding of gtk+ itself... importing the source-tree as
project into Eclipse to check out how Eclipse handles a project of that
size.

Thanks in advance for you time and kind advice!

Best regards...

MacSlow

-- 
Mirco "MacSlow" M�<macslow bangang de>




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