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 <stdbool.h>
17
18#include <gtk/gtk.h>
19
20#define BUTTON_WITH_MENU_WIDGET_TYPE (button_with_menu_widget_get_type ())
21G_DECLARE_FINAL_TYPE (
22 ButtonWithMenuWidget,
23 button_with_menu_widget,
24 Z,
25 BUTTON_WITH_MENU_WIDGET,
26 GtkBox)
27
28
37typedef struct _ButtonWithMenuWidget
38{
39 GtkBox parent_instance;
40
41 GtkBox * button_box;
42
45 bool downard_arrow;
46
47 GtkMenuButton * menu_btn;
48
50 // GtkMenu * menu;
51} ButtonWithMenuWidget;
52
53void
54button_with_menu_widget_set_menu_model (
55 ButtonWithMenuWidget * self,
56 GMenuModel * gmenu_model);
57
61void
63 ButtonWithMenuWidget * self,
64 GtkPopover * popover);
65
76void
78 ButtonWithMenuWidget * self,
79 GtkButton * btn,
80 GMenuModel * gmenu_model,
81 bool downward_arrow,
82 int height,
83 const char * btn_tooltip_text,
84 const char * menu_tooltip_text);
85
86ButtonWithMenuWidget *
87button_with_menu_widget_new (void);
88
89static inline GtkMenuButton *
90button_with_menu_widget_get_menu_button (ButtonWithMenuWidget * self)
91{
92 return self->menu_btn;
93}
94
99#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.