Yes, actions get a prefix depending on where you put them. Every "action
container" has a prefix. In your case you add_action() to
GtkApplicationWindow and its prefix is "win"
I used your code to create an answer to my StackOverflow question
> https://stackoverflow.com/a/50051155/4865723
>
On Thu, Apr 26, 2018 at 09:46:57PM +0200, c.bu...@posteo.jp wrote:
> Thank you very much. Your example works for me but I don't understand
> why. ;)
>
> > win.bar
>
> > action_bar = Gio.SimpleAction.new('bar', None)
>
> The name of the action in the XML and the code is
On 2018-04-26 18:10 Luca Bacci wrote:
> Hi, I did test it out, here's a working version:
I used your code to create an answer to my StackOverflow question
https://stackoverflow.com/a/50051155/4865723
___
gtk-app-devel-list
Thank you very much. Your example works for me but I don't understand
why. ;)
> win.bar
> action_bar = Gio.SimpleAction.new('bar', None)
The name of the action in the XML and the code is different. Why? What
is the system behind it?
"1. It uses "QMenu" (from Gtk or Gio?) to build a menu structure. I would
prefere this way instead of an XML string. It should be possible
in Python, too? Gtk.Menu or Gio.Menu?"
My understanding of this is that the GMenu is used with the GtkApplication and
a GtkMenu is used with the "regular"
Hi, I did test it out, here's a working version:
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from gi.repository import Gio
class Window(Gtk.ApplicationWindow):
def __init__(self):
Gtk.Window.__init__(self)
self.set_default_size(200, 100)
it should be like that (I can't test it right now, try yourself)
#!/usr/bin/env python3
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from gi.repository import Gio
class Window(Gtk.ApplicationWindow):
def __init__(self):
Gtk.Window.__init__(self)
see here:
https://wiki.gnome.org/HowDoI/GMenu
https://wiki.gnome.org/HowDoI/GAction
self.interface_info = """
>
>
>
> Foo
>
> Bar
>
>
>
>
> """
for every you
Dear Eric,
thank you for your quick reply.
> There is a basic setup for the Gtk Application in Python here
> https://developer.gnome.org/gnome-devel-demos/stable/hello-world.py.html.en
Nice to know. Very helpful.
> For C you can check
>
There is a basic setup for the Gtk Application in Python here
https://developer.gnome.org/gnome-devel-demos/stable/hello-world.py.html.en
For C you can check
https://github.com/cecashon/OrderedSetVelociRaptor/blob/master/Misc/Csamples/gtk_app1.c
which has a menu but doesn't use builder
X-Post: I was redirected from
https://mail.gnome.org/archives/python-hackers-list/2018-April/msg4.html
to here.
I try to use Gtk.Builder to create a menubar. It is not working
because the documentation is not clear for me. There is no exmple for
a IMO usual thing like a menubar.
To improve
11 matches
Mail list logo