diff --git a/images/menu button/menu_button.xcf b/images/menu button/menu_button.xcf new file mode 100644 index 0000000..a00cbce Binary files /dev/null and b/images/menu button/menu_button.xcf differ diff --git a/images/menu_button.png b/images/menu_button.png new file mode 100644 index 0000000..520d3ed Binary files /dev/null and b/images/menu_button.png differ diff --git a/main.kv b/main.kv index 086d400..54e943c 100644 --- a/main.kv +++ b/main.kv @@ -104,6 +104,11 @@ id: 'top_menu' pos_hint: {'top':1} orientation: 'horizontal' + MainMenuButton: + id: main_menu_button + size_hint_x: 0.2 + source: "./images/menu_button.png" + on_press: root.main_menu() MyLabel: id: current_temperature text: "Current Temperature: n/a" diff --git a/main.py b/main.py index a62656b..c000335 100755 --- a/main.py +++ b/main.py @@ -13,6 +13,7 @@ import kivy.graphics.texture from kivy.graphics.texture import Texture from kivy.logger import Logger from kivy.properties import BooleanProperty, DictProperty, ListProperty, NumericProperty, ObjectProperty, StringProperty +import kivy.uix.behaviors from kivy.uix.boxlayout import BoxLayout from kivy.uix.button import Button from kivy.uix.dropdown import DropDown @@ -197,6 +198,10 @@ class MainWindow(FloatLayout): self.create_popup(title="Choose outputfile", content = output_file_dialog) + def main_menu(self): + Logger.debug('Main menu pressed') + + def set_output_file(self, path, file_name, *args, **kwargs): #Logger.debug('Setouput file: ', str((path, file_name, args, kwargs))) # If we're oaky with writing path + file_name + (.csv|.png) @@ -548,6 +553,8 @@ class YesNoModalView(Popup): self.process_callback(result, *args, **kwargs) self.dismiss() +class MainMenuButton(kivy.uix.behaviors.ButtonBehavior, Image): + pass class StatusBar(BoxLayout):