Re: Can I get best practice of writing to menubar in modern gtk3?



Hello.

I try writing menuber example in gtk3.
Use  2. gtk_menu_item + gtk_accel_group.
In exist “Mnemonics” (ex. "(F)ile > (Q)uit") and “Accelerators”(ex. "Ctrl+A")
http://blog.michinari-nukazawa.com/2015/12/gtk3-menubar-example.html

Is this code anything wrong?
(I need is method "1" like coding sample...)

Thanks.

On 2015年12月05日 21:41, michinari.nukazawa wrote:
I try append menu on gtk3 application.
I understood that there were two methods.

1. gtk_ui_manager + gtk_action_group
2. gtk_menu_item + gtk_accel_group

method "1" is easy maintenances.
 menuitem propertys + tree hierarch from variables.
method "2" is easy append new menuitem during application active running.
 menuitem hierarch in code of full hard coding. (need self wrapping?)

(1. ex.
https://developer.gnome.org/gtk3/stable/GtkUIManager.html
https://developer.gnome.org/gtk3/stable/GtkActionGroup.html
http://uchigo.main.jp/gtk3/chap07/chap07.html
http://yanchde.gozaru.jp/gtk/gtk_examples/gtk_ui_manager_example_c/gtk_ui_manager_example_c.html
)
(2. ex.
https://developer.gnome.org/gtk3/stable/GtkMenuItem.html
https://developer.gnome.org/gtk3/stable/gtk3-Keyboard-Accelerators.html
 gtm3-demo/menus
https://developer.gnome.org/gtk3/stable/gtk3-demo.html
)

However,Iwanttowrite like a method "1".
(Menu setting is in variables.)

Q1. method "2" is modern gtk3?
Q2. Can I get the real application which use menu for modern gtk3?
Q3. Can I get other way?
Q4. Why does gtk3-demo not have a Mnemonics (ex. "(F)ile > (Q)uit") and Accelerators (ex. "Ctrl+Q") ? ( Do Gtk3 developers think the MenuItem to be wind-bell or something which hung from the edge of the eaves? not a method to call a function? )



--
==========
Michinari.Nukazawa

in the project "daisy bell"
https://daisy-bell.booth.pm/
==========


--
==========
Michinari.Nukazawa

in the project "daisy bell"
https://daisy-bell.booth.pm/
==========



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]