Yes, the problem is in the width/heigh of the button, as well as
in its
alpha components...
What happens is that when you have complex Alpha, Tk has to ask X
to give
it the drawable image behind the pixmap to write in order to
blend it
correctly.. so it calls XGetImage...
problem is that we get a BadMatch error, from Xlib docs :
If the drawable is a pixmap, the given rectangle must be wholly
contained
within the pixmap, or a BadMatch error results.
This means that we have a pixmap and we request "give me the
image at this
rectangle's coordinates", specifying X, Y, width and height..
problem is that X and Y might be < 0 AND, the width and height
might be
bigger than the width/heigh of the background...
I think it's because the button code from Tk, when it's a
Tk_Width and
Tk_Height, returns the width and height of the parent window, so
we ask
for a huge width and height, (and negative X/Y) which gets
outside of the
border of the drawable background image.. so X returns a BadMatch
error in
order to say "hey, you're outside of the border"...
Now, the solution ...
HEY, Vivia said that it worked!!! wouhou, I fixed it :D
I'm going to commit it soon :)
let me clean the code and comment the fix, then I'll commit.
the solution was to call XGetGeometry, get the visible width and
heigh of
the drawable BEFORE calling the XGetImage, and make sure the x/y
are >= 0
and width/height are > 1 and < the real width/height returned by
XGetGeometry...
Thanks to all who helped.
KaKaRoTo
On Fri, 02 Dec 2005 19:45:15 -0500, Vivia Nikolaidou
<[EMAIL PROTECTED]> wrote:
>
>> Hmm...So you say that when you use the GREY FLAT button you
don't crash?
>> That's the ONLY thing you change?
>
> No, I also have to set its width to like 60 or something (yes
it IS
> huge)...
>
> The code below doesn't work either :(
>
>> Try that:
>> label $sendbutton -image [::skin::loadPixmap
>> butfont]\
>> -fg black -bg [::skin::getKey sendbuttonbg]
>> -bd 0 -relief flat \
>> -activebackground [::skin::getKey
>> sendbuttonbg] -activeforeground
>> black -text [trans send] \
>> -font sboldf -highlightthickness
0 -pady 0
>> -padx 0 -relief flat -compound center
>> bind $sendbutton <<Button1>>
"::amsn::MessageSend $w
>> $text"
>> This is VERY VERY VERY similar to a normal button in the
chatwindow,
>> same
>> picture, same command(label), don't tell me it crashed or I won't
>> beleive you.
>>
>>
>> Le 05-12-02 à 19:34, Vivia Nikolaidou a écrit :
>>
>> >
>> > That crashes too... :(
>> >
>> > It also crashes with the sheeny-deluxe skin (Awesome skin
though!!
>> > Congrats)
>> >
>> > On Fri, 2 Dec 2005, Jérôme Gagnon-Voyer wrote:
>> >
>> > > Ok try that instead
>> > >
>> > > label $sendbutton -image [::skin::loadPixmap
>> > > sendbutton] \
>> > > -fg black -bg [::skin::getKey sendbuttonbg]
>> > > -bd 0 -relief flat \
>> > > -activebackground [::skin::getKey
>> > > sendbuttonbg] -activeforeground
>> > > black -text [trans send] \
>> > > -font sboldf -highlightthickness 0
>> > > -pady 0
>> > > -padx 0 -relief flat -compound center
>> > > bind $sendbutton <<Button1>>
>> > > "::amsn::MessageSend $w
>> > > $text"
>> > > Thanks for your help
>> > >
>> > > Le 05-12-02 à 16:44, Vivia Nikolaidou a écrit :
>> > >
>> > > >
>> > > > > -Do you still crash if you change
>> > > > > : : skin::loadPixmap sendbutton
>> > > > > for
>> > > > > : : skin::loadPixmapsendbutton_hover
>> > > > > inside # New pixmap-skinnable button (For
Windows and
>> > > > > Unix >
>> > > > > Tcl/Tk 8.3)
>> > > >
>> > > > Yes, I still crash.
>> > > >
>> > > > > If YES:
>> > > > > Replace the sendbutton by:
>> > > > > button $sendbutton -image [::skin::loadPixmap
sendbutton] \
>> > > > > -command "::amsn::MessageSend $w $text"
>> > > > > \
>> > > >
>> > > > Still crashes :(
>> > > >
>> > > > > Do you have the problem with ALL skins? Including Default
>> > > > > skin.
>> > > >
>> > > > I haven't tried them ALL one by one, but I haven't found
any
>> > > > skins that
>> > > > don't crash. And, yes, default crashes.
>> > > >
>> > > > Thanx for your interest, and hope this was helpful...,
>> > > >
>> > > > Vivia
>> > > >
>> > > >
>> > > > -------------------------------------------------------
>> > > > This SF.net email is sponsored by: Splunk Inc. Do you grep
>> > > > through log
>> > > > files
>> > > > for problems? Stop! Download the new AJAX search
engine that
>> > > > makes
>> > > > searching your log files as easy as surfing the web.
DOWNLOAD
>> > > > SPLUNK!
>> > > > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
>> > > > _______________________________________________
>> > > > Amsn-devel mailing list
>> > > > Amsn-devel@lists.sourceforge.net
>> > > > https://lists.sourceforge.net/lists/listinfo/amsn-devel
>> > >
>> > >
>> > >
>> > > -------------------------------------------------------
>> > > This SF.net email is sponsored by: Splunk Inc. Do you grep
through
>> > > log files
>> > > for problems? Stop! Download the new AJAX search engine
that makes
>> > > searching your log files as easy as surfing the web.
DOWNLOAD
>> > > SPLUNK!
>> > > http://ads.osdn.com/?ad_idv37&alloc_id865&opÌk
>> > > _______________________________________________
>> > > Amsn-devel mailing list
>> > > Amsn-devel@lists.sourceforge.net
>> > > https://lists.sourceforge.net/lists/listinfo/amsn-devel
>> > >
>> > >
>> >
>> >
>> > ---
>> >
>> > "Where is the life that we have lost in living?
>> > Where is the wisdom that we have lost in knowledge?
>> > Where is the knowledge that we have lost in information?"
>> >
>> > OEO;
>>
>>
>>
>> -------------------------------------------------------
>> This SF.net email is sponsored by: Splunk Inc. Do you grep
through log
>> files
>> for problems? Stop! Download the new AJAX search engine that
makes
>> searching your log files as easy as surfing the web.
DOWNLOAD SPLUNK!
>> http://ads.osdn.com/?ad_idv37&alloc_id865&opÌk
>> _______________________________________________
>> Amsn-devel mailing list
>> Amsn-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/amsn-devel
>>
>>
>
>
> ---
>
> "Where is the life that we have lost in living?
> Where is the wisdom that we have lost in knowledge?
> Where is the knowledge that we have lost in information?"
>
> OEO;
--
KaKaRoTo
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep
through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD
SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Amsn-devel mailing list
Amsn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amsn-devel