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 Wed 01 Oct 2014, 02:17
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Gtkdialog Development
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 4 of 55 [821 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, ..., 53, 54, 55 Next
Author Message
disciple

Joined: 20 May 2006
Posts: 6438
Location: Auckland, New Zealand

PostPosted: Wed 06 Jul 2011, 01:01    Post subject:  

thunor wrote:
BTW the Gtkdialog Application Index is a really great resource but I'm linking to it from the Gtkdialog project page and I have to login to view it. Is that right?

No, it shouldn't be like that. It looks like that whole section of the forum is invisible if you are not logged in - someone must have set it up wrong.
Thanks, I'll PM Flash to see if it can be fixed.

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6438
Location: Auckland, New Zealand

PostPosted: Wed 06 Jul 2011, 01:03    Post subject:  

thunor wrote:
glade_support.c is the interface between Glade and Gtkdialog. I had to update it to support the new comboboxtext widget, so it's something that has to be maintained even if there're only one or two application developers using it. Maybe we should specifically state that Glade support is deprecated.

Is there actually anybody developing with it?

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Wed 06 Jul 2011, 07:32    Post subject:  

disciple wrote:
Is there actually anybody developing with it?

Partview is using it.
Back to top
View user's profile Send private message Visit poster's website 
01micko


Joined: 11 Oct 2008
Posts: 7805
Location: qld

PostPosted: Wed 06 Jul 2011, 09:01    Post subject:  

I'm pretty sure forum member neurino is actively using glade with gtkdialog.

Also rox uses glade, so deprecated it may be but actively used.

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4351

PostPosted: Wed 06 Jul 2011, 11:10    Post subject:  

thunor wrote:
disciple wrote:
Is there actually anybody developing with it?

Partview is using it.
I have a version of partview that doesn't ... I even use bash to dynamically generate images; however, this did remind me of a feature that AFAIK has been missing ... the sliders[/quote]
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6438
Location: Auckland, New Zealand

PostPosted: Wed 06 Jul 2011, 23:32    Post subject:  

01micko wrote:
Also rox uses glade, so deprecated it may be but actively used.

Yes, I've been meaning to look into patching Rox to use gtkbuilder... maybe one day I'll have time.

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6438
Location: Auckland, New Zealand

PostPosted: Thu 07 Jul 2011, 09:27    Post subject:  

Hi guys,
If you are writing (or have already written) programs using gtkdialog, could you please add them to the index?

Thanks.

_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Thu 07 Jul 2011, 12:30    Post subject:  

Added comboboxentry widget

The widget reference is available here.

[EDIT] Updated 2011-07-07 19:10 to support using unmatched default directive text as the default entry text.

This is very similar to the comboboxtext widget that I created a short while ago except that this:
  • includes an entry at index -1
  • emits a "changed" signal when typing within the entry in addition to selecting an item from the list
  • emits an "activate" signal when pressing the Enter key whilst the cursor is within the entry
  • defaults to index -1 (the entry) on initialisation which'll get overridden by the default directive or active tag attribute
  • sets unmatched default directive text as the default entry text
  • saves unique non-null entry text to the output file

<comboboxentry> widget example:
Code:
#!/bin/sh

# NOTE: This example requires at least gtkdialog-0.7.21 (please visit
# http://code.google.com/p/gtkdialog/). Additionally if you are using
# Puppy Linux then you may find that an historical version of gtkdialog
# already exists in /usr/sbin, and if that is the case then you should
# modify the shell variable below to point to the new gtkdialog binary.

GTKDIALOG=gtkdialog

function funcbtnCreate() {
   echo '<button>
         <label>"'"$2"'"</label>
         <action>echo "'"$3"' cboComboBox'$1'"</action>
         <action type="'"$4"'">cboComboBox'$1'</action>
      </button>'
}

function funccboCreate() {
   if [ $1 = 0 ]; then
      echo '<combobox>'
   elif [ $1 = 1 ]; then
      echo '<combobox allow-empty="false" value-in-list="true">'
   elif [ $1 = 2 ]; then
      echo '<combobox case-sensitive="true" value-in-list="true">'
   fi
   echo '<variable>cboComboBox'$1'</variable>
         <visible>enabled</visible>
         <item>cboComboBox'$1'</item>'
   if [ $1 = 0 ]; then
      echo '<item>tag attributes none</item>'
   elif [ $1 = 1 ]; then
      echo '<item>tag attribute allow-empty="false"</item>
         <item>tag attribute value-in-list="true"</item>'
   elif [ $1 = 2 ]; then
      echo '<item>tag attribute case-sensitive="true"</item>
         <item>tag attribute value-in-list="true"</item>'
   fi
   echo '</combobox>
      <hbox homogeneous="true">
         '"$(funcbtnCreate $1 Clear Clearing clear)"'
         '"$(funcbtnCreate $1 Refresh Reloading refresh)"'
      </hbox>'
   if [ $1 -lt 2 ]; then echo '<hseparator></hseparator>'; fi
}

function funccboEntryCreate() {
   if [ $1 = 0 ]; then
      echo '<comboboxentry accept="filename">'
   elif [ $1 = 1 ]; then
      echo '<comboboxentry accept="filename" active="4" button-sensitivity="1">'
   elif [ $1 = 2 ]; then
      echo '<comboboxentry accept="filename" focus-on-click="false">'
   fi
   echo '<variable>cboComboBoxEntry'$1'</variable>
         <visible>enabled</visible>
         <item>cboComboBoxEntry'$1'</item>
         <item>tag attribute accept="filename"</item>'
   if [ $1 = 1 ]; then
      echo '<item>tag attribute active="4"</item>
         <item>tag attribute button-sensitivity="1"</item>'
   elif [ $1 = 2 ]; then
      echo '<item>tag attribute focus-on-click="false"</item>'
   fi
   if [ $1 -gt 0 ]; then
      echo '<item>This is the default directive text but the active index will override it if declared</item>
         <default>This is the default directive text but the active index will override it if declared</default>'
   fi
   echo '<input>echo "This came from a shell command"</input>
         <input file>inputfile</input>
         <output file>outputfile</output>
         <action signal="changed">echo "cboComboBoxEntry'$1' changed to $cboComboBoxEntry'$1'"</action>
         <action>echo "cboComboBoxEntry'$1' action for default signal triggered"</action>
         <action type="command">echo "cboComboBoxEntry'$1' action type for default signal triggered"</action>
         <action signal="activate">echo "cboComboBoxEntry'$1' Enter key-press detected"</action>
      </comboboxentry>
      <hbox homogeneous="true">
         '"$(funcbtnCreate Entry$1 Clear Clearing clear)"'
         '"$(funcbtnCreate Entry$1 Delete Deleting removeselected)"'
         '"$(funcbtnCreate Entry$1 Refresh Reloading refresh)"'
         '"$(funcbtnCreate Entry$1 Save Saving save)"'
      </hbox>
      <hbox homogeneous="true">
         '"$(funcbtnCreate Entry$1 Disable Disabling disable)"'
         '"$(funcbtnCreate Entry$1 Enable Enabling enable)"'
         '"$(funcbtnCreate Entry$1 Fileselect """Inserting into""" fileselect)"'
      </hbox>'
   if [ $1 -lt 2 ]; then echo '<hseparator></hseparator>'; fi
}

if [ ! -f inputfile ]; then
   echo "This came from an input file" > inputfile
fi

if [ ! -f inoutfile ]; then
   echo "cboComboBoxEntry3" > inoutfile
fi

export MAIN_DIALOG='
<window title="cboComboBoxEntry" resizable="false">
   <vbox>
      <hbox>
         <vbox>
            <frame combobox widget (deprecated)>
               '"$(funccboCreate 0)"'
               '"$(funccboCreate 1)"'
               '"$(funccboCreate 2)"'
            </frame>
         </vbox>
         <vbox>
            <frame comboboxentry widget>
               '"$(funccboEntryCreate 0)"'
               '"$(funccboEntryCreate 1)"'
               '"$(funccboEntryCreate 2)"'
            </frame>
            <frame Practical example>
               <text width-request="300">
                  <label>Type something, press the Enter key, repeat...</label>
               </text>
               <comboboxentry has-focus="true">
                  <variable>cboComboBoxEntry3</variable>
                  <default>Type something here...</default>
                  <input file>inoutfile</input>
                  <output file>inoutfile</output>
                  <action signal="activate">save:cboComboBoxEntry3</action>
                  <action signal="activate">refresh:cboComboBoxEntry3</action>
               </comboboxentry>
               <button>
                  <label>Delete</label>
                  <action>removeselected:cboComboBoxEntry3</action>
                  <action>save:cboComboBoxEntry3</action>
                  <action>refresh:cboComboBoxEntry3</action>
               </button>
            </frame>
         </vbox>
      </hbox>
      <hbox homogeneous="true">
         <button ok></button>
      </hbox>
   </vbox>
   <action signal="hide">exit:Exit</action>
</window>
'

$GTKDIALOG --center --program=MAIN_DIALOG

Regards,
Thunor

Last edited by thunor on Fri 12 Aug 2011, 09:48; edited 7 times in total
Back to top
View user's profile Send private message Visit poster's website 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Thu 07 Jul 2011, 13:12    Post subject:  

Dear thunor,

I compiled your latest with the new widget and think it's great. Well done....

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


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

PostPosted: Thu 07 Jul 2011, 13:30    Post subject:  

I've updated the GtkDialog on the wiki
http://puppylinux.org/wikka/Gtkdialog

maybe using the wiki would be a useful way of keeping track of gtkdialog programs, just a thought.

_________________
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 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Thu 07 Jul 2011, 14:16    Post subject:  

vovchik wrote:
I compiled your latest with the new widget and think it's great.

Thanks vovchik Smile

I've just updated it (r90) and modified the example to illustrate how to set default entry text, so you might want to do it again.

I had to put some thought into the way I implemented it otherwise it could've been a combobox with a useless entry.

Regards,
Thunor
Back to top
View user's profile Send private message Visit poster's website 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Sat 09 Jul 2011, 09:20    Post subject:  

My trusty old PIII 866MHz is in a coma and won't come out of it Crying or Very sad I've got a choice between rebuilding a PIV 2GHz with dodgy motherboard connections or using this slow PIII 650MHz that's been gathering dust in a corner, so I'm going to have to take a few days off, but I've started the GtkScales and they look really nice Smile
Back to top
View user's profile Send private message Visit poster's website 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Wed 13 Jul 2011, 12:08    Post subject:  

Added hscale and vscale widgets

The hscale widget reference is available here.
The vscale widget reference is available here.

[EDIT] Updated 2011-07-17 13:47 to support the "block-function-signals" custom tag attribute (the example scales with the markup use this).

Adding marks and markup (you'll need at least GTK+ 2.16 for this) is done via <item> directives (value | position | markup) and the markup is optional. For myself on my own computer (lupu-520) the vertical markup isn't rendered in the right place althought the marks are correct. The only time I've managed to get them drawn correctly was when adding them twice, the first set being wrong and the second not being able to be drawn again in the wrong place managed to go to the right place.

"range-min", "range-max", "range-step" and "range-value" are custom tag attributes that accept double precision floating point numbers. The GTK "digits" property specifies the number of decimal places that are displayed in the value.

To set the scale's value you can use the "range-value" custom tag attribute, the <default> directive, the <input> directive or the <input file> directive.

If you want to isolate signals originating from user widget manipulation from the refresh function then use the custom tag attribute block-function-signals/block_function_signals="true/yes/1".

The fourth horizontal and vertical scales include the GTK property "update-policy" set to 1 (GTK_UPDATE_DISCONTINUOUS) and you might want to investigate the different types.

Features Supported by Later Versions of GTK+
Some widget properties and features may be unavailable to you if you are using an older version of GTK+, but they will not prevent you from compiling and using Gtkdialog as Gtkdialog checks the user's version of GTK+ at compile time and removes support for unsupported properties and features to enable compilation against different GTK+ versions. Ultimately though, the features that the application developer chooses to implement and therefore the version of GTK+ that his application requires is not within my realm of operation.
  • 2.16 for scale marks and markup.

<hscale> and <vscale> widgets example:
Code:
#!/bin/sh

# NOTE: This example requires at least gtkdialog-0.7.21 (please visit
# http://code.google.com/p/gtkdialog/). Additionally if you are using
# Puppy Linux then you may find that an historical version of gtkdialog
# already exists in /usr/sbin, and if that is the case then you should
# modify the shell variable below to point to the new gtkdialog binary.

GTKDIALOG=gtkdialog

function funcbtnCreate() {
   echo '<button image-position="'$3'">
         <label>"'"$2"'"</label>
         <input file stock="'$4'"></input>
         <action>echo "'"$5"' '$1'"</action>
         <action type="'"$6"'">'$1'</action>
      </button>'
}

function funcscaType0Create() {
   echo '<'$2'scale width-request="'$3'" height-request="'$4'" range-value="4">
         <variable>'$1'</variable>
         <action>echo "'$1' changed to $'$1'"</action>
      </'$2'scale>
      <'$2'separator></'$2'separator>'
}

function funcscaType1Create() {
   echo '<'$2'scale width-request="'$3'" height-request="'$4'"
         range-min="0" range-max="1" range-step="0.1"
         value-pos="3" digits="2" inverted="true">
         <default>0.20</default>
         <variable>'$1'</variable>
         <action>echo "'$1' changed to $'$1'"</action>
         <item>"0.25 | '$5'"</item>
         <item>"0.5  | '$6'"</item>
         <item>"0.75 | '$7'"</item>
      </'$2'scale>
      <'$2'separator></'$2'separator>'
}

function funcscaType2Create() {
   echo '<'$2'scale width-request="'$3'" height-request="'$4'"
         range-min="0" range-max="255" range-step="8" value-pos="1"
         block-function-signals="true">
         <variable>'$1'</variable>
         <input>echo 18</input>
         <action>echo "'$1' changed to $'$1'"</action>
         <item>"64 |'$5'|<span fgcolor='"'white'"' bgcolor='"'darkred'"'> 64 </span>"</item>
         <item>"128|'$6'|<span fgcolor='"'white'"' bgcolor='"'darkgreen'"'> 128 </span>"</item>
         <item>"192|'$7'|<span fgcolor='"'white'"' bgcolor='"'darkblue'"'> 192 </span>"</item>
         <output file>outputfile</output>
      </'$2'scale>
      <'$2'box homogeneous="true">
         '"$(funcbtnCreate $1 Disable $8 gtk-no Disabling disable)"'
         '"$(funcbtnCreate $1 Enable $8 gtk-yes Enabling enable)"'
         '"$(funcbtnCreate $1 Refresh $8 gtk-refresh Reloading refresh)"'
         '"$(funcbtnCreate $1 Save $8 gtk-save Saving save)"'
      </'$2'box>
      <'$2'separator></'$2'separator>'
}

function funcscaType3Create() {
   echo '<'$2'scale width-request="'$3'" height-request="'$4'"
         range-min="0" range-max="123" range-step="1"
         draw-value="false" show-fill-level="true" fill-level="56"
         restrict-to-fill-level="true" update-policy="1">
         <variable>'$1'</variable>
         <input file>inputfile</input>
         <action signal="value_changed">echo "'$1' changed to $'$1'"</action>
         <output file>outputfile</output>
      </'$2'scale>
      <'$2'box homogeneous="true">
         '"$(funcbtnCreate $1 Disable $5 gtk-no Disabling disable)"'
         '"$(funcbtnCreate $1 Enable $5 gtk-yes Enabling enable)"'
         '"$(funcbtnCreate $1 Refresh $5 gtk-refresh Reloading refresh)"'
         '"$(funcbtnCreate $1 Save $5 gtk-save Saving save)"'
      </'$2'box>'
}

if [ ! -f inputfile ]; then
   echo "44" > inputfile
fi

export MAIN_DIALOG='
<window title="scaScales" resizable="false">
   <vbox>
      <hbox>
         <frame hscale widget>
            <vbox>
               '"$(funcscaType0Create hscHScale0 h 360 80)"'
               '"$(funcscaType1Create hscHScale1 h 360 80 2 2 2)"'
               '"$(funcscaType2Create hscHScale2 h 360 -1 3 2 3 0)"'
               '"$(funcscaType3Create hscHScale3 h 360 80 0)"'
            </vbox>
         </frame>
         <frame vscale widget>
            <hbox>
               '"$(funcscaType0Create vscVScale0 v 50 400)"'
               '"$(funcscaType1Create vscVScale1 v 50 400 1 1 1)"'
               '"$(funcscaType2Create vscVScale2 v -1 400 0 1 0 2)"'
               '"$(funcscaType3Create vscVScale3 v 50 400 2)"'
            </hbox>
         </frame>
      </hbox>
      <hbox homogeneous="true">
         <button ok></button>
      </hbox>
   </vbox>
   <action signal="hide">exit:Exit</action>
</window>
'

$GTKDIALOG --center --program=MAIN_DIALOG

Regards,
Thunor

Last edited by thunor on Fri 12 Aug 2011, 09:52; edited 10 times in total
Back to top
View user's profile Send private message Visit poster's website 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Wed 13 Jul 2011, 14:40    Post subject: Sliders are fab  

Dear thunor,

Your new sliders are fabulous. I compiled in lucid and they work - the v and hsliders w/o annotation do not slide all the way, however, but I have to look at your code before concluding anything. Congratulations and thanks.

With kind regards,
vovchik

PS. I take it you got your motherboard problems sorted out. One of mine burnt out not so long ago, and when I took off the CPU fan I found wads of cat hair Smile
Back to top
View user's profile Send private message 
thunor


Joined: 14 Oct 2010
Posts: 350
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings

PostPosted: Wed 13 Jul 2011, 17:20    Post subject: Re: Sliders are fab  

vovchik wrote:
I compiled in lucid and they work - the v and hsliders w/o annotation do not slide all the way, however...

PS. I take it you got your motherboard problems sorted out. One of mine burnt out not so long ago, and when I took off the CPU fan I found wads of cat hair Smile

I had a dodgy power supply unit but I took it all apart and cleaned it up because of the dust and dirt and installed it into another case Smile

I was going to say that that is incredibly weird not being able to slide all the way when I realised you meant the scales with the "fill-level" Very Happy

Can you tell me if the markup on the vertical scale is aligned with the marks? Maybe post a screenshot.

Regards,
Thunor
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 4 of 55 [821 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, ..., 53, 54, 55 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
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.1588s ][ Queries: 13 (0.0196s) ][ GZIP on ]