Added markup for GtkLabel.
authorfredrik <fredrik@959494ce-11ee-0310-bf91-de5d638817bd>
Sun, 22 Apr 2007 20:30:22 +0000 (20:30 +0000)
committerfredrik <fredrik@959494ce-11ee-0310-bf91-de5d638817bd>
Sun, 22 Apr 2007 20:30:22 +0000 (20:30 +0000)
Added generic align and rqsz attributes.

git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@959 959494ce-11ee-0310-bf91-de5d638817bd

common/makegdesc

index cf91c40..68138d3 100755 (executable)
@@ -115,8 +115,13 @@ sub printwidgets
            $widget->{"size"} || die("Can't have image without size\n");
            print "${p}stack[$sl] = gtk_image_new_from_stock(GTK_STOCK_" . $widget->{"stock"} . ", GTK_ICON_SIZE_" . $widget->{"size"} . ");\n";
        } elsif($widget->{"type"} eq "lbl") {
-           $widget->{"label"} || die("Can't have label without label\n");
-           print "${p}stack[$sl] = gtk_label_new(_(\"" . $widget->{"label"} . "\"));\n";
+           $widget->{"label"} || $widget->{"markup"} || die("Can't have label without label\n");
+           if($widget->{"label"}) {
+               print "${p}stack[$sl] = gtk_label_new(_(\"" . $widget->{"label"} . "\"));\n";
+           } else {
+               print "${p}stack[$sl] = gtk_label_new(NULL);\n";
+               print "${p}gtk_label_set_markup(GTK_LABEL(stack[$sl]), _(\"" . $widget->{"label"} . "\"));\n";
+           }
            if($widget->{"wrap"} eq "y") {
                print "${p}gtk_label_set_line_wrap(GTK_LABEL(stack[$sl]), TRUE);\n";
            }
@@ -345,6 +350,12 @@ sub printwidgets
        if($widget->{"sensitive"}) {
            print "${p}gtk_widget_set_sensitive(stack[$sl], " . $widget->{"sensitive"} . ");\n";
        }
+       if($widget->{"rqsz"} =~ /(\d+)x(\d+)/) {
+           print "${p}gtk_widget_set_size_request(stack[$sl], $1, $2);\n";
+       }
+       if($widget->{"align"} =~ /([\d\.]+):([\d\.]+)/) {
+           print "${p}gtk_misc_set_alignment(GTK_MISC(stack[$sl]), $1, $2);\n";
+       }
        if($widget->{"var"} eq "y") {
            print $p . $options{"prefix"} . $widget->{"name"} . " = stack[$sl];\n";
        }