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 Tue 29 Jul 2014, 17:15
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
How to put color in GTKDIALOG
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [12 Posts]  
Author Message
don570


Joined: 10 Mar 2010
Posts: 3220
Location: Ontario

PostPosted: Mon 23 Jan 2012, 15:22    Post subject:  How to put color in GTKDIALOG  

I have put together two scripts , one for gtkdialog3 and
the other for the newer gtkdialog4 to show how easy it is
to put some color in message windows.

The scripts don't do anything useful but they show how easy it is
to add a button and the resulting colorful message window.



Here's another example of what is possible.


Thanks to Radky for the code. I stole it from PupShutdown.

Some notes:

1) The double quote needs protection with \
2) A width request for text is important as the example shows.
3) A variable such as $VAR doesn't have protection.
4) Both bold and underlining is possible simultaneously
Code:
[b][u]....text.....[/u][/b]


5) A color can be a hex number instead.
You can use mtpaint to get the hex number.
The dropper can be used anywhere on
your computer screen to find the appropriate color.



____________________________________________________
colored_message_scripts.tar.gz
Description  Two scripts for demonstration purposes only!!
gz

 Download 
Filename  colored_message_scripts.tar.gz 
Filesize  1.14 KB 
Downloaded  291 Time(s) 

Last edited by don570 on Mon 23 Jan 2012, 16:59; edited 2 times in total
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4282

PostPosted: Mon 23 Jan 2012, 15:59    Post subject:  

Somewhere in the gtkdialog tips thread is an example I posted that shows all named colors from rgb.txt. (red, blue, black ...) Those are supported too, also included a tool to auto-generate a 1x1 xpm that easily can be scaled.
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3220
Location: Ontario

PostPosted: Mon 23 Jan 2012, 16:11    Post subject:  

When you have the time could you track down the pages.??


_____________________________________________________

Last edited by don570 on Tue 24 Jan 2012, 16:36; edited 1 time in total
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Mon 23 Jan 2012, 16:38    Post subject:  

Dear guys,

I did a markup editor once and it is here: http://murga-linux.com/puppy/viewtopic.php?mode=attach&id=30359. I also have a simpler markup editor somewhere else on the forum.

With kind regards,
vovchik
Back to top
View user's profile Send private message 
darkcity


Joined: 23 May 2010
Posts: 2435
Location: near here

PostPosted: Thu 02 Aug 2012, 09:17    Post subject:  

don570 wrote:
When you have the time could you track down the pages.??


color thing is here-
http://www.murga-linux.com/puppy/viewtopic.php?p=559741#559741

rgb file on pup5 is at
/usr/share/X11/rgb.txt

any examples of scripts using this?

_________________
helping Wiki for help | IF SendSpace link = "dead" THEN PM me ("up file to http://meownplanet.net/")
Back to top
View user's profile Send private message Visit poster's website 
don570


Joined: 10 Mar 2010
Posts: 3220
Location: Ontario

PostPosted: Thu 02 Aug 2012, 18:32    Post subject:  

puppy backup ---> I put in colored word in front window
bacon recorder --> I put in a info message in color

Radky's apps are the best when it comes to color
see pupshutdown
http://www.murga-linux.com/puppy/viewtopic.php?t=56077
______________________________________________

.
Back to top
View user's profile Send private message 
darkcity


Joined: 23 May 2010
Posts: 2435
Location: near here

PostPosted: Sun 05 Aug 2012, 15:34    Post subject:  

Thanks, this method seems a bit 'clunky' - and I keep messing up the syntax. Embarassed

I want to make different colored buttons, perhaps a different method using sprites would be easier?

_________________
helping Wiki for help | IF SendSpace link = "dead" THEN PM me ("up file to http://meownplanet.net/")
Back to top
View user's profile Send private message Visit poster's website 
don570


Joined: 10 Mar 2010
Posts: 3220
Location: Ontario

PostPosted: Tue 07 Aug 2012, 17:08    Post subject:  

Zigbert is experimenting with SVG
in pfind using a technique he learned from Technosaurus
but it's a little too difficult for me to understand Crying or Very sad .
http://murga-linux.com/puppy/viewtopic.php?t=76431

In bacon recorder I have an animated gif icon that can be clicked on
to launch an app. I made it with mtpaint.

So if you're looking for a fancy button that's the way to go.
___________________________________________
Back to top
View user's profile Send private message 
darkcity


Joined: 23 May 2010
Posts: 2435
Location: near here

PostPosted: Tue 07 Aug 2012, 18:22    Post subject:  

sweet, svg files can be used as input ; -) eg

Code:

      <button relief="2"   tooltip-text="pup">
        <input file>'/usr/share/images/sm.svg'</input>
        <action>echo monkey</action>
      </button>


thanks Twisted Evil Twisted Evil

_________________
helping Wiki for help | IF SendSpace link = "dead" THEN PM me ("up file to http://meownplanet.net/")
Back to top
View user's profile Send private message Visit poster's website 
don570


Joined: 10 Mar 2010
Posts: 3220
Location: Ontario

PostPosted: Tue 07 Aug 2012, 18:33    Post subject:  

I think Technosaurus method can control the
individual elements of the image such as straight lines,
arcs, circles etc. Zigbert can then define
things like color opacity size. I wish I knew more Crying or Very sad

_________________________________________________
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4282

PostPosted: Tue 07 Aug 2012, 22:43    Post subject:  

Svg is very similar to html, only for images. I usually just Google svg + whatever and if it is possible, something will come up on stackoverflow, or even a full tutorial. I posted a bunch of svg line drawings in the simple icon tray thread that could be used and tweaked in inkscapelite (i usually manually adjust inkscape's code for size/readability ... SVG is supposed to be human readable)
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
darkcity


Joined: 23 May 2010
Posts: 2435
Location: near here

PostPosted: Wed 08 Aug 2012, 10:49    Post subject:  

great stuff, gtkdialogue seems to need over complex syntax, but I will fight on ; -)
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [12 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0724s ][ Queries: 13 (0.0080s) ][ GZIP on ]