Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 25 Oct 2014, 18:09
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
How to add markup to a frame_Label (gtkdialog)?
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
Bert


Joined: 30 Jun 2006
Posts: 953

PostPosted: Thu 21 Nov 2013, 19:32    Post_subject:  How to add markup to a frame_Label (gtkdialog)?  

Hi all,

A burning question Smile :

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:



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!

_________________


Back to top
View user's profile Send_private_message 
don570


Joined: 10 Mar 2010
Posts: 3347
Location: Ontario

PostPosted: Thu 21 Nov 2013, 20:39    Post_subject:  

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

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

___________________________________________________
Back to top
View user's profile Send_private_message 
don570


Joined: 10 Mar 2010
Posts: 3347
Location: Ontario

PostPosted: Thu 21 Nov 2013, 20:50    Post_subject:  

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


Code:

 <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>
Back to top
View user's profile Send_private_message 
Bert


Joined: 30 Jun 2006
Posts: 953

PostPosted: Sat 23 Nov 2013, 15:20    Post_subject:  

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.

_________________


Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: Sat 23 Nov 2013, 21:04    Post_subject:  

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.

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
Bert


Joined: 30 Jun 2006
Posts: 953

PostPosted: Mon 25 Nov 2013, 08:25    Post_subject:  

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:
"<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! Embarassed Better do some more reading first! Wink )

Thanks again.

_________________


Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: Mon 25 Nov 2013, 10:08    Post_subject:  

see:http://code.google.com/p/gtkdialog/source/browse/trunk/examples/text/text_advanced?r=292
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
don570


Joined: 10 Mar 2010
Posts: 3347
Location: Ontario

PostPosted: Mon 25 Nov 2013, 17:46    Post_subject:  

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

________________________________________
Back to top
View user's profile Send_private_message 
seaside

Joined: 11 Apr 2007
Posts: 887

PostPosted: Mon 25 Nov 2013, 20:44    Post_subject:  

Here's a "grep" of the source code which doesn't seem to show any "markup" aspect for the frame.
Code:
# 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
Back to top
View user's profile Send_private_message 
Bert


Joined: 30 Jun 2006
Posts: 953

PostPosted: Thu 28 Nov 2013, 19:10    Post_subject:  

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

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.

_________________


Back to top
View user's profile Send_private_message 
L18L

Joined: 19 Jun 2010
Posts: 2530
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Fri 29 Nov 2013, 04:30    Post_subject: How to add markup to a frame_Label
Sub_title: how
 

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
Back to top
View user's profile Send_private_message 
Bert


Joined: 30 Jun 2006
Posts: 953

PostPosted: Fri 29 Nov 2013, 10:55    Post_subject: Re: How to add markup to a frame_Label
Sub_title: how
 

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. Smile

_________________


Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0994s ][ Queries: 12 (0.0237s) ][ GZIP on ]