Skip to content

Releases: hanjinliu/magic-class

v0.1.0

10 Sep 10:52
Compare
Choose a tag to compare

This is the first minor release. It's much easier to customize buttons and their actions.

New Features

  • Wrapper functions that can set attributes to push buttons itself.
    • @set_options can change parameter options of method arguments just like magicgui.
    • @click can set button properties related to clicking, or connect special behaviors to button click event, such as disabling or hiding buttons.
    • @button_design can change the design of push buttons. Currently support button size including min/max, font size, font family, text color, background color, icon and icon size.
  • __post_init__ method can be called after __init__.
    • This is useful when you want to append other widgets after all the methods are converted to buttons (If self.append is called inside __init__ then the widget will appear on the top of the main widget).
  • Custom widgets (Figure and Separator) are available in magicclass.widgets.
    • Figure is a matplotlib figure canvas widget. You can directly append it to Container widgets.
    • Separator is a simple separator.
  • You can suppress popup by the option @magicclass(popup=False).

Improvements

  • Methods are sorted in the same order as the order in the source code.
  • Each method remembers the last input and will be recalled on the next function call.
  • napari.Viewer was imported in a weird timing. Now it's fixed.

Bug fixes

  • Jupyter froze when GUI is build for the second time.
  • Could not add multiple dock widgets to napari.

v0.0.1

07 Sep 15:52
Compare
Choose a tag to compare

This is the first release of magic-class. Fundamental bugs are fixed so it seems to work anyway.