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 02 Sep 2014, 10:02
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Font size and color in gtk entry or buttons (Solved)
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [4 Posts]  
Author Message
arivas_2005

Joined: 25 Feb 2007
Posts: 89

PostPosted: Sat 09 Nov 2013, 16:01    Post subject:  Font size and color in gtk entry or buttons (Solved)  

regards

i have the following mini-code


Code:
export A='
<window window-position="1" decorated="true" >
   <vbox>
            <text>
               <label>Registro de Nombres </label>
          </text>
           <entry text="Nombres" is-focus="true" caps-lock-warning="false" xalign="1" width-chars="20" height-request="25" space-expand="true">
             <variable>NOMBRES</variable>
             <action signal="activate">grabfocus:APELLIDOS</action>
             <action signal="activate">command</action>
          </entry>
          <entry text="Apellidos" caps-lock-warning="false" xalign="0" width-chars="20" height-request="25" space-expand="true">
              <variable>APELLIDOS</variable>
              <action signal="activate">grabfocus:DIRECCION</action>
              <action signal="activate">command</action>
          </entry>
           <checkbox>
               <variable>SEXO</variable>
               <label>Es Masculino</label>
         </checkbox>
          <entry text="Direccion" caps-lock-warning="false" xalign="2" width-chars="20" height-request="25" space-expand="true" activates-default="true" has-default="true">
               <variable>DIRECCION</variable>
               <action signal="activate">command</action>
          </entry>
          <button  use-stock="true" label="gtk-ok" can-default="true" has-default="true">
          </button>         
   </vbox>          
</window>'

gtkdialog -p A


I need to do the following

How I can assign different font size for each entry (or check and buttons).

How I can apply different color and different font for each entry (or check and buttons).


for reading problems, I need to increase to at least 16, 20 or 24 point size.

I also need to implement easy to read font


Similarly, I need to color the box for easy filling

excuse my Inglés
thank you very much

Last edited by arivas_2005 on Sun 10 Nov 2013, 21:14; edited 1 time in total
Back to top
View user's profile Send private message 
don570


Joined: 10 Mar 2010
Posts: 3261
Location: Ontario

PostPosted: Sat 09 Nov 2013, 16:11    Post subject:  

Have you looked through this thread first?

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


_____________________________________________________________

Also I think that Thunor wrote an example script showing fonts
perhaps in the misc folder??

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

______________________________
Back to top
View user's profile Send private message 
arivas_2005

Joined: 25 Feb 2007
Posts: 89

PostPosted: Sat 09 Nov 2013, 20:17    Post subject:  

hi

I checked the links, but
is very complex for my level.

I found something about "styles", but
I do not know how to integrate

Example:

Code:
echo 'style "specialmono"
{
  font_name="Sans 50"
  bg[NORMAL]    = "black"
  bg[NORMAL]  = "green"
  base[NORMAL]   = "yellow"
 
}


widget "*mono" style "specialmono"
class "GtkText*" style "specialmono"' > /tmp/gtkrc_mono

export GTK2_RC_FILES=/tmp/gtkrc_mono:/root/.gtkrc-2.0


Well .. keep waiting for a solution.

==========================================
seek, seek and not find my solution
but, in this link
http://208.109.22.214/puppy/viewtopic.php?search_id=676324911&t=63888&sid=39ed4fa5c63a65d4e7f4a084d6c5ae3f
I found something like what I need
ptiming has two large box with colored font.

I checked and the code is very complex ptiming and for me.
I am novel in programming
excuse my english. I use traslate soft.
==========================================
Thanks
Back to top
View user's profile Send private message 
arivas_2005

Joined: 25 Feb 2007
Posts: 89

PostPosted: Sun 10 Nov 2013, 21:14    Post subject:  

continuing the search for the solution

good.

After hours and hours searching ..... I found the effect he wanted in Ptiming.

After hours and hours and hours of trial and error I summarized the following code.

Code:
#!/bin/sh
#Ptiming
#Copyright 2011,2012,2013
#Sigmund Berglund - Valåmoen, Norway.

#------------------------------
#This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 2.

#This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. <http://www.gnu.org/licenses/>.
#------------------------------


#gettext
FONTSIZE=60
echo 'export VERSION=1.0.2
export FONTSIZE='$FONTSIZE'
export COLOR1="#222222"
export COLOR2="#2CDD49"
export COLOR3="#EEA03F"
export SOUND_AT_START="/usr/share/audio/beep_high.wav"
export SOUND_BEFORE_START="/usr/share/audio/beep_low.wav"
export START_INTERVAL=30
export LATE_REGISTRATION=2' > $HOME/.ptiming/ptimingrc
   chmod 722 $HOME/.ptiming/ptimingrc

. $HOME/.ptiming/ptimingrc


echo 'style "monoBig" { font_name="Mono bold 50" base[NORMAL]="'$COLOR1'" text[NORMAL]="'$COLOR2'" }
widget "*timer" style "monoBig"
style "dejaColor" { font_name="Dejavu 40" base[NORMAL]="'$COLOR1'" text[NORMAL]="'$COLOR3'" }
widget "*edit" style "dejaColor"
style "dejaBig" { font_name="Mono bold 60" base[NORMAL]="'$COLOR1'" text[NORMAL]="'$COLOR3'"}
widget "*nr" style "dejaBig"' > $WORKDIR/gtkrc
export GTK2_RC_FILES=$WORKDIR/gtkrc:/root/.gtkrc-2.0 #include theme stuff with system themes

TEXT="AA"

export pTiming='
   <window height-request="250" width-request="350" skip-taskbar-hint="true" decorated="false">
    <vbox>
      <entry name="edit" text="Focus  is here" width-request="80" tooltip-text="'$(gettext 'Apply changes by pressing ENTER')'">
       <input>echo '$TOUCHED_NR'</input>
       <variable>EDIT_NR</variable>
         <action signal="activate">grabfocus:INGRESA</action>                   
      </entry>
      <entry width-request="340" height-request="27">
       <input>echo '$TOUCHED_NAME'</input>      
       <visible>disabled</visible>
      </entry>
      <entry name="timer" width-request="150" tooltip-text="'$(gettext 'Apply changes by pressing ENTER')'">
           <variable>INGRESA</variable>          
           <action signal="activate">EXIT:apply</action>
      </entry>
            
       <button visible="true" can-default="true" has-default="true">
         <action>EXIT:apply</action>
      </button>
      
    </vbox>
    <action signal="focus-out-event">EXIT:exit</action>
   </window>'

inserta() {
   
   hola="FDAFDS"   
}; export -f inserta

##  modifile() {


gtkdialog -p pTiming
   


hopefully one forum can review the code and improve it for example those in need.

I do not understand how it works but if it does what I need.

too

i found other examples using \ ".. \" but called off widgest. Example:

Code:
#!/bin/bash
echo 'style "specialmono"
{
  font_name="Mono 12"
}
widget "*mono" style "specialmono"
class "GtkText*" style "specialmono"' > /tmp/gtkrc_mono

export GTK2_RC_FILES=/tmp/gtkrc_mono:/root/.gtkrc-2.0

export test_app="
<vbox>
  <text name=\"mono\"><label>This text-widget uses monospace font....</label></text>
  <text><label>...while this text-widget don't.</label></text>
  <edit><default>All edit-widgets gets monospace.</default></edit>
</vbox>"
gtkdialog --program=test_app


the \ ".. \" in <text name=\"mono\">, ,, but deactivated called widgest


excuse my english. I use traslator
comments?
Thanks!
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [4 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.0894s ][ Queries: 11 (0.0187s) ][ GZIP on ]