How to add markup to a frame_Label (gtkdialog)?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

How to add markup to a frame_Label (gtkdialog)?

#1 Post by Bert »

Hi all,

A burning question :) :

I'm slowly learning how to use gtkdialog and it has been fun so far.

Now I want to add markup to a frame_Label, but cannot find how to do that.

See this, taken from a tutorial in PCLinuxOS Magazine:

Image

The frame label "Commands Information" is bold. But when you look at the code, no markup is specified.
Obviously, the markup has been defined somewhere else in the script (not shown by the author).

Can markup be defined globally?
I realize this is probably kindergarten level, but that's where I am at this moment. :wink:

Thanks a lot for any pointers!
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#2 Post by don570 »

Zenity allows a font to be specified apparently????

https://help.gnome.org/users/zenity/stable/text.html.en

___________________________________________________

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#3 Post by don570 »

When I look at code the bold frame heading is actually the normal
text and the button labels are controlled by zenity.

Code: Select all

 <frame Commands Information>
    <hbox>
      <text> <label>Command:</label> </text>
      <entry><variable>VAR1</variable></entry>
    </hbox>

    <hbox>
      <button>
        <label>Help</label>
        <action>$VAR1 --help | zenity --text-info --width=600 --height=600 --title $"Help" &</action>
      </button>

      <button>
        <label>Whereis</label>
        <action>whereis $VAR1 | zenity --text-info  --width=400 --height=20 --title $"Whereis" &</action>
      </button>

      <button>
        <label>Which</label>
        <action>which $VAR1 | zenity --text-info --width=200 --height=200 --title $"Version" &</action>
      </button>

      <button>
        <label>Version</label>
        <action>$VAR1 --version | zenity --text-info --width=200 --height=200 --title $"Version" &</action>
      </button>

      <button>
        <label>Manual</label>
        <action>man $VAR1 | zenity --text-info --width=400 --height=500 --title $"Manual" &</action>
      </button>

      <button>
        <label>Kate Manual</label>
        <action>man $VAR1 >>'$HOME'/tmp/temp_man.txt</action>
        <action>kate '$HOME'/tmp/temp_man.txt</action>
        <action>rm -f '$HOME'/tmp/temp_man.txt</action>
      </button>
    </hbox>
    </frame>

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

#4 Post by Bert »

Thanks for your reply and for looking into it.

You're right, he used a pre-existing script with zenity in it.

So it looks like the gtkdialog frame_Label does not allow markup.

Or at least not in a way that beginners like me can easily apply.
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#5 Post by technosaurus »

Try using pango markup

If it doesn't work (I don't recall if it does or not), I could patch gtkdialog to make all label tags accept pango markup.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

#6 Post by Bert »

Thanks technosaurus,

I saw there is pango in Puppy (libpango, libpango-dev, pangomm_DEV).
Is that enough to use pango?

I tried the example in your link:

Code: Select all

"<span foreground="blue" size="x-large">Blue text</span> is <i>cool</i>!"
But that does not work. Maybe I have to define pango somehow in the script.

( Just found out I cannot add markup anywhere in the script! :oops: Better do some more reading first! :wink: )

Thanks again.
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#7 Post by technosaurus »

Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#8 Post by don570 »

Bert, have you read through 'Color text' page in my gtkdialog manual?

It shouldn't be too hard to add color text to a script using a text widget.

http://murga-linux.com/puppy/viewtopic.php?t=89045

________________________________________

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#9 Post by seaside »

Here's a "grep" of the source code which doesn't seem to show any "markup" aspect for the frame.

Code: Select all

# grep markup gtkdialog-0.8.3/src
widget_hscale.c:			/* Now we'll position on the markup or the terminating zero */
widget_hscale.c:			printf("%s: value=%.16f position=%i markup='%s'\n",
widget_text.c:		(value = get_tag_attribute(attr, "use-markup")) &&
widget_text.c:		gtk_label_set_use_markup(GTK_LABEL(widget), TRUE);
widget_text.c:		if (gtk_label_get_use_markup(GTK_LABEL(var->Widget))) {
widget_text.c:			gtk_label_set_markup(GTK_LABEL(var->Widget), text->str);
widget_text.c:		if (gtk_label_get_use_markup(GTK_LABEL(var->Widget))) {
widget_text.c:			gtk_label_set_markup(GTK_LABEL(var->Widget), text->str);
widget_timer.c:		gtk_label_set_markup(GTK_LABEL(var->Widget), text);
# 
Cheers,
s

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

#10 Post by Bert »

(I didn't get an email notification for this thread since Monday. Only now see Don and seaside have replied. Sorry :cry: )

Don, yes, I had already installed your manual, which is truly excellent btw!

Markup in general is no longer a problem. I got the quotes wrong.

Thanks all.
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

How to add markup to a frame_Label

#11 Post by L18L »

Bert wrote:Markup in general is no longer a problem. I got the quotes wrong.
... and what about markup in frame_Label", is it solved, and if then how?
Yours curious

User avatar
Bert
Posts: 1103
Joined: Fri 30 Jun 2006, 20:09

Re: How to add markup to a frame_Label

#12 Post by Bert »

L18L wrote: ... and what about markup in frame_Label", is it solved, and if then how?
Yours curious
Hi L18L,

No that isn't solved.
But the question has become less ..burning :wink:

I feel a bit like a spoiled child, just been given its first bicycle, reacting with "How many gears...?"

I can see where markup for the frame_label could be very useful, but essential? No, not in the bigger scheme of things. :)
[url=http://pupsearch.weebly.com/][img]http://pupsearch.weebly.com/uploads/7/4/6/4/7464374/125791.gif[/img][/url]
[url=https://startpage.com/do/search?q=host%3Awww.murga-linux.com%2F][img]http://i.imgur.com/XJ9Tqc7.png[/img][/url]

Post Reply