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 22 Oct 2014, 12:09
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 13 of 55 [821 Posts]   Goto page: Previous 1, 2, 3, ..., 11, 12, 13, 14, 15, ..., 53, 54, 55 Next
Author Message
Geoffrey


Joined: 30 May 2010
Posts: 1429
Location: Queensland Australia ɹǝpu∩uʍop

PostPosted: Fri 12 Aug 2011, 08:15    Post subject:  

thunor wrote:
Geoffrey wrote:
Code:
...
/root/gtkdialog/src/widget_timer.c:379: undefined reference to `gtk_widget_get_sensitive'
...

Hi Geoffrey

Sorry about that. gtk_widget_get_sensitive requires GTK+ 2.18.0 and I missed it, but thanks for letting me know as there is an older alternative which I've included and committed Smile

Interestingly its sister function gtk_widget_set_sensitive already exists within the project and has no version requirements.

Regards,
Thunor


Thanks it now works

Geoffrey
Back to top
View user's profile Send private message 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Fri 12 Aug 2011, 11:42    Post subject:  

Hi thunor,

Is there no way to add a filter to gtk-open "fileselect" for specific filetypes?
This would really be a huge plus gtkdialog3. Thanks
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: Fri 12 Aug 2011, 18:29    Post subject:  

jpeps wrote:
Is there no way to add a filter to gtk-open "fileselect" for specific filetypes?

Hi jpeps

I'll look into it (issue 23)

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

Joined: 31 May 2008
Posts: 3220

PostPosted: Fri 12 Aug 2011, 19:44    Post subject:  

thunor wrote:

I'll look into it (issue 23)


Great...thanks!
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: Tue 16 Aug 2011, 11:46    Post subject:  

Overhauled the notebook widget

The widget reference is available here.

  • The page number is now stored within the variable and can be refreshed from a command or a file.
  • Tab labels can be specified with the "tab-labels" custom tag attribute.
  • Tab labels can be generated automatically by using either or both of the "tab-prefix" and "tab-suffix" custom tag attributes.
  • Tab labels will be generated automatically using "Page n" in the absence of any of the above custom tag attributes.
  • The "tab-base-index" custom tag attribute can be used to control the start page number used within the auto-generated labels.

This widget does not accept setting a default page before being shown (there's a note about it here) which will result in <input> and <input file> data being discarded at start-up. This issue can be overcome by using the "page" tag attribute which will be applied after the widget is shown.

<notebook> 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

funcnbkCreate() {
   for f in 0 1 2 3 4; do
      echo '<vbox border-width="20">
            <hbox border-width="70">
               <text label="This is page '$f'"></text>
            </hbox>'
      if [ $1 -lt 2 ]; then echo '<hbox homogeneous="true">'; fi
      if [ $1 -eq 0 ]; then
         echo '<button use-stock="true" label="gtk-go-back">'
         if [ $f -eq 0 ]; then
            echo '<sensitive>false</sensitive>'
         else
            echo '<action>echo '$(($f - 1))' > inputfile</action>
               <action>refresh:nbk'$1'</action>'
         fi
         echo '</button>
            <button use-stock="true" label="gtk-go-forward">'
         if [ $f -eq 4 ]; then
            echo '<sensitive>false</sensitive>'
         else
            echo '<action>echo '$(($f + 1))' > inputfile</action>
               <action>refresh:nbk'$1'</action>'
         fi
      elif [ $1 -eq 1 ]; then
         echo '<button use-stock="true" label="gtk-refresh">
               <action>refresh:nbk'$1'</action>'
      fi
      if [ $1 -lt 2 ]; then
         echo '</button>
            </hbox>'
      fi
      echo '</vbox>'
   done
   echo '<variable>nbk'$1'</variable>'
   if [ $1 -eq 0 -o $1 -eq 2 ]; then
      echo '<input file>inputfile</input>'
   elif [ $1 -eq 1 ]; then
      echo '<input>echo $(($RANDOM % 4))</input>'
   elif [ $1 -eq 3 ]; then
      echo '<input>"if [ $(<inputfile) -eq 4 ]; then echo 0 > inputfile
         else echo $(($(<inputfile) + 1)) > inputfile; fi
         echo $(<inputfile)"</input>'
   fi
}

funcnbkMainCreate() {
   for f in 0 1 2 3; do
      echo '<vbox>
            <vbox homogeneous="true" height-request="300">
               <hbox homogeneous="true" width-request="500">'
      if [ $f -eq 0 ]; then
         echo '<notebook>
               '"$(funcnbkCreate $f)"'
            </notebook>'
      elif [ $f -eq 1 ]; then
         echo '<notebook tab-labels="One|Two|Three|Four|Five"
               page="04" tab-vborder="12" tab-pos="0">
               '"$(funcnbkCreate $f)"'
            </notebook>'
      elif [ $f -eq 2 ]; then
         echo '<vbox>
               <hscale range-min="0" range-max="4" value-pos="0">
                  <variable>hsc0</variable>
                  <action>save:hsc0</action>
                  <action>refresh:nbk'$f'</action>
                  <output file>inputfile</output>
               </hscale>
               <notebook show-tabs="false">
                  '"$(funcnbkCreate $f)"'
               </notebook>
            </vbox>'
      elif [ $f -eq 3 ]; then
         echo '<vbox>
               <timer visible="false">
                  <action>refresh:nbk'$f'</action>
               </timer>
               <notebook show-tabs="false" show-border="false">
                  '"$(funcnbkCreate $f)"'
               </notebook>
            </vbox>'
      fi
      echo '</hbox>
         </vbox>
         <hseparator></hseparator>
         <hbox>
            <button use-stock="true" label="gtk-go-back">'
      if [ $f -eq 0 ]; then
         echo '<sensitive>false</sensitive>
               <action>""</action>'
      else
         echo '<action>echo '$(($f - 1))' > inputfile</action>
               <action>refresh:nbkMain</action>'
      fi
      echo '</button>
            <button use-stock="true" label="gtk-go-forward">'
      if [ $f -eq 3 ]; then
         echo '<sensitive>false</sensitive>
               <action>""</action>'
      else
         echo '<action>echo '$(($f + 1))' > inputfile</action>
               <action>refresh:nbkMain</action>'
      fi
      echo '</button>
            <button ok></button>
         </hbox>
      </vbox>'
   done
}

echo 0 > inputfile

export MAIN_DIALOG='
<window title="nbkNotebook" resizable="false">
   <vbox>
      <notebook show-tabs="false" show-border="false">
         '"$(funcnbkMainCreate)"'
         <variable>nbkMain</variable>
         <input file>inputfile</input>
      </notebook>
    </vbox>
   <action signal="hide">exit:Exit</action>
</window>
'
# Uncomment the following line to dump MAIN_DIALOG to a file:
# ifs=$IFS; IFS=; echo $MAIN_DIALOG > nbkNotebook.txt; IFS=$ifs

$GTKDIALOG --center --program=MAIN_DIALOG

Regards,
Thunor

Last edited by thunor on Sat 20 Aug 2011, 06:16; edited 3 times in total
Back to top
View user's profile Send private message Visit poster's website 
8-bit


Joined: 03 Apr 2007
Posts: 3382
Location: Oregon

PostPosted: Tue 16 Aug 2011, 18:26    Post subject:  

I am now confused. Where in the notebook_widget_example is the compressed data stored?
And what procedure is used to compress and store it?

I ask because I know I copied the example and made it executable and did not see where and how that extra MAIN_DIALOG data was stored or how it was created.

If the methodology is known, it could help in making gtkdialog applications for puppy smaller.
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: Tue 16 Aug 2011, 19:44    Post subject:  

thunor wrote:
jpeps wrote:
Is there no way to add a filter to gtk-open "fileselect" for specific filetypes?

Hi jpeps

I'll look into it (issue 23)

Regards,
Thunor


http://developer.gnome.org/gtk/2.24/GtkFileChooser.html#gtk-file-chooser-set-filter

Edited for clarity:
The filters have been in gtk since 2.4 ... gtkdialog development all but stopped right around then

Should that be an extra tag or just a value such as filter="*.mp3" within the fselect tag?

_________________
Web Programming - Pet Packaging 100 & 101

Last edited by technosaurus on Tue 16 Aug 2011, 23:00; edited 1 time in total
Back to top
View user's profile Send private message 
seaside

Joined: 11 Apr 2007
Posts: 887

PostPosted: Tue 16 Aug 2011, 20:45    Post subject:  

I remember trying
Code:
<action type="fileselect" filter="*.sfs">FILE_FILENAME</action>
and it didn't work

Maybe another way?

Cheers,
s
Back to top
View user's profile Send private message 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Tue 16 Aug 2011, 22:12    Post subject:  

[quote="technosaurus"]
thunor wrote:
jpeps wrote:
Is there no way to add a filter to gtk-open "fileselect" for specific filetypes?



Would that be an extra tag or just a value such as filter="*.mp3" within the fselect tag?


I'd be content with anything that works. I tried workarounds like comboboxes that load files from a script....but the list has to be set before gtkdialog runs.
Back to top
View user's profile Send private message 
scsijon

Joined: 23 May 2007
Posts: 1047
Location: the australian mallee

PostPosted: Thu 18 Aug 2011, 01:27    Post subject: @thunor as the guru  

Greetings, have you come across a decently explained Tutorial/Learning Manual for an old-fella to get his head around this gtkdialog stuff anywhere?

Apologies to others if i'm considered offtopic, but when you have a guru, you should use them!

regards with thanks

scsijon
Back to top
View user's profile Send private message Visit poster's website 
don570


Joined: 10 Mar 2010
Posts: 3337
Location: Ontario

PostPosted: Thu 18 Aug 2011, 16:57    Post subject: manual for gtkdialog  

The best written manual is ironically in French
http://www.murga-linux.com/puppy/viewtopic.php?t=40420&sid=5ab3a5aa099029ca552fc612062179c4

I discovered by trying some of it's examples that
it had some dumb errors though.

If I have the time I should try to translate it in English.
I'm currently writing a replacement for the
gmeasures application

For people speaking English the best way is to download
the page by technosaurus
http://www.murga-linux.com/puppy/viewtopic.php?t=45474

and practice the examples.

_________________________________________________
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 18 Aug 2011, 17:32    Post subject: Re: @thunor as the guru  

scsijon wrote:
Greetings, have you come across a decently explained Tutorial/Learning Manual for an old-fella to get his head around this gtkdialog stuff anywhere?

Hi scsijon

You can try this tutorial -> http://pclosmag.com/html/Issues/200910/page21.html

Also take a look at the first page of the Gtkdialog Tips thread -> http://www.murga-linux.com/puppy/viewtopic.php?t=38608

Gtkdialog also comes with plenty of example programs if you download the source code, or browse them here -> http://code.google.com/p/gtkdialog/source/browse/#svn%2Ftrunk%2Fexamples

That's plenty for you to play with Smile

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

Joined: 23 May 2007
Posts: 1047
Location: the australian mallee

PostPosted: Thu 18 Aug 2011, 20:37    Post subject:  

thank you
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: Fri 19 Aug 2011, 09:00    Post subject:  

I've refactored (code reorganisation) the button widget and fixed an issue that's annoyed me for some time: "use-underline" not working with buttons created from a <label> plus <input file stock/icon="image">.

This will now work as expected:
Code:
<button use-underline="true">
   <label>"_Close"</label>
   <input file stock="gtk-close"></input>
</button>

Everything else was fine; I just wanted to fix that.

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


Joined: 29 Mar 2006
Posts: 5753
Location: Valåmoen, Norway

PostPosted: Fri 19 Aug 2011, 12:15    Post subject:  

Thunor
An error has slipped into the gtkdialog code. The launch signal crashes the gui if there exist a menu. Remove the menu, and everything works as expected.
This makes apps like pTiming in Puppy Slacko useless.
I have made a test script:
Code:
#!/bin/sh

export DIALOG='
<variable>DIALOG</variable>
<vbox>
 <text><label>Another dialog.</label></text>
</vbox>'

export MAIN_DIALOG='
<vbox>
 <menubar>
  <menu>
   <menuitem><label>item1</label></menuitem>
   <menuitem><label>item2</label></menuitem>
   <label>menu</label>
  </menu>
 </menubar>
 <hbox>
  <button>
   <label>"
   Launch another dialog.
   This does not work if menu widget is used.
   "</label>
   <action type="launch">DIALOG</action>
  </button>
 </hbox>
</vbox>'

gtkdialog -p MAIN_DIALOG



thunor wrote:
issue 22 (Togglebutton Widget) Status changed by thunor...@hotmail.com - Status: Started
Very Happy Very Happy Very Happy


Sigmund

_________________
Stardust resources
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 13 of 55 [821 Posts]   Goto page: Previous 1, 2, 3, ..., 11, 12, 13, 14, 15, ..., 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.1397s ][ Queries: 13 (0.0175s) ][ GZIP on ]