forked from kdeyev/SeisSpark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wiToolBar.py
39 lines (29 loc) · 1.22 KB
/
wiToolBar.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# -*- coding: utf-8 -*-
"""
Copyright 2016 Kostya Deyev
Licensed under the Apache License, Version 2.0 (the License);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
httpwww.apache.orglicensesLICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an AS IS BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
"""
Created on Wed Nov 16 20:49:12 2016
@author: kdeyev
"""
import remi.gui as gui
class ToolBar(gui.Widget):
def __init__(self, **kwargs):
super(ToolBar, self).__init__(**kwargs)
self.set_layout_orientation(gui.Widget.LAYOUT_HORIZONTAL)
self.style['background-color'] = 'white'
def add_command(self, imagePath, callback, title):
icon = gui.Image(imagePath, height='90%', margin='0px 1px')
icon.style['outline'] = '1px solid lightgray'
icon.set_on_click_listener(callback)
icon.attributes['title'] = title
self.append(icon)