Spin button question

I've got a project in which I need to have what you might describe as a 2-dimensional
spin-button. Currently I've implemented a simple composite widget for myself containing
two normal spin buttons (for X and Y), one above the other, sitting in a gtkframe.

This looks quite good except for the buttons on the spin-buttons. What I think I want
to do next is to reparent the four buttons from their original locations as children
of the spin buttons and put them into the relevant cells of a 3x3 table so that I can
get what looks like a single set of left/right/up/down buttons operating on the relevant
X or Y axis spin button.

Trouble is, a quick look through the source of gtkspinbutton.c seems to indicate that
the up/down buttons of a spinbutton are not actually widgets in their own rights
but are magically handled by the spinbutton widget. It seems that the 'innards'
of spinbutton are a 'panel' (which I think is the editable part of the spinbutton
in which the current value is shown) packed into a container whose X allocation has
been hotwired to allow space for pair of small arrows to be painted in on the RHS!

If true, this all seems rather ad hoc and not very object-orientated! Have I understood
the code right please? If so, why was it done this way (pretty much stopping me doing
what I want to do) and not by packing a panel and a vbox into an hbox (the vbox
containing the uparrow and the downarrow)?

Is there a sensible way for me to do what I want to do?


Steve                                       | Steve's law of House Rewiring:
S.Hosgood@swansea.ac.uk                     | "No matter how many power sockets
Phone: +44 1792 297292 + ask for Steve      |  you fit in a room, you will run
Fax:   +44 1792 295811                      |  out within the first week of use
--------------------------------------------+  even if you took Steve's law of
http://iiit.swan.ac.uk/~iisteve/steve.html  |  House Rewiring into account"

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