Glade doesn't run when using `glade/run.sh` seemingly due to the setting of `XDG_DATA_DIRS`

question
windows
Tags: #<Tag:0x00007f9917f4a008> #<Tag:0x00007f9917f49ea0>

#1

Hello,

I’ve been trying to add a plugin-widget but whenever I run the application it doesn’t recognize my custom type.

I was just editing the xml files directly (gui/mypaint.glade and glade/mypaint_widgets.xml), so I thought I’d try to use the glade UI, since maybe that does an extra building step?

I found the instructions is glade/REAME.md:

$ glade/run.sh
$ glade/run.sh gui/something.glade

If I try the second command (with gui/mypaint.glade) the terminal hangs for a second and then finishes, but the glade UI doesn’t show up.

If I manually follow the steps in the run script, i.e.

$ export GLADE_CATALOG_SEARCH_PATH=~/linux-projects/mypaint
$ export GLADE_MODULE_SEARCH_PATH=~/linux-projects/mypaint/gui

The glade UI still starts, but can’t find the mypaint_widgets catalog. And if I add the export for XDG_DATA_DIRS as well, the UI doesn’t start again.

I should note that I’m running this from the msys mingw64 shell.

The glade version I am using is mingw64/mingw-w64-x86_64-glade 3.21.0-1. Since the run script is something made here, and there seems to be some hackery going on with the custom widgets I thought I’d try coming here with this issue.

Maybe the instructions are outdated? Am I missing something? Is there a way to not use the glade UI and do things by hand?

Thanks


#2

I used glade recently, just running run.sh. I’m thinking it is a MSYS2 issue. I used Debian stable


#3

I’m thinking it is a MSYS2 issue

That’s also what I feared.

I’m trying to just side-step the glade application by editing mypaint_widgets.xml and mypaint.glade, but it’s not recognizing my custom widget type, unfortunately.

$ git diff
diff --git a/glade/mypaint_widgets.xml b/glade/mypaint_widgets.xml
index f768a07b..65906e78 100644
--- a/glade/mypaint_widgets.xml
+++ b/glade/mypaint_widgets.xml
@@ -300,6 +300,17 @@
             optional-default="True" />
       </properties>
     </glade-widget-class>
+
+    <glade-widget-class name="MyPaintBrushWidget"
+        title="Brush widget" parent="GtkDrawingArea"
+        generic-name="brushwidget">
+      <properties>
+        <property id="width-request" default="48" optional="True"
+            optional-default="True" />
+        <property id="height-request" default="48" optional="True"
+            optional-default="True" />
+      </properties>
+    </glade-widget-class>

   </glade-widget-classes>

@@ -317,6 +328,7 @@
     <glade-widget-class-ref name="AccelMapEditor"/>
     <glade-widget-class-ref name="MyPaintDeviceSettingsEditor"/>
     <glade-widget-class-ref name="MyPaintBrushColorIndicator"/>
+    <glade-widget-class-ref name="MyPaintBrushWidget"/>
   </glade-widget-group>

 </glade-catalog>
diff --git a/gui/mypaint.glade b/gui/mypaint.glade
index c09046a2..a3ddfb16 100644
--- a/gui/mypaint.glade
+++ b/gui/mypaint.glade
@@ -226,7 +226,7 @@ R: {rotation:+.1f}°</property>
               </packing>
             </child>
             <child>
-              <object class="GtkDrawingArea" id="footer_brush_indicator_drawingarea">
+              <object class="MyPaintBrushWidget" id="footer_brush_indicator_drawingarea">
                 <property name="width_request">48</property>
                 <property name="visible">True</property>
                 <property name="app_paintable">True</property>

p.s. Got this to work after all, seems I just had to import the module with the widget I’d added into application.py


#4

I should also note that when I run glade by itself I see a bunch of warnings being printed, both of:

(glade.exe:6884): GLib-GIO-CRITICAL **: g_content_type_is_a: assertion 'supertype != NULL' failed

(glade.exe:6884): GLib-GIO-CRITICAL **: g_content_type_is_a: assertion 'type != NULL' failed

Not sure what that is about (can’t seem to find anything about it through google), glade still starts any ways in that case.