From: jmc on
Hello,

I would like to know if the ttk_checkbutton widget can be configured
with the "-state readonly" option.

My purpose is to display a big multiple rows/columns readonly table
with textual + digital + boolean (hence the checkbuttons) data, *but*
without the light grey associated with the disabled state of
checkbuttons for readability purpose (possibly because of contrast
full black color for textual/digital data versus light grey color for
checkbuttons).

When configuring ttk_checbutton with "-state readonly" option it
responds to user input (ie changing from checked/unchecked and vice
versa) and that is not what is expected.

It is not clear to me if this is a bug or if the general ttk widget
option "-state readonly" is not handled by ttk_checkbutton.

Many thanks

Jean-Marie


From: Jeff Godfrey on
On 5/7/2010 12:15 PM, jmc wrote:
> Hello,
>
> I would like to know if the ttk_checkbutton widget can be configured
> with the "-state readonly" option.
>
> My purpose is to display a big multiple rows/columns readonly table

While I don't know the answer to your specific question, is the check
button always "read only" in your app? If so, why not just use a
"checked" and an "unchecked" image in, say, a label?

Jeff
From: jmc on
On 7 mai, 19:24, Jeff Godfrey <jeff_godf...(a)pobox.com> wrote:
> On 5/7/2010 12:15 PM, jmc wrote:
>
> > Hello,
>
> > I would like to know if the ttk_checkbutton widget can be configured
> > with the "-state readonly" option.
>
> > My purpose is to display a big multiple rows/columns readonly table
>
> While I don't know the answer to your specific question, is the check
> button always "read only" in your app?  If so, why not just use a
> "checked" and an "unchecked" image in, say, a label?
>
> Jeff

Hello Jeff, thanks for your reply.

Yes, the checkbuttons are allways "readonly" in the application, so
the idea of using images instead of checkbuttons is nice. But the
application becomes more complicated as data are red from a database
*and* the whole widget (Treectrl) is configured to change the
background of an entire row of data when clicked on it (so 4 images to
handle for each case) .

If I can't find an other solution, do you know if is it possible to
find somewhere the images corresponding to those used by the
ttk_checkbutton ?

Jean-Marie
From: Jeff Godfrey on
On 5/7/2010 12:54 PM, jmc wrote:
> On 7 mai, 19:24, Jeff Godfrey<jeff_godf...(a)pobox.com> wrote:
>> On 5/7/2010 12:15 PM, jmc wrote:
>>
>>> Hello,
>>
>>> I would like to know if the ttk_checkbutton widget can be configured
>>> with the "-state readonly" option.
>>
>>> My purpose is to display a big multiple rows/columns readonly table
>>
>> While I don't know the answer to your specific question, is the check
>> button always "read only" in your app? If so, why not just use a
>> "checked" and an "unchecked" image in, say, a label?
>>
>> Jeff
>
> Hello Jeff, thanks for your reply.
>
> Yes, the checkbuttons are allways "readonly" in the application, so
> the idea of using images instead of checkbuttons is nice. But the
> application becomes more complicated as data are red from a database
> *and* the whole widget (Treectrl) is configured to change the
> background of an entire row of data when clicked on it (so 4 images to
> handle for each case) .

Just guessing, but I'd think the background of the "cell" would still be
visible around the image (if configured correctly). In that case, I'd
think you could get by with just 2 images.

> If I can't find an other solution, do you know if is it possible to
> find somewhere the images corresponding to those used by the
> ttk_checkbutton ?

If it were me, I'd just grab the real ones via a screen capture app...

Jeff
From: Donald Arseneau on
On May 7, 11:39 am, Jeff Godfrey <jeff_godf...(a)pobox.com> wrote:
> On 5/7/2010 12:54 PM, jmc wrote:

> > find somewhere the images corresponding to those used by the
> > ttk_checkbutton ?
>
> If it were me, I'd just grab the real ones via a screen capture app...

Or if the themability is important, have the program itself
make the image based on the current theme.

Or stack a transparent widget over the checkbox to intercept mouse
clicks.

The behaviour of "readonly" sounds like a bug though.