Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can I use notebook instead of ttk::notebook

41 views
Skip to first unread message

Cecil Westerhof

unread,
Jun 27, 2018, 7:44:05 AM6/27/18
to
At the moment I am using:
ttk::notebook .nb

But I would prefer to use:
notebook .nb

Is there a way to do this. I tried:
namespace import ttk::notebook

But that does not work.

--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

Brad Lanam

unread,
Jun 27, 2018, 8:17:43 AM6/27/18
to
On Wednesday, June 27, 2018 at 4:44:05 AM UTC-7, Cecil Westerhof wrote:
> At the moment I am using:
> ttk::notebook .nb
>
> But I would prefer to use:
> notebook .nb
>
> Is there a way to do this. I tried:
> namespace import ttk::notebook
>
> But that does not work.

May I ask why?

The ttk widgets will appear as native widgets (or native-ish) on windows
and Mac OS X. There are a couple of decent themes available for Linux
that look nice.

The answer is you just use notebook.
You would not need anything imported from ttk.

Rich

unread,
Jun 27, 2018, 8:40:54 AM6/27/18
to
Cecil Westerhof <Ce...@decebal.nl> wrote:
> At the moment I am using:
> ttk::notebook .nb
>
> But I would prefer to use:
> notebook .nb
>
> Is there a way to do this. I tried:
> namespace import ttk::notebook
>
> But that does not work.

It appears that the ttk:: namespace does not export the notebook
command.

In which case if you really want to use "notebook" as an alias for
ttk::notebook, then use the interp alias feature:

interp alias {} notebook {} ttk::notebook

Then the name "notebook" in the current interpreter will refer to
"ttk::notebook" instead.

Cecil Westerhof

unread,
Jun 27, 2018, 9:28:04 AM6/27/18
to
Brad Lanam <brad....@gmail.com> writes:

> On Wednesday, June 27, 2018 at 4:44:05 AM UTC-7, Cecil Westerhof wrote:
>> At the moment I am using:
>> ttk::notebook .nb
>>
>> But I would prefer to use:
>> notebook .nb
>>
>> Is there a way to do this. I tried:
>> namespace import ttk::notebook
>>
>> But that does not work.
>
> May I ask why?

Because I prefer to have notebook in my code instead of ttk::notebook.
But it is not very important.

Cecil Westerhof

unread,
Jun 27, 2018, 9:28:04 AM6/27/18
to
It is more a nice to have as that I really want it. For the moment I
will keep using ttk::notebook.

Thanks.

Mike Griffiths

unread,
Jun 27, 2018, 4:37:56 PM6/27/18
to
You could also just do the export yourself - as far as I know there should be no issues in doing so:

namespace eval ::ttk {namespace export notebook}
namespace import ::ttk::notebook
notebook .foo

Cecil Westerhof

unread,
Jun 27, 2018, 5:28:04 PM6/27/18
to
That works. Thanks.
0 new messages