Example of Updating Style Across Themes?
The group you are posting to is a
Usenet group . Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Newsgroups: comp.lang.tcl
From:
Jennifer Henderson <jensmaver... @gmail.com>
Date: Tue, 10 Apr 2012 09:23:19 -0700 (PDT)
Local: Tues, Apr 10 2012 12:23 pm
Subject: Example of Updating Style Across Themes?
Anyone have a quick example of how to define style changes for
different themes. We allow the user to change theme, so I would need
to update my style changes to TEntry for all the themes. We are
adding an selectable image in the entry field.
For xpnative I have:
ttk::style layout fileselector.TEntry {
Entry.field -sticky nswe -border 0 -children {
Entry.fileselector -side right -sticky ns
Entry.padding -expand 1 -sticky nswe -children {
Entry.textarea -sticky nswe
}
}
}
Thanks in advance,
Sue
You must
Sign in before you can post messages.
You do not have the permission required to post.
Newsgroups: comp.lang.tcl
From:
Harald Oehlmann <wortka... @yahoo.de>
Date: Wed, 11 Apr 2012 00:24:15 -0700 (PDT)
Local: Wed, Apr 11 2012 3:24 am
Subject: Re: Example of Updating Style Across Themes?
On 10 Apr., 18:23, Jennifer Henderson <jensmaver... @gmail.com> wrote:
> Anyone have a quick example of how to define style changes for
> different themes. We allow the user to change theme, so I would need
> to update my style changes to TEntry for all the themes. We are
> adding an selectable image in the entry field.
> For xpnative I have:
> ttk::style layout fileselector.TEntry {
> Entry.field -sticky nswe -border 0 -children {
> Entry.fileselector -side right -sticky ns
> Entry.padding -expand 1 -sticky nswe -children {
> Entry.textarea -sticky nswe
> }
> }
> }
> Thanks in advance,
> Sue
I suppose, you have to bind to the virtual event <<ThemeChanged>> and
reapply the private style.
I have no experience, but remembered Johanns talk on Tcl2010:
http://www.eurotcl.org/2010/Download/EuroTcl2010-Presentation-Bwidget...
-Harald
You must
Sign in before you can post messages.
You do not have the permission required to post.
Newsgroups: comp.lang.tcl
From:
Emiliano <emilianogavi... @gmail.com>
Date: Fri, 13 Apr 2012 15:45:38 -0700 (PDT)
Local: Fri, Apr 13 2012 6:45 pm
Subject: Re: Example of Updating Style Across Themes?
On 10 abr, 13:23, Jennifer Henderson <jensmaver... @gmail.com> wrote:
> Anyone have a quick example of how to define style changes for
> different themes. We allow the user to change theme, so I would need
> to update my style changes to TEntry for all the themes. We are
> adding an selectable image in the entry field.
> For xpnative I have:
> ttk::style layout fileselector.TEntry {
> Entry.field -sticky nswe -border 0 -children {
> Entry.fileselector -side right -sticky ns
> Entry.padding -expand 1 -sticky nswe -children {
> Entry.textarea -sticky nswe
> }
> }
> }
> Thanks in advance,
> Sue
You need to use [ttk::style theme settings $theme {# your setting
here}]
to install the desired layout on each theme.
To install a custom style/layout on each theme, I use
apply {{} {
foreach theme [themes] {
package require ttk::theme::$theme
style theme setting $theme {
style layout fileselector.TEntry {
# here comes the layout
}
}
}
} ::ttk}
[apply] is to avoid creating an (undesired) "theme" variable in
the current context.
Regards
Emiliano
You must
Sign in before you can post messages.
You do not have the permission required to post.
Newsgroups: comp.lang.tcl
From:
Sue <jenni... @altair.com>
Date: Fri, 4 May 2012 08:49:14 -0700 (PDT)
Local: Fri, May 4 2012 11:49 am
Subject: Re: Example of Updating Style Across Themes?
Emiliano,
Thank you for the suggestion. When I use the code above, I am now
seeing the style/layout being assigned to each theme when I query in
the console. But when I view my widget, it is not behaving as
expected. I am trying to put a folder image in the far right region
of the entry field. I see it on the xpnative theme, but no other
theme.
ttk::style element create fileselector image \
[list $launchimage {active pressed !disabled} \
$launchpressed {active !disabled} \
$launchactive ] \
-width 16 \
-sticky w
apply {{} {
foreach theme [ttk::themes] {
package require ttk::theme::$theme
ttk::style theme setting $theme {
ttk::style layout fileselector.TEntry {
Entry.field -sticky nswe -border 0 -children {
Entry.fileselector -side right -sticky ns
Entry.padding -expand 1 -sticky nswe -children {
Entry.textarea -sticky nswe
}
}
}
}
}
} ::ttk}
Thank you in advance
You must
Sign in before you can post messages.
You do not have the permission required to post.