Compare commits

..

No commits in common. "a4e0c3701b1510191f72cc606c2fa20d97800444" and "404ae767870b6da6005f2f4aaa878deed82829e5" have entirely different histories.

3 changed files with 5 additions and 5 deletions

View file

@ -225,12 +225,12 @@ class Flag(AstNode):
return self.tokens["value"] return self.tokens["value"]
@property @property
def value(self) -> T.Optional[str]: def value(self) -> T.Optional[int]:
type = self.context[ValueTypeCtx].value_type type = self.context[ValueTypeCtx].value_type
if not isinstance(type, Enumeration): if not isinstance(type, Enumeration):
return None return None
elif member := type.members.get(self.name): elif member := type.members.get(self.name):
return member.nick return member.value
else: else:
return None return None

View file

@ -26,7 +26,7 @@ Blueprint is a markup language and compiler for GTK 4 user interfaces.
using Gtk 4.0; using Gtk 4.0;
template $MyAppWindow: ApplicationWindow { template MyAppWindow : ApplicationWindow {
default-width: 600; default-width: 600;
default-height: 300; default-height: 300;
title: _("Hello, Blueprint!"); title: _("Hello, Blueprint!");
@ -35,7 +35,7 @@ Blueprint is a markup language and compiler for GTK 4 user interfaces.
HeaderBar {} HeaderBar {}
Label { Label {
label: bind template.main_text; label: bind MyAppWindow.main_text;
} }
} }

View file

@ -7,7 +7,7 @@ corresponding .blp file and regenerate this file with blueprint-compiler.
<interface> <interface>
<requires lib="gtk" version="4.0"/> <requires lib="gtk" version="4.0"/>
<object class="GApplication"> <object class="GApplication">
<property name="flags">is-service|handles-open</property> <property name="flags">1|4</property>
</object> </object>
<object class="GtkEventControllerScroll"> <object class="GtkEventControllerScroll">
<property name="flags">1</property> <property name="flags">1</property>