For Programmers: Free Programming Magazines  


Home > Archive > Tcl > July 2007 > Gradients in frames?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Gradients in frames?
Kevin Walzer

2007-07-09, 10:09 pm

I'm interest in jazzing up the appearance of my apps by putting a
gradient background in the toolbar. This is something that Mac apps do
natively (the "unified" look) and is also done by such apps as Thunderbird.

I've found various ways of drawing gradients on the screen. The
paved_widgets package (see http://wiki.tcl.tk/13415) does some of what I
want, but I haven't found a way to cleanly pack labels or buttons inside
the "paved" frame that gives the appearance I want. I'd like the labels
and buttons to lay transparently on top of the gradient background, but
there doesn't seem to be a way to make the outline match the gradient.

I've also found various canvas demos at the wiki for drawing gradients,
but the same problem arises with the outline on the label or button.

Has anyone tried this and gotten it to work cleanly?

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
Jeff Hobbs

2007-07-09, 10:09 pm

Kevin Walzer wrote:
> I'm interest in jazzing up the appearance of my apps by putting a
> gradient background in the toolbar. This is something that Mac apps do
> natively (the "unified" look) and is also done by such apps as Thunderbird.
>
> I've found various ways of drawing gradients on the screen. The
> paved_widgets package (see http://wiki.tcl.tk/13415) does some of what I
> want, but I haven't found a way to cleanly pack labels or buttons inside
> the "paved" frame that gives the appearance I want. I'd like the labels
> and buttons to lay transparently on top of the gradient background, but
> there doesn't seem to be a way to make the outline match the gradient.
>
> I've also found various canvas demos at the wiki for drawing gradients,
> but the same problem arises with the outline on the label or button.
>
> Has anyone tried this and gotten it to work cleanly?


Any "native" drawing will require native code tie-in. If you are
interested about doing this on OS X, ask on the mac mailing list. I
believe that this is being investigated for support in the standard
-background element.

Jeff
Roy Terry

2007-07-09, 10:09 pm

Kevin Walzer wrote:
> I'm interest in jazzing up the appearance of my apps by putting a
> gradient background in the toolbar. This is something that Mac apps do
> natively (the "unified" look) and is also done by such apps as Thunderbird.
>
> I've found various ways of drawing gradients on the screen. The
> paved_widgets package (see http://wiki.tcl.tk/13415) does some of what I
> want, but I haven't found a way to cleanly pack labels or buttons inside
> the "paved" frame that gives the appearance I want. I'd like the labels
> and buttons to lay transparently on top of the gradient background, but
> there doesn't seem to be a way to make the outline match the gradient.

Don't know of any package that matches gradients across widgets for Tk.
If you want to work on you own I heartily suggest the tkpath extension:

http://tclbitprint.sourceforge.net/...airo/index.html
http://wiki.tcl.tk/14545

tkpath provides named gradients with fair adjustibility across most
recent platforms.

R

>
> I've also found various canvas demos at the wiki for drawing gradients,
> but the same problem arises with the outline on the label or button.
>
> Has anyone tried this and gotten it to work cleanly?
>

keithv

2007-07-09, 10:09 pm

> If you want to work on you own I
> heartily suggest the tkpath extension:
> http://tclbitprint.sourceforge.net/...ki.tcl.tk/14545


Looks interesting.

Are there any binaries for windows available? I found some
links at http://tclbitprint.sourceforge.net/ but they
all come up with page not found (surprisingly so since
they link back to sourceforge).

Thanks,
Keith

Roy Terry

2007-07-10, 4:21 am

keithv wrote:
>
> Looks interesting.
>
> Are there any binaries for windows available? I found some
> links at http://tclbitprint.sourceforge.net/ but they
> all come up with page not found (surprisingly so since
> they link back to sourceforge).

Sourceforge seems to be having rather a rather
odd outage. Yes Windows Binaries are available.
All you need is a single .dll and a single Tcl library
for a few convenience procs. When sourceforge comes
back you can get these files from the cvs directly.
Ask Mats or post back here with any issues.
>
> Thanks,
> Keith
>

koloska

2007-07-11, 7:10 pm

On 9 Jul., 23:55, Kevin Walzer <k...@codebykevin.com> wrote:
> I'd like the labels and buttons to lay transparently on top of the
> gradient background, but there doesn't seem to be a way to make the
> outline match the gradient.


Maybe the transparent color Daniel Steffen has unveiled in the newest
iteration of TclAqua can help you here.

Search for the mail title "Numerous TkAqua changes committed, need
testing" by him. For your convenience here is the relevant part:

> - all appearance colors/brushes available as system colors, as
> well as the fully transparent "color" 'systemTransparent': see
> colors.n and screenshots at:
> http://rutherglen.ics.mq.edu.au/~steffen/tcltk/sysCols/
> (note highlight color was purple for aqua theme and green for
> graphite theme)
> This allows use of windows with pinstripe backgrounds etc. from
> pure Tk


Uwe Koloska

Kevin Walzer

2007-07-11, 7:10 pm

koloska wrote:
> On 9 Jul., 23:55, Kevin Walzer <k...@codebykevin.com> wrote:
>
> Maybe the transparent color Daniel Steffen has unveiled in the newest
> iteration of TclAqua can help you here.
>
> Search for the mail title "Numerous TkAqua changes committed, need
> testing" by him. For your convenience here is the relevant part:
>
>
> Uwe Koloska
>


I've tried this, but for various reasons it doesn't seem to work in the
manner I want.

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
CV

2007-07-25, 7:12 pm

keithv wrote:
>
>
> Looks interesting.
>
> Are there any binaries for windows available? I found some
> links at http://tclbitprint.sourceforge.net/ but they
> all come up with page not found (surprisingly so since
> they link back to sourceforge).
>
> Thanks,
> Keith
>

testing (sorry)
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com