AGW Logo

agw_title aquabutton

AquaButton is another custom-drawn button class which approximatively mimics the behaviour of Aqua buttons on the Mac.


description Description

AquaButton is another custom-drawn button class which approximatively mimics the behaviour of Aqua buttons on the Mac. At the moment this class supports:

  • Bubble and shadow effects;
  • Customizable background, foreground and hover colours;
  • Rounded-corners buttons;
  • Text-only or image+text buttons;
  • Pulse effect on gaining focus.

And a lot more. Check the demo for an almost complete review of the functionalities.


usage Usage

Sample usage:

import wx
import wx.lib.agw.aquabutton as AB

app = wx.App(0)

frame = wx.Frame(None, -1, "AquaButton Test")

mainPanel = wx.Panel(frame)
mainPanel.SetBackgroundColour(wx.WHITE)

# Initialize AquaButton 1 (with image)
bitmap = wx.Bitmap("my_button_bitmap.png", wx.BITMAP_TYPE_PNG)
btn1 = AB.AquaButton(mainPanel, -1, bitmap, "AquaButton")

# Initialize AquaButton 2 (no image)
btn2 = AB.AquaButton(mainPanel, -1, None, "Hello World!")

frame.Show()

app.MainLoop()

This code snippet can be downloaded, see this example script.

Note

Some of the AGW snippets of code in the documentation use images and external files (to create bitmaps or access external data). As these files are not provided in these snippets, you should make the approriate modifications to the code to actually run it.


platforms Supported Platforms

AquaButton has been tested on the following platforms:
  • Windows (Windows XP);
  • Linux Ubuntu (10.10).

styles Window Styles

No particular window styles are available for this class.


events Events Processing

This class processes the following events:


Events processing for aquabutton
Event Name Description
wx.EVT_BUTTON Process a wx.wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.

license License And Version

AquaButton control is distributed under the wxPython license.

Latest Revision: Andrea Gavana @ 22 Nov 2011, 22.00 GMT

Version 0.4

Module author: Andrea Gavana <andrea.gavana@gmail.com>


hierarchy Inheritance Diagram

Inheritance diagram for module: aquabutton

Inheritance diagram of aquabutton.AquaButton, aquabutton.AquaButtonEvent, aquabutton.AquaToggleButton, aquabutton.__ToggleMixin


svn_main SVN Revisions

A graphical representation of the SVN commits in the last year.

Click on any date in the picture to jump to that particular revision page, containing information about committers, log messages and SVN diffs.

aquabutton

Revision Graph For aquabutton


2to3 Python 3 Issues (via 2to3)

No issues have been detected by 2to3.py.