On Thu, 2005-22-12 at 16:21 +0100, Lars Weber wrote:
> While I'd like to make use of stock buttons because of translations,
> etc. I think I'd prefer to display buttons with text only.
Assuming by "stock buttons" you mean those composed by either Button()
or LibGlade, the only thing I can think of that would avoid the icons
would be to delve into the button itself (buttons as generated by Glade
are composite widgets, look at the .glade file for hints of what to cast
to when descending the object graph), grab the label that GTK composed,
use that in the construction of a new Button, de-parent the old one, and
add the new one to whatever Box you were working with.
For an example, see lines 234 to 268 of TestControlWindow.java in xseq:
http://research.operationaldynamics.com/source/darcsweb/?r=xseq;a=headblob;f=/tests/xseq/ui/TestControlWindow.java
I haven't been able to work on that code for a while now, but I remember
how nasty that was to figure out. [You can run the program that contains
that code if you want to see it in action, goto
http://research.operationaldynamics.com/projects/xseq/ for download
instructions]
For what it's worth, I wouldn't say that trying to do this is such a
terribly bright idea. For one it's really finicky tricky code (I've had
to do something like this before and it's a pain because you have to
"know" what the subordinate (HBox, Image, Label) ordering is. More
importantly, at least some of the point of the Desktop is user interface
coherence and so you're explicitly loosing something if the "close"
button doesn't have the icon on it that every other "close" button on
the desktop has. [OpenOffice and Eclipse are notable for missing the
icons since they are faking the themes with their cross platform widget
sets, with the result that it just doesn't look quite right]
AfC
Sydney
|