Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
button_with_menu.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: © 2020-2021 Alexandros Theodotou <alex@zrythm.org>
3 *
4 * SPDX-License-Identifier: LicenseRef-ZrythmLicense
5 */
6
13#ifndef __GUI_WIDGETS_BUTTON_WITH_MENU_H__
14#define __GUI_WIDGETS_BUTTON_WITH_MENU_H__
15
16#include "gtk_wrapper.h"
17
18#define BUTTON_WITH_MENU_WIDGET_TYPE (button_with_menu_widget_get_type ())
19G_DECLARE_FINAL_TYPE (
20 ButtonWithMenuWidget,
21 button_with_menu_widget,
22 Z,
23 BUTTON_WITH_MENU_WIDGET,
24 GtkBox)
25
26
35typedef struct _ButtonWithMenuWidget
36{
37 GtkBox parent_instance;
38
39 GtkBox * button_box;
40
43 bool downard_arrow;
44
45 GtkMenuButton * menu_btn;
46
48 // GtkMenu * menu;
49} ButtonWithMenuWidget;
50
51void
52button_with_menu_widget_set_menu_model (
53 ButtonWithMenuWidget * self,
54 GMenuModel * gmenu_model);
55
59void
61 ButtonWithMenuWidget * self,
62 GtkPopover * popover);
63
74void
76 ButtonWithMenuWidget * self,
77 GtkButton * btn,
78 GMenuModel * gmenu_model,
79 bool downward_arrow,
80 int height,
81 const char * btn_tooltip_text,
82 const char * menu_tooltip_text);
83
84ButtonWithMenuWidget *
85button_with_menu_widget_new (void);
86
87static inline GtkMenuButton *
88button_with_menu_widget_get_menu_button (ButtonWithMenuWidget * self)
89{
90 return self->menu_btn;
91}
92
97#endif
void button_with_menu_widget_setup(ButtonWithMenuWidget *self, GtkButton *btn, GMenuModel *gmenu_model, bool downward_arrow, int height, const char *btn_tooltip_text, const char *menu_tooltip_text)
This must only be called once to set up the widget.
void button_with_menu_widget_set_popover(ButtonWithMenuWidget *self, GtkPopover *popover)
Set a custom popover instead of a menu model.