Re: Tk::FunkyButton ?
Dean Arnold <[email protected]>
| Newsgroups | gmane.comp.lang.perl.tk |
|---|---|
| Message-ID | <[email protected]> |
Dean Arnold wrote: > Ala Qumsieh wrote: > > >> Also, I think it's overkill to create a complete >> Canvas widget just to implement a button. > > > Er, care to elaborate ? If I want to implement > non-rectangular (e.g., oval) buttons, I'm unaware of > any alternate method. Have I overlooked something ? > (Other than putting an oval image in the button, > and tolerating the "phantom" button bind area outside > the oval image) > Upon reflection I think I see what you mean (sorry for my density, I've been wrangling non-gui server apps for 6 months, and its adversely effected my synapses). To do "styled" buttons: 1. generate button image(s), using either static image files, or at runtime using <insert favorite graphics package here, e.g., GD> 2. Create borderless button widgets 3. Use a -command callback that explicitly reads the current mouse position and ignores the button press/release events unless its over the desired image area (or the button has keyboard focus) 4. (Optional) swap button images on press/release, and/or on Motion, FocusIn and FocusOut events, for a rollover effect Is that the gist of your statement ? - Dean -++**==--++**==--++**==--++**==--++**==--++**==--++**== This message was posted through the Stanford campus mailing list server. If you wish to unsubscribe from this mailing list, send the message body of "unsubscribe ptk" to [email protected]