kmcos / kmcos

Kinetic Monte Carlo of Systems (KMCOS): lattice based kinetic Monte Carlo with a python front-end and Fortran back-end.
https://github.com/kmcos/kmcos
GNU General Public License v3.0
16 stars 17 forks source link

model.view() Slider Bars Not Working #133

Open meelod opened 2 years ago

meelod commented 2 years ago

Expected behavior

In model.view(), the various slider bars should allow the user to adjust the model parameter at runtime

Actual behavior

The slider functionality in model.view() does not work as intended. The slider window opens, but the sliders are locked in place.

Steps to reproduce the issue

  1. Enter ipython inside one of the local_smart directories in kmcos (MyFirstDiffusion_local_smart for example)
  2. Enter 'model.view()' in the ipython terminal
  3. Viewer GUI shows up and shows the slider window locked in place

System information

Ubuntu 18.04.6 LTS

The ParamSlider Class is not working as intended (can be found in kmcos/view.py). class ParamSlider(gtk.HScale):

AdityaSavara commented 2 years ago

The relevant code is in here: https://github.com/kmcos/kmcos/blob/master/kmcos/view.py

It looks like one of these lines should change: gtk.HScale.init(adjustment)

or maybe in this function: def value_changed(self, _widget):

The documentation for the external dependency seems to be here: https://docs.gtk.org/gtk3/class.HScale.html https://athenajc.gitbooks.io/python-gtk-3-api/content/gtk-group/gtkscale.html

I have a guess. Currently, we have this line: class ParamSlider(gtk.HScale): That uses class inheritance.

Maybe we cannot use python class inheritance anymore. Even if we can, maybe we cannot use that syntax.

Simple things to try:

  1. Try to make ParamSlider inherit gtk.Scale rather than Hscale, because the below link uses a "Scale"object in the example: https://athenajc.gitbooks.io/python-gtk-3-api/content/gtk-group/gtkscale.html In the example, that code then uses Gtk.Orientation.HORIZONTAL to specify horizontal.