add resize handler to progressbar (Motif) newapi

Sat, 04 Jan 2025 16:30:06 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 04 Jan 2025 16:30:06 +0100
branch
newapi
changeset 430
ea949c0109d8
parent 429
0921f8a5d535
child 431
bb7da585debc
child 432
ccbcf98047de

add resize handler to progressbar (Motif)

ui/motif/label.c file | annotate | diff | comparison | revisions
--- a/ui/motif/label.c	Sat Jan 04 16:22:14 2025 +0100
+++ b/ui/motif/label.c	Sat Jan 04 16:30:06 2025 +0100
@@ -84,6 +84,9 @@
 static void ui_progressbar_expose(Widget widget, UiProgressBar *pb, XtPointer c) {
     Display *dp = XtDisplay(widget);
     Window w = XtWindow(widget);
+    if(w == 0) {
+        return;
+    }
     if(!pb->gc) {
         XGCValues gcvals;
         gcvals.foreground = pb->color;
@@ -158,6 +161,11 @@
             XmNexposeCallback,
             (XtCallbackProc)ui_progressbar_expose,
             progressbarData);
+    XtAddCallback(
+            drawingArea,
+            XmNresizeCallback,
+            (XtCallbackProc)ui_progressbar_expose,
+            progressbarData);
     
     
     XtManageChild(frame);

mercurial