Menu

#55 add function to tkCanvas.c to export Tk_GetCanvasBackground

open
5
2003-11-13
2000-11-01
No

OriginalBugID: 566 RFE
Version: 8.1a2
SubmitDate: '1998-04-15'
LastModified: '1998-04-15'
Severity: LOW
Status: UnAssn
Submitter: hershey
ChangedBy: hershey
OS: All
OSVersion: NA
Machine: NA
FixedInVersion: NA

>Date: Sun, 1 Feb 1998 11:42:41 -0800 (PST)
>From: "Munagala V. S. Ramanath" <ram@netcom.com>
>To: ouster@best.com
>Subject: Tk8.1 request
>X-Mozilla-Status: 8003
>
>Hi,
>
>Had a couple of requests for 8.1:
>
>1. Could you add the following function to tkCanvas.c and export the
> declaration in tk.h:
>------------------------------------------------------------------------
>XColor *Tk_GetCanvasBackground( Tk_Canvas canvas )
>{
> return ((TkBorder *)(((TkCanvas *)canvas)->bgBorder))->bgColorPtr ;
>}
>------------------------------------------------------------------------
> I am implementing a new canvas item and need the RGB values of the
> canvas background to do anti-aliasing but saw no easy and portable
> way to get it using the currently exported interface. For example,
> I can get the actual background pixel with:
> Tk_Attributes(tkwin)->background_pixel
> but mapping this back to an XColor needs XQueryColor which is
> missing from the X emulation. Tk_ConfigureInfo is not usable since
> configSpecs[] is private to tkCanvas.c. Another way is to get the
> _name_ of the background color with a Tcl_Eval on something like
> "lindex [%s configure -bg] end"
> where the %s is replaced by the output of Tk_PathName( tkwin ) and
> then use Tk_GetColor to retrieve the XColor from the name which is
> very tortured and inefficient.
>
2. Is there any reason TkPutImage() cannot be exported ? I'd like to
> use this call to display images in a portable way.
>
>Thanks.
>
>Ram

Discussion

  • Don Porter

    Don Porter - 2001-03-23
    • labels: 104332 -->
    • milestone: 102490 -->
     
  • Don Porter

    Don Porter - 2001-03-23
    • labels: --> 04. Canvas Basics
     
  • Don Porter

    Don Porter - 2003-11-13
    • assigned_to: nobody --> hobbs
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.