mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-05 16:09:07 -04:00
Add dialog actions
This commit is contained in:
parent
bac008296a
commit
8ba898e354
10 changed files with 115 additions and 3 deletions
6
tests/sample_errors/action_parent.blp
Normal file
6
tests/sample_errors/action_parent.blp
Normal file
|
@ -0,0 +1,6 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
Box {
|
||||
[action response=ok]
|
||||
Label {}
|
||||
}
|
1
tests/sample_errors/action_parent.err
Normal file
1
tests/sample_errors/action_parent.err
Normal file
|
@ -0,0 +1 @@
|
|||
4,4,6,Parent type Gtk.Box does not have action widgets
|
6
tests/sample_errors/action_response.blp
Normal file
6
tests/sample_errors/action_response.blp
Normal file
|
@ -0,0 +1,6 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
Dialog {
|
||||
[action response=foo]
|
||||
Button {}
|
||||
}
|
1
tests/sample_errors/action_response.err
Normal file
1
tests/sample_errors/action_response.err
Normal file
|
@ -0,0 +1 @@
|
|||
4,20,3,foo is not a member of Gtk.ResponseType
|
8
tests/samples/actions.blp
Normal file
8
tests/samples/actions.blp
Normal file
|
@ -0,0 +1,8 @@
|
|||
using Gtk 4.0;
|
||||
|
||||
Gtk.Dialog {
|
||||
[action response=1]
|
||||
Button {}
|
||||
[action response=cancel]
|
||||
Button cancel {}
|
||||
}
|
16
tests/samples/actions.ui
Normal file
16
tests/samples/actions.ui
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<object class="GtkDialog">
|
||||
<child type="action">
|
||||
<object class="GtkButton" id="__1"></object>
|
||||
</child>
|
||||
<child type="action">
|
||||
<object class="GtkButton" id="cancel"></object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="1">__1</action-widget>
|
||||
<action-widget response="cancel">cancel</action-widget>
|
||||
</action-widgets>
|
||||
</object>
|
||||
</interface>
|
|
@ -111,6 +111,7 @@ class TestSamples(unittest.TestCase):
|
|||
|
||||
def test_samples(self):
|
||||
self.assert_sample("accessibility")
|
||||
self.assert_sample("actions")
|
||||
self.assert_sample("binding")
|
||||
self.assert_sample("child_type")
|
||||
self.assert_sample("combo_box_text")
|
||||
|
@ -141,6 +142,8 @@ class TestSamples(unittest.TestCase):
|
|||
self.assert_sample_error("a11y_prop_dne")
|
||||
self.assert_sample_error("a11y_prop_obj_dne")
|
||||
self.assert_sample_error("a11y_prop_type")
|
||||
self.assert_sample_error("action_parent")
|
||||
self.assert_sample_error("action_response")
|
||||
self.assert_sample_error("class_assign")
|
||||
self.assert_sample_error("class_dne")
|
||||
self.assert_sample_error("consecutive_unexpected_tokens")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue