dynamic menus

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

dynamic menus

marty moore-3
Hi all,
I'm trying to port my gtkmm-2 CAD program to gtkmm-3.
I'm trying to create a dynamic menu which a user can add new views to.
I've seen, run, and adapted the xml based menus in the tutorial, but they are static. I've been trying to research Gio::MenuModel, but there isn't any documentation.

Does anyone have an example of a dynamic menu in gtkmm-3? The method I used in gtkmm-2 has been eliminated/deprecated.

I'd really appreciate your help.
Thanks,
Marty

_______________________________________________
gtkmm-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list
Reply | Threaded
Open this post in threaded view
|

Re: dynamic menus

Christian Schoenebeck
On Sonntag, 26. November 2017 15:41:45 CET marty moore wrote:
> Hi all,

Hi, looking at your time stamp, a very late delivery of your email it seems.
;-) I guess your email was on the moderator's queue for some reason.

> I'm trying to port my gtkmm-2 CAD program to gtkmm-3.
> I'm trying to create a dynamic menu which a user can add new views to.
> I've seen, run, and adapted the xml based menus in the tutorial, but they
> are static. I've been trying to research Gio::MenuModel, but there isn't
> any documentation.

That's correct, and in fact this is from my perspective a big issue for
gtk(mm) 4, which I already criticised. I also provided a patch for gtk(3/4) to
address this:

        https://bugzilla.gnome.org/show_bug.cgi?id=791175

However as you can see the patch was declined for a non profound reason from
my perspective. Actually since with gtk(mm) 4 it will apparently no longer be
possible to manipulate the menu at runtime, which caused me to decide to stop
gtk(mm) support with version 3.22.x.

So far, our code base compiles from Gtk 2 up to including (git master head)
Gtk 4, but due to fundamental functionalities being removed from Gtk 4
(without any replacement that is), our apps would not work correctly with Gtk
4 anymore, and hence we will probably completely drop our experimental Gtk 4
code in future again, unless the responsible Gtk maintainers would accept
patches to address those fundamental issues, which I currently don't expect to
happen.

> Does anyone have an example of a dynamic menu in gtkmm-3? The method I used
> in gtkmm-2 has been eliminated/deprecated.

If you are using Gtk(mm) 3 then the solution is not using the Gio::MenuModel
API but still using the old Gtk::UIManager API. The latter API is deprecated
but is still available with Gtk 3 and there is really no replacement for its
functionality.

CU
Christian
_______________________________________________
gtkmm-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list
Reply | Threaded
Open this post in threaded view
|

Re: dynamic menus

aitor_czr
In reply to this post by marty moore-3

Hi again,

On 25/02/18 04:56, marty moore [hidden email] wrote:
Hi marty,

On 24/02/18 11:38, marty moore [hidden email] wrote:
Hi all,
I'm trying to port my gtkmm-2 CAD program to gtkmm-3.
I'm trying to create a dynamic menu which a user can add new views to.
I've seen, run, and adapted the xml based menus in the tutorial, but they
are static. I've been trying to research Gio::MenuModel, but there isn't
any documentation.

Does anyone have an example of a dynamic menu in gtkmm-3? The method I used
in gtkmm-2 has been eliminated/deprecated.

I'd really appreciate your help.
Thanks,
Marty
I'm working on a dynamic menu too, but it's in Gtk+ (i'm migrating it to 
gtkmm):

https://git.devuan.org/aitor_czr/popupmenu/tree/master/

Here you are a screenshot:

http://gnuinos.org/2018-01-30--1517320487_1600x900_scrot.png

and the instructions about how to build the *.deb packages:

https://forums.bunsenlabs.org/viewtopic.php?id=3730

Cheers :)

  Aitor.

Sorry for the subject.

Aitor.



_______________________________________________
gtkmm-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list
Reply | Threaded
Open this post in threaded view
|

Re: dynamic menus

aitor_czr
Hi marty,

On 25/02/18 07:45, aitor_czr wrote:

Hi marty,
On 24/02/18 11:38, marty moore [hidden email] wrote:
Hi all,
I'm trying to port my gtkmm-2 CAD program to gtkmm-3.
I'm trying to create a dynamic menu which a user can add new views to.
I've seen, run, and adapted the xml based menus in the tutorial, but they
are static. I've been trying to research Gio::MenuModel, but there isn't
any documentation.

Does anyone have an example of a dynamic menu in gtkmm-3? The method I used
in gtkmm-2 has been eliminated/deprecated.

I'd really appreciate your help.
Thanks,
Marty
I'm working on a dynamic menu too, but it's in Gtk+ (i'm migrating it to 
gtkmm):

https://git.devuan.org/aitor_czr/popupmenu/tree/master/

Here you are a screenshot:

http://gnuinos.org/2018-01-30--1517320487_1600x900_scrot.png

and the instructions about how to build the *.deb packages:

https://forums.bunsenlabs.org/viewtopic.php?id=3730

Cheers :)

  Aitor.

Sorry for the subject.

Aitor.

Devuan devs often pulled on my ears due to a wrong subject: Re: [DNG] [hidden email]... LOL
It was a glitch in the mailing list, but they fixed it.

Cheers,

Aitor.





_______________________________________________
gtkmm-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list
Reply | Threaded
Open this post in threaded view
|

Re: dynamic menus

aitor_czr
In reply to this post by marty moore-3

Hi again Marty,

On 24/02/18 11:38, marty moore [hidden email] wrote:

I'm trying to port my gtkmm-2 CAD program to gtkmm-3.

Where can i find this program, if it's available? It looks interesting.

Thanks in advance,

Aitor.




_______________________________________________
gtkmm-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list
Reply | Threaded
Open this post in threaded view
|

Re: dynamic menus

Kjell Ahlstedt-2
In reply to this post by Christian Schoenebeck
Den 2018-02-24 kl. 13:47, skrev Christian Schoenebeck:
On Sonntag, 26. November 2017 15:41:45 CET marty moore wrote:

I'm trying to port my gtkmm-2 CAD program to gtkmm-3.
I'm trying to create a dynamic menu which a user can add new views to.
I've seen, run, and adapted the xml based menus in the tutorial, but they
are static. I've been trying to research Gio::MenuModel, but there isn't
any documentation.
That's correct, and in fact this is from my perspective a big issue for 
gtk(mm) 4, which I already criticised. I also provided a patch for gtk(3/4) to 
address this:

	https://bugzilla.gnome.org/show_bug.cgi?id=791175

However as you can see the patch was declined for a non profound reason from 
my perspective. Actually since with gtk(mm) 4 it will apparently no longer be 
possible to manipulate the menu at runtime, which caused me to decide to stop 
gtk(mm) support with version 3.22.x.

So far, our code base compiles from Gtk 2 up to including (git master head) 
Gtk 4, but due to fundamental functionalities being removed from Gtk 4 
(without any replacement that is), our apps would not work correctly with Gtk 
4 anymore, and hence we will probably completely drop our experimental Gtk 4 
code in future again, unless the responsible Gtk maintainers would accept 
patches to address those fundamental issues, which I currently don't expect to 
happen.

Does anyone have an example of a dynamic menu in gtkmm-3? The method I used
in gtkmm-2 has been eliminated/deprecated.
If you are using Gtk(mm) 3 then the solution is not using the Gio::MenuModel 
API but still using the old Gtk::UIManager API. The latter API is deprecated 
but is still available with Gtk 3 and there is really no replacement for its 
functionality.

CU
Christian

One way to get references to the menu items is to build the menu with C++ code instead of an XML file, as is done in
https://git.gnome.org/browse/gtkmm-documentation/tree/examples/book/application/app_and_win_menus/exampleapplication.cc
Then you can keep a Glib::RefPtr<Gio::MenuItem> for each menu item that you want to modify. But I can understand if you dislike this idea.

Kjell

_______________________________________________
gtkmm-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list
Reply | Threaded
Open this post in threaded view
|

Re: dynamic menus

Christian Schoenebeck
On Dienstag, 27. Februar 2018 15:57:05 CET Kjell Ahlstedt wrote:
> One way to get references to the menu items is to build the menu with
> C++ code instead of an XML file, as is done in
> https://git.gnome.org/browse/gtkmm-documentation/tree/examples/book/applicat
> ion/app_and_win_menus/exampleapplication.cc Then you can keep a
> Glib::RefPtr<Gio::MenuItem> for each menu item that you want to modify. But
> I can understand if you dislike this idea.

Well, what does make more sense; forcing all application developers to rewrite
entire applications (again) just to address this particular, strange issue, or
to handle this on Gtk level by accepting the trivial patch already provided. I
mean look at gtkbuilder-menus.c, you can query a submenu by id, and even a
menu "section". So where is the point in drawing a line exactly here, that is
allowing to query all those and more by id, but to prohibit querying a menu
item by id? I mean a menu item is the most important thing an application
developer would want to query. So far Gtk maintainers did not provide a
rational reason for this.

CU
Christian
_______________________________________________
gtkmm-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtkmm-list