├── debian ├── compat ├── rules ├── copyright ├── changelog └── control ├── spicegui ├── data │ ├── SpiceGUI.desktop │ ├── org.rafael1193.spicegui.gschema.xml │ ├── SpiceGUI.appdata.xml │ ├── menu.ui │ ├── spice-netlist.lang │ ├── preferences.glade │ ├── spicegui-symbolic.svg │ └── add_simulation_dialog.glade ├── config.py ├── __init__.py ├── running_dialog.py ├── console_gui.py ├── preferences_gui.py ├── application.py ├── add_simulation_gui.py ├── locale │ └── es │ │ └── LC_MESSAGES │ │ └── spicegui.po ├── ngspice_simulation.py └── gui.py ├── .gitignore ├── README.md ├── spicegui.spec ├── setup.py └── LICENSE /debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | 4 | export PYBUILD_NAME=spicegui 5 | 6 | %: 7 | dh $@ --with python2 --buildsystem=pybuild 8 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Files: * 2 | Copyright: 2014-2015, Rafael Bailón-Ruiz 3 | License: GPL-3+ 4 | 5 | License: GPL-3+ 6 | On Debian systems, the complete text of the GNU General Public License 3 7 | can be found in `/usr/share/common-licenses/GPL-3'. 8 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | spicegui (1.0) unstable; urgency=medium 2 | 3 | * New upstream release. 4 | 5 | -- Rafael Bailón-Ruiz Sat, 13 Jun 2015 20:21:33 +0200 6 | 7 | spicegui (0.3) unstable; urgency=medium 8 | 9 | * Initial release. (Closes: #1) 10 | 11 | -- Rafael Bailón-Ruiz Thu, 11 Jun 2015 00:11:28 +0200 12 | -------------------------------------------------------------------------------- /spicegui/data/SpiceGUI.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | Type=Application 4 | Name=SpiceGUI 5 | GenericName=Circuit Simulator 6 | GenericName[es]=Simulador de Circuitos 7 | Comment=Run circuit simulations and display the results 8 | Exec=spicegui %F 9 | Icon=spicegui 10 | Terminal=false 11 | Categories=Science;GTK;GNOME;Electricity;Electronics; 12 | Keywords=SPICE;ngspice; 13 | Name[es]=SpiceGUI 14 | MimeType=application/x-geda-schematic;application/x-pcb-netlist;text/plain; 15 | 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | bin/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | eggs/ 16 | lib/ 17 | lib64/ 18 | parts/ 19 | sdist/ 20 | var/ 21 | *.egg-info/ 22 | .installed.cfg 23 | *.egg 24 | 25 | # Installer logs 26 | pip-log.txt 27 | pip-delete-this-directory.txt 28 | 29 | # Unit test / coverage reports 30 | htmlcov/ 31 | .tox/ 32 | .coverage 33 | .cache 34 | nosetests.xml 35 | coverage.xml 36 | 37 | # Translations 38 | *.mo 39 | 40 | # Mr Developer 41 | .mr.developer.cfg 42 | .project 43 | .pydevproject 44 | 45 | # Rope 46 | .ropeproject 47 | 48 | # Django stuff: 49 | *.log 50 | *.pot 51 | 52 | # Sphinx documentation 53 | docs/_build/ 54 | 55 | # autotools 56 | Makefile 57 | Makefile.in 58 | aclocal.m4 59 | autom4te.cache/ 60 | config.log 61 | config.status 62 | configure 63 | install-sh 64 | missing 65 | *.gmo 66 | 67 | # junk 68 | *~ 69 | .csync_journal* 70 | .owncloudsync.log 71 | 72 | ejemplos/ 73 | 74 | .idea/ 75 | 76 | 77 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: spicegui 2 | Section: electronics 3 | Priority: optional 4 | Maintainer: Rafael Bailón-Ruiz 5 | Build-Depends: debhelper (>=9), 6 | python-all, 7 | dh-python, 8 | python-setuptools 9 | Standards-Version: 3.9.6 10 | 11 | Package: spicegui 12 | Architecture: all 13 | Homepage: http://rafael1193.github.io/spicegui 14 | XB-Python-Version: ${python:Versions} 15 | Depends: ${misc:Depends}, 16 | ${python:Depends}, 17 | python-matplotlib, 18 | gir1.2-gtk-3.0, 19 | gir1.2-glib-2.0, 20 | gir1.2-gtksource-3.0, 21 | gir1.2-pango-1.0, 22 | ngspice, geda-gnetlist, 23 | geda-gschem, 24 | python-gi-cairo 25 | Description: Graphical user interface for circuit simulation with ngspice 26 | SpiceGUI is a program that aims to make circuit simulation on GNU/Linux 27 | operating systems easier with a modern and easy to use graphical user 28 | interface. This program makes more straightforward the process from schematic 29 | edition to result analysis with a modern Gtk3 interface. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Join the chat at https://gitter.im/rafael1193/spicegui](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/rafael1193/spicegui?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 2 | 3 | SpiceGUI 4 | ======= 5 | 6 | **SpiceGUI** is a program that aims to make circuit simulation on GNU/Linux operating systems easier with a modern and easy to use graphical user interface. This program makes more straightforward the process from schematic edition to result analysis with a modern Gtk3 interface. 7 | 8 | Installation 9 | ------------ 10 | 11 | ### Ubuntu / Linux Mint / elementaryOS 12 | 13 | Add [ppa:rafael1193/spicegui](https://launchpad.net/~rafael1193/+archive/ubuntu/spicegui) repository. 14 | 15 | $ sudo add-apt-repository ppa:rafael1193/spicegui 16 | $ sudo apt-get update 17 | $ sudo apt-get install spicegui 18 | 19 | ### Fedora 20 | 21 | Add [rafael1193/SpiceGUI](http://copr.fedoraproject.org/coprs/rafael1193/SpiceGUI/) repository. 22 | 23 | $ sudo dnf copr enable rafael1193/SpiceGUI 24 | $ sudo dnf install spicegui 25 | 26 | ### Others 27 | 28 | Download release tarball and run 29 | 30 | $ python setup.py build 31 | $ sudo python setup.py install 32 | 33 | -------------------------------------------------------------------------------- /spicegui/data/org.rafael1193.spicegui.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | Show legend on plot 7 | Wether legend should be shown over plot 8 | 9 | 10 | "best" 11 | Legend position 12 | 13 | Set legend position on plot. 14 | Legal values are matplotlib.axes.Axes.legend() 'loc' parameter accepted values 15 | 16 | 17 | 18 | true 19 | Show grid on plot 20 | Wether axes grids should be shown over plot 21 | 22 | 23 | false 24 | Display line numbers 25 | 26 | 27 | 28 | true 29 | Highlight current line 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /spicegui/data/SpiceGUI.appdata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | SpiceGUI.desktop 5 | SpiceGUI 6 | Run circuit simulations and display the results 7 | Rafael Bailón-Ruiz 8 | 9 |

10 | SpiceGUI is a graphical user interface for ngspice circuit simulator. 11 |

12 |

13 | It aims to make easier circuit simulation on GNU/Linux and integrate well 14 | with the GNOME desktop. 15 |

16 |
17 | CC0-1.0 18 | GPL-3.0+ 19 | https://github.com/rafael1193/spicegui/issues 20 | https://github.com/rafael1193/spicegui/wiki 21 | https://github.com/rafael1193/spicegui 22 | 23 | 24 | Editor view 25 | https://cloud.githubusercontent.com/assets/436547/5596934/d94405de-9299-11e4-961b-e3e8d75476ee.png 26 | 27 | 28 | Simulation plot 29 | https://cloud.githubusercontent.com/assets/436547/5596935/dbbd7160-9299-11e4-837b-53fa54b42ecc.png 30 | 31 | 32 | rafaelbailon_at_ieee.org 33 |
34 | -------------------------------------------------------------------------------- /spicegui/config.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | """SpiceGUI constants and option functions.""" 5 | 6 | # SpiceGUI 7 | # Copyright (C) 2014-2015 Rafael Bailón-Ruiz 8 | # 9 | # This program is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, or 12 | # (at your option) any later version. 13 | # 14 | # This program is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with this program. If not, see . 21 | 22 | import os 23 | 24 | 25 | APPLICATION_ID = "org.rafael1193.spicegui" 26 | DOMAIN = "spicegui" 27 | GSETTINGS_BASE_KEY = "org.rafael1193.spicegui" 28 | HELP_URL = "https://github.com/rafael1193/spicegui/wiki" 29 | PROGRAM_NAME = "SpiceGUI" 30 | PROGRAM_NAME_LOWER = PROGRAM_NAME.lower() 31 | VERSION = "1.0" 32 | PROGRAM_WEBSITE = "https://rafael1193.github.io/spicegui/" 33 | 34 | 35 | def csd_are_supported(): 36 | sessionType = os.environ.get('XDG_CURRENT_DESKTOP') 37 | if sessionType == "GNOME" or sessionType == "LXDE": 38 | return True 39 | # Other desktop environments doesn't play well with csd for now 40 | else: 41 | return False 42 | 43 | -------------------------------------------------------------------------------- /spicegui/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | """SpiceGUI main script.""" 5 | 6 | # SpiceGUI 7 | # Copyright (C) 2014-2015 Rafael Bailón-Ruiz 8 | # 9 | # This program is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, or 12 | # (at your option) any later version. 13 | # 14 | # This program is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with this program. If not, see . 21 | 22 | from __future__ import print_function 23 | 24 | import os 25 | import os.path 26 | 27 | import config 28 | 29 | 30 | def get_locale_path(): 31 | """Get locale folder path. 32 | 33 | Returns: 34 | locale_path: Locale folder path. 35 | 36 | Raises: 37 | IOError: If locale path cannot be found. 38 | """ 39 | local = os.path.join(os.path.dirname(os.path.abspath(__file__)),"locale") 40 | 41 | if os.path.exists(local): 42 | return local 43 | else: 44 | raise IOError("Locale path not found.") 45 | 46 | def start(): 47 | """Starts SpiceGUI application.""" 48 | import gettext 49 | import locale 50 | 51 | domain = config.DOMAIN 52 | locale_path = get_locale_path() 53 | 54 | gettext.install(domain, locale_path) 55 | locale.textdomain(domain) 56 | locale.bindtextdomain(domain, locale_path) 57 | locale.textdomain(domain) 58 | locale.setlocale(locale.LC_ALL, '') 59 | 60 | import application 61 | import sys 62 | app = application.SpiceGUI() 63 | app.run(sys.argv) 64 | 65 | if __name__ == "__main__": 66 | start() 67 | -------------------------------------------------------------------------------- /spicegui/running_dialog.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # SpiceGUI 4 | # Copyright (C) 2014-2015 Rafael Bailón-Ruiz 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | 19 | from __future__ import print_function 20 | 21 | from gi.repository import Gtk, GObject 22 | 23 | 24 | class RunningDialog(Gtk.Dialog): 25 | 26 | def __init__(self, parent, event): 27 | if Gtk.check_version(3, 12, 0) is None: # Use header bar 28 | Gtk.Dialog.__init__(self, _("Simulation"), parent, 29 | Gtk.DialogFlags.MODAL | 30 | Gtk.DialogFlags.DESTROY_WITH_PARENT, 31 | (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL), 32 | use_header_bar=True) 33 | self.get_header_bar().set_show_close_button(False) 34 | else: # Do not use header bar 35 | Gtk.Dialog.__init__(self, _("Simulation"), parent, 36 | Gtk.DialogFlags.MODAL | 37 | Gtk.DialogFlags.DESTROY_WITH_PARENT, 38 | (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)) 39 | 40 | self.event = event 41 | 42 | self.set_default_size(150, 100) 43 | self.props.resizable = False 44 | self.set_default_response(Gtk.ResponseType.CANCEL) 45 | 46 | self.progress_bar = Gtk.ProgressBar() 47 | self.progress_bar.activity_mode = True 48 | self.progress_bar.pulse() 49 | self.progress_bar.set_text(_(u"Running ngspice…")) 50 | self.progress_bar.set_show_text(True) 51 | 52 | self.hbox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL) 53 | self.hbox.set_margin_left(18) 54 | self.hbox.set_margin_top(18) 55 | self.hbox.set_margin_bottom(18) 56 | self.hbox.set_margin_right(18) 57 | self.hbox.set_vexpand(True) 58 | self.hbox.set_spacing(12) 59 | 60 | self.hbox.pack_start(self.progress_bar, True, True, 18) 61 | 62 | box = self.get_content_area() 63 | box.add(self.hbox) 64 | 65 | self.timeout_id = GObject.timeout_add(50, self.on_timeout, None) 66 | 67 | self.show_all() 68 | 69 | def on_timeout(self, user_data): 70 | """ 71 | Update value in the progress bar. 72 | 73 | If simulation event is set, dialog emits response 1 74 | """ 75 | self.progress_bar.pulse() 76 | if self.event.is_set(): # if thread finished 77 | self.response(1) # 1 is an application-defined response type 78 | return True 79 | 80 | 81 | if __name__ == "__main__": 82 | from multiprocessing import Event 83 | event_test = Event() 84 | win = Gtk.Window() 85 | dialog = RunningDialog(win, event_test) 86 | dialog.run() 87 | dialog.destroy() 88 | win.destroy() 89 | 90 | 91 | -------------------------------------------------------------------------------- /spicegui.spec: -------------------------------------------------------------------------------- 1 | Name: spicegui 2 | Version: 1.0 3 | Release: 1%{dist} 4 | Summary: Run circuit simulations and display the results 5 | 6 | License: GPLv3 7 | URL: http://github.com/rafael1193/spicegui 8 | Source0: %{name}-%{version}.tar.gz 9 | 10 | BuildRequires: desktop-file-utils 11 | BuildRequires: python3-setuptools 12 | BuildRequires: gettext 13 | Requires: python3 14 | Requires: python3-gobject 15 | Requires: python3-matplotlib 16 | Requires: python3-matplotlib-gtk3 17 | Requires: gtk3 18 | Requires: glib2 19 | Requires: gtksourceview3 20 | Requires: pango 21 | Requires: ngspice 22 | Requires: geda-gnetlist 23 | Requires: geda-gschem 24 | Requires: gettext 25 | 26 | BuildArch: noarch 27 | 28 | 29 | %description 30 | SpiceGUI is a graphical user interface for ngspice circuit simulator. It aims 31 | to make easier circuit simulation on GNU/Linux and integrate well with the GNOME 32 | desktop. 33 | 34 | %prep 35 | %setup -q%{!?rel_build:n %{name}-%{version}} 36 | 37 | 38 | %build 39 | %{__python} setup.py build 40 | 41 | 42 | %install 43 | %{__python} setup.py install -O1 --skip-build --root %{buildroot} --record=INSTALLED_FILES 44 | 45 | if [ -e %{buildroot}/usr/share/glib-2.0/schemas/gschemas.compiled ] ; then 46 | rm %{buildroot}/usr/share/glib-2.0/schemas/gschemas.compiled 47 | fi 48 | 49 | %find_lang %{name} --all-name 50 | 51 | for file in $RPM_BUILD_ROOT%{python_sitelib}/%{name}/{config,__init__}.py; do 52 | chmod a+x $file 53 | done 54 | 55 | %check 56 | %{__python} setup.py test 57 | desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/SpiceGUI.desktop 58 | 59 | 60 | %postun 61 | if [ $1 -eq 0 ] ; then 62 | /bin/touch --no-create %{_datadir}/icons/hicolor/ &>/dev/null 63 | /usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor/ &>/dev/null || : 64 | fi 65 | /usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &>/dev/null || : 66 | 67 | 68 | %posttrans 69 | /usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor &>/dev/null || : 70 | /usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas &>/dev/null || : 71 | 72 | %files -f INSTALLED_FILES -f %{name}.lang 73 | %defattr(-,root,root) 74 | 75 | 76 | %changelog 77 | * Sat Jun 13 2015 Rafael Bailón-Ruiz - 1.0-1 78 | - Update to 1.0 79 | 80 | * Sat Jun 06 2015 Rafael Bailón-Ruiz - 0.3-4 81 | - Fix rpmlint warnings 82 | 83 | * Sat Jun 06 2015 Rafael Bailón-Ruiz - 0.3-3 84 | - Remove python2-devel build requirement 85 | - Implement snapshot builds 86 | 87 | * Sun Dec 21 2014 Rafael Bailón-Ruiz - 0.3-2 88 | - Add gettext dependency 89 | 90 | * Sun Dec 21 2014 Rafael Bailón-Ruiz - 0.3-1 91 | - Update to 0.3 92 | 93 | * Thu Nov 13 2014 Rafael Bailón-Ruiz - 0.2-4 94 | - Include appdata file 95 | 96 | * Thu Nov 13 2014 Rafael Bailón-Ruiz - 0.2-3 97 | - Revert Source0 98 | 99 | * Wed Nov 12 2014 Rafael Bailón-Ruiz - 0.2-2 100 | - Update Source0 101 | 102 | * Wed Nov 12 2014 Rafael Bailón-Ruiz - 0.2-1 103 | - New SpiceGUI release 104 | 105 | * Wed Nov 12 2014 Rafael Bailón-Ruiz - 0.1-3 106 | - Add geda-gschem dependency 107 | 108 | * Tue Oct 28 2014 Rafael Bailón-Ruiz - 0.1-2 109 | - Add gtk-update-icon-cache fix glib-compile-schemas 110 | 111 | * Mon Oct 27 2014 Rafael Bailón-Ruiz - 0.1-1 112 | - Update build system 113 | 114 | * Wed Sep 03 2014 Rafael Bailón-Ruiz - 0.1-0 115 | - Initial package 116 | -------------------------------------------------------------------------------- /spicegui/console_gui.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # SpiceGUI 4 | # Copyright (C) 2014-2015 Rafael Bailón-Ruiz 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | 19 | from __future__ import print_function 20 | 21 | from gi.repository import Gtk, Pango 22 | 23 | 24 | class ConsoleOutputWindow(Gtk.Window): 25 | """Window for showing monospaced raw content""" 26 | 27 | def __init__(self, title=None): 28 | """Inits ConsoleOutputWindow with title. 29 | 30 | Args: 31 | title: Desired window title string. 32 | """ 33 | Gtk.Window.__init__(self) 34 | self.set_default_size(640, 480) 35 | 36 | # headerbar 37 | self.hb = Gtk.HeaderBar() 38 | self.hb.props.show_close_button = True 39 | if title is not None: 40 | self.hb.set_title(title) 41 | self.set_titlebar(self.hb) 42 | 43 | # Content 44 | self.scrolled = Gtk.ScrolledWindow() 45 | self.text_view = Gtk.TextView(buffer=Gtk.TextBuffer()) 46 | 47 | font_desc = Pango.FontDescription('monospace') 48 | if font_desc: 49 | self.text_view.modify_font(font_desc) 50 | self.text_view.set_editable(False) 51 | 52 | self.scrolled.add(self.text_view) 53 | self.add(self.scrolled) 54 | 55 | # Connect signals 56 | self.connect('delete-event', self.on_delete_event) 57 | self.connect_after('destroy', self.on_window_destroy) 58 | 59 | def insert_text(self, text): 60 | """Appends text to TextView buffer 61 | 62 | Args: 63 | text: str to be appended.""" 64 | self.text_view.props.buffer.insert_at_cursor(text) 65 | 66 | def clear_buffer(self): 67 | """Clears TextView buffer""" 68 | start_iter = self.text_view.props.buffer.get_start_iter() 69 | end_iter = self.text_view.props.buffer.get_end_iter() 70 | self.text_view.props.buffer.delete(start_iter, end_iter) 71 | 72 | def set_title(self, text): 73 | """Sets window title 74 | 75 | Args: 76 | title: Desired window title string.""" 77 | self.hb.set_title(text) 78 | 79 | def set_subtitle(self, text): 80 | """Sets window subtitle 81 | 82 | Args: 83 | subtitle: Desired window subtitle string.""" 84 | self.hb.set_subtitle(text) 85 | 86 | def on_delete_event(self, widget, data): 87 | """Hides window. 88 | 89 | Delete-event signal handler. 90 | 91 | Args: 92 | widget: Caller widget. 93 | data: User-defined data. 94 | """ 95 | return self.hide_on_delete() 96 | 97 | def on_window_destroy(self, widget, data=None): 98 | """Destroys window. 99 | 100 | Destroy signal handler. 101 | 102 | Args: 103 | widget: Caller widget. 104 | data: User-defined data. 105 | """ 106 | self.destroy() 107 | 108 | if __name__ == "__main__": 109 | window = ConsoleOutputWindow() 110 | window.set_title("Title") 111 | window.set_subtitle("Subtitle") 112 | window.show_all() 113 | window.insert_text("test\n Test\tTEST") 114 | window.clear_buffer() 115 | Gtk.main() 116 | -------------------------------------------------------------------------------- /spicegui/data/menu.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | _New window 8 | app.new 9 | <Primary>n 10 | 11 |
12 |
13 | 14 | _Preferences 15 | app.preferences 16 | 17 |
18 |
19 | 20 | _Help 21 | app.help 22 | 23 | 24 | _About 25 | app.about 26 | 27 | 28 | _Quit 29 | app.quit 30 | <Primary>q 31 | 32 |
33 |
34 | 35 |
36 | 37 | _Save 38 | win.save 39 | <Primary>S 40 | 41 |
42 |
43 | 44 | _Close 45 | win.close 46 | 47 |
48 |
49 | 50 |
51 | 52 | _Save plot 53 | win.save-plot 54 | 55 | 56 | Save _data 57 | win.save-data 58 | 59 |
60 |
61 | 62 | Simulation _output 63 | win.simulation-output 64 | 65 |
66 | 74 |
75 | 76 | _Close 77 | win.close 78 | 79 |
80 |
81 | 82 |
83 | 84 | Simulation 85 | win.insert-simulation 86 | 87 |
88 |
89 | 90 | ._print 91 | win.insert-print 92 | 93 |
94 |
95 | 96 | ._model 97 | win.insert-model 98 | 99 | 100 | ._lib 101 | win.insert-lib 102 | 103 | 104 | ._include 105 | win.insert-include 106 | 107 |
108 |
109 |
110 | -------------------------------------------------------------------------------- /spicegui/data/spice-netlist.lang: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | text/x-spice-netlist 5 | *.net;*.cir;*.lib;*.subckt;*.mod;*.model 6 | 7 | 8 |