gtkdialogs and colors

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
arivas_2005
Posts: 212
Joined: Sun 25 Feb 2007, 14:39

gtkdialogs and colors

#1 Post by arivas_2005 »

I know very little programming

I want to learn about

in this code

Code: Select all

#! /bin/bash

export MAIN_DIALOG='
 <vbox>
   <text>
    <label>access to</label>
  </text>
  <entry>    
    <default>Default value</default>
    <variable>ENTRY</variable>
  </entry>
  <hbox>
   <button ok></button>
   <button cancel></button>
  </hbox>
 </vbox>
'

gtkdialog --program=MAIN_DIALOG
how I can put..
a) color in font: access to or Default value
b) color background in <text> and <entry>
c) alignment to center in <label>, <text> or <entry>
d) asign program1 to <button ok> and program2 to <button cancel>

I searched the internet but I'm very confused about how to use commands in gtkdialg

Thank you. though I know I ask many details, I wish I collaborate

regards

User avatar
puppyluvr
Posts: 3470
Joined: Sun 06 Jan 2008, 23:14
Location: Chickasha Oklahoma
Contact:

#2 Post by puppyluvr »

:D Hello,
I believe that those settings are global for gtkdialog, but dont hold me to that.. Ive done many gtkdialog programs, and never thought about colors..
I would tend to bet there is a gtk.rc type file that contains settings for default colors, fonts, etc...
Although I dont know the exact answer, I posted so I can follow this thread..because I WANT TO....
Thank you for asking... 8)
Close the Windows, and open your eyes, to a whole new world
I am Lead Dog of the
Puppy Linux Users Group on Facebook
Join us!

Puppy since 2.15CE...

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

#3 Post by seaside »

arivas_2005,

To make a very ugly example, here's how to create a temporary gtkrc file to control your program colors and execute programs.

Code: Select all

#! /bin/bash

	echo 'style "blackbg" {
	 font_name="DejaVu Sans 15"
	  bg[NORMAL]    = "black"
	  fg[NORMAL]  = "green"
	  base[NORMAL]	= "yellow"
	  }
	class "*" style "blackbg"' > /tmp/gtkrc
	export GTK2_RC_FILES=/tmp/gtkrc:/root/.gtkrc-2.0

export MAIN_DIALOG='
 <vbox>
   <text>
    <label>access to</label>
  </text>
  <entry>   
    <default>Default value</default>
    <variable>ENTRY</variable>
  </entry>
  <hbox>
   <button ok><action> echo program1</action><action>EXIT:ok</action></button>
   <button cancel><action> echo program2</action><action>EXIT:cancel</action></button>
  </hbox>
 </vbox>
'

gtkdialog --program=MAIN_DIALOG 
There is a rich source of tips here-
http://murga-linux.com/puppy/viewtopic.php?t=38608

Cheers,
s

Post Reply