|
From: Bryan O. <oa...@ba...> - 2005-09-24 16:22:05
|
Joe English wrote:
> Bryan Oakley wrote:
>
>
>>Is it possible to detect a click over the image of a ttk::notebook tab?
>>I'm wanting to put a graphical (x) on each tab (ala safari) for
>>dismissing the tab. I can display the image but I'm not sure how to go
>>about making it active.
>
>
> Not at present; one possibility would be to add an [$nb identify $x $y]
> command that would return the tab index and element at position $x,$y.
>
It only took me three weeks to get back to this issue... darn work is
getting in the way of my playing around with tile! :-)
Yes, I agree that [$nb identify $x $y] seems like the right solution. It
could, for instance, return "image 0" if you click on the image for tab
0, "tab 0" if you click on any other part of the tab, "trough" if you
click in the trough (unoccupied area where tabs appear).
>>If that's not possible or planned, is there any way to add a clickable
>>image in the right of the blank area reserved for tabs (ala firefox)
>>other than by placing it with place, which sounds decidedly difficult to
>>make work in a cross platform way?
>
>
> I'd like to be able to support this UI idiom as well, but haven't
> thought of a good way to specify it yet. Ideas?
I'd like to suggest something like this:
ttk::button .nb.dismiss ....
.nb addwidget .nb.dismiss
This would let you add widgets to appear in the trough. They would
appear right-aligned, and you could potentially add more than one.
Normally you'd just add buttons, but labels or progressbars might be
other choices. This could easily be abused to put all kind of cruft in
there, but hopefully most people would limit themselves to a bare
minimum (read: firefox-like "close the current tab" button)
|