# \[tk\] Image and Text in TkButton?

**URL:** https://rubytalk.org/t/tk-image-and-text-in-tkbutton/22962
**Category:** ruby-talk
**Created:** [2 December 2005 22:52 UTC](https://rubytalk.org/t/tk-image-and-text-in-tkbutton/22962 "2005-12-02T22:52:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Forrest\_Chang](https://avatars.discourse-cdn.com/v4/letter/f/90ced4/32.png) [@Forrest\_Chang](https://rubytalk.org/u/Forrest_Chang)
#### Post date: [2 December 2005 22:52 UTC](https://rubytalk.org/t/tk-image-and-text-in-tkbutton/22962/1 "2005-12-02T22:52:31Z")

</div>

How do you put both an image an text into a button. It seems  
Compound Image that shows up in google isn't supported either as a  
class or option in ruby tk. Using 1 click installer of latest stable  
1.8 release.

Thanks

Forrest

---

<div class="post-metadata">

### Author: ![Hidetoshi\_NAGAI](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@Hidetoshi\_NAGAI](https://rubytalk.org/u/Hidetoshi_NAGAI)
#### Post date: [3 December 2005 07:19 UTC](https://rubytalk.org/t/tk-image-and-text-in-tkbutton/22962/2 "2005-12-03T07:19:17Z")

</div>

Message-ID: \<81vey7m7vv.fsf@yahoo.com\>

> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;How do you put both an image an text into a button. It seems  
> Compound Image that shows up in google isn't supported either as a  
> class or option in ruby tk. Using 1 click installer of latest stable  
> 1.8 release.

'compound' option is supported by Tcl/Tk8.4 or later.  
The version of Tcl/Tk libraries on one-click installer is 8.3.  
So, you have to install Tcl/Tk8.4 or 8.5 and replace tcltklib.dll  
which uses the libraries of Tcl/Tk8.4 or 8.5.  
Or, pack an image label and a text label on the button,  
and define event callbacks for both of the labels (e.g. change  
option values of the labels and send the event to the button).

> **···**
>
> From: Forrest Chang \<fkc\_email-news@yahoo.com\>  
> Subject: [tk] Image and Text in TkButton?  
> Date: Sat, 3 Dec 2005 07:52:31 +0900  
> --  
> Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
