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 Sat 30 Aug 2014, 12:31
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 19 of 55 Posts_count   Goto page: Previous 1, 2, 3, ..., 17, 18, 19, 20, 21, ..., 53, 54, 55 Next
Author Message
thunor


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

PostPosted: Tue 30 Aug 2011, 13:31    Post_subject:  

Added tree widget support for inserting stock or theme icons from an input file

From issue 8.

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

inputfilestockCreate() {
   echo "gtk-dialog-authentication | | gtk-dialog-authentication | 2
      gtk-dialog-error | | gtk-dialog-error | 2
      gtk-dialog-info | | gtk-dialog-info | 2
      gtk-dialog-question | | gtk-dialog-question | 2
      gtk-dialog-warning | | gtk-dialog-warning | 2
      gtk-info | | gtk-info | 2
      gtk-new | | gtk-new | 2
      gtk-save | | gtk-save | 2
      gtk-undo | | gtk-undo | 2
      gtk-redo | | gtk-redo | 2
      gtk-open | | gtk-open | 2
      gtk-about | | gtk-about | 2
      gtk-add | | gtk-add | 2
      gtk-apply | | gtk-apply | 2
      gtk-bold | | gtk-bold | 2 " > inputfilestock
}

# NOTE: The following image names should hopefully represent physical
# files that exist upon your computer minus their paths and extensions,
# but if you find them to be missing then substitute them with something
# that you do have within /usr/share/icons or /usr/share/pixmaps.

inputfileiconCreate() {
   echo "gimp | | gimp | 2
      gnumeric | | gnumeric | 2
      geany | | geany | 2
      glade-3 | | glade-3 | 2
      uget-icon | | uget-icon | 2
      viewnior | | viewnior | 2
      xarchive | | xarchive | 2
      scribus | | scribus | 2
      inkscape | | inkscape | 2
      html | | html | 2
      gz | | gz | 2
      top | | top | 2
      midori | | midori | 2
      adblock | | adblock | 2
      abiword | | abiword | 2 " > inputfileicon
}

inputfilestockCreate
inputfileiconCreate

export MAIN_DIALOG='
<window title="tree widget icons from input files" resizable="false">
   <vbox>
      <hbox>
         <frame Stock icons from input file>
            <tree>
               <variable>tre0</variable>
               <label>0 | 1 | 2</label>
               <height>400</height><width>250</width>
               <input file stock_column="0">inputfilestock</input>
            </tree>
         </frame>
         <frame Theme icons from input file>
            <tree>
               <variable>tre1</variable>
               <label>0 | 1 | 2</label>
               <height>400</height><width>250</width>
               <input file icon_column="0">inputfileicon</input>
            </tree>
         </frame>
      </hbox>
      <hbox homogeneous="true">
         <button ok></button>
      </hbox>
   </vbox>
   <action signal="hide">exit:Exit</action>
</window>
'

$GTKDIALOG --program=MAIN_DIALOG

Regards,
Thunor

Edited_time_total
Back to top
View user's profile Send_private_message Visit_website 
01micko


Joined: 11 Oct 2008
Posts: 7794
Location: qld

PostPosted: Tue 30 Aug 2011, 15:42    Post_subject:  

thunor wrote:
[snip]

Mick's menuitems are wrong as you're probably aware. I'll break the bad news to him when he wakes up Wink

Regards,
Thunor


Really? [ Laughing ]

Guess I'll see the right way when I get pmusic-2.0.1 Wink

Cheers!

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send_private_message Visit_website 
thunor


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

PostPosted: Tue 30 Aug 2011, 16:51    Post_subject:  

01micko wrote:
Really? [ Laughing ]

Guess I'll see the right way when I get pmusic-2.0.1 Wink

I'm not focusing primarily on you here OK, but I may as well illustrate how it is recommended to be implemented for the benefit of anyone and everyone.

This is your method:
Code:
<menuitem icon="gtk-undo-ltr" accel-key="0x07a" accel-mods="4">
   <label>'$LOC118'</label>
   <action>. '$APPDIR'/func -undo</action>
   <action>refresh:PLAYLIST</action>
</menuitem>
<menuitem icon="gtk-redo-ltr" accel-key="0x079" accel-mods="4">
   <label>'$LOC119'</label>
   <action>. '$APPDIR'/func -redo</action>
   <action>refresh:PLAYLIST</action>
</menuitem>'


This is the more suitable method:
Code:
<menuitem stock="gtk-undo" label="'$LOC118'" accel-key="0x07a" accel-mods="4">
   <action>. '$APPDIR'/func -undo</action>
   <action>refresh:PLAYLIST</action>
</menuitem>
<menuitem stock="gtk-redo" label="'$LOC119'" accel-key="0x079" accel-mods="4">
   <action>. '$APPDIR'/func -redo</action>
   <action>refresh:PLAYLIST</action>
</menuitem>'

Doing it this way makes GTK+ deal with the left-to-right and right-to-left internationalisation of the icons if applicable. You might be thinking that this isn't going to work because GTK+ will make a stock label "_Undo" and it will, but straight afterwards it will update the label with $LOC118 or $LOC119 and additionally because it was initially a stock label, "use-underline" is already true so you can use underscores in your custom text.

Actually I think that this qualifies as a Gtkdialog Tip Very Happy

Regards,
Thunor
01micko-menuitem-icon-issue.gif
 Description   I added underscores to demonstrate that "use-underline" is automatically true
 Filesize   11.06 KB
 Viewed   1186 Time(s)

01micko-menuitem-icon-issue.gif

Back to top
View user's profile Send_private_message Visit_website 
01micko


Joined: 11 Oct 2008
Posts: 7794
Location: qld

PostPosted: Wed 31 Aug 2011, 02:09    Post_subject:  

Quote:
I'm not focusing primarily on you here OK, but I may as well illustrate how it is recommended to be implemented for the benefit of anyone and everyone.


Smile It's all good.. every bit I learn is great. ..and thanks for the explanation.

Cheers

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send_private_message Visit_website 
zigbert


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

PostPosted: Wed 31 Aug 2011, 02:28    Post_subject:  

I have updated some tricks (and removed some not needed anymore) in the tips thread. Also linked more to Thunors pages.

I tested the new notebook example which has this VERY interesting feature to control the tabs from external wigdets like buttons... With tabs hidden, it really looks like a dynamic gui.
Code:
<notebook show-tabs="false" show-border="false">
But when running the example here, the tabs still shows up.




Sigmund

_________________
Stardust resources
Back to top
View user's profile Send_private_message Visit_website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Wed 31 Aug 2011, 03:45    Post_subject:  

Guys,
I'm pissed off. It is nice that gtkdialog is getting developed, but I was caught unawares.

Ok, there was the bug with password-entry box having invisible text, only two apps needed to be fixed. Although, I still don't see why the original syntax couldn't have continued to be supported.

I released Wary Puppy 5.1.4 a couple of days ago, then yesterday I discovered that Pfind is broken, as the directory-select dialog is broken. I informed zigbert, and he finds the bug and then informs me that this means Pburn, Pmirror and Pbackup are also broken.

Ok, I will bring out an emergency upgrade to Wary Puppy, but I'm not happy.

The 'common' repo currently has gtkdialog revision 224, and that's it. I'm not going to upgrade. If you bring out strict bugfixes for that, fine. Any further development should be in a separate development thread. All apps that are to be publicaly released should be tested to work on the reference gtkdialog as available in the 'common' repo at ibiblio.org.

I don't intend to upgrade gtkdialog again unless there is a very good reason to do so, nor will I upgrade any more apps that use gtkdialog unless they are tested against that version of gtkdialog.

_________________
http://bkhome.org/news/
Back to top
View user's profile Send_private_message Visit_website 
frafa


Joined: 04 Aug 2011
Posts: 10
Location: MONTPELIER

PostPosted: Wed 31 Aug 2011, 04:07    Post_subject:  

@zigbert
Hi
in the example of Thunor only primary tabs are hidden

A simpler example hidden tabs


Code:
#!/bin/bash
export MAIN_DIALOG='<vbox>
<notebook show_tabs="false" page="0" labels="One|Two|Three|Four">

<!-- Tab1 -->
<hbox>
<text label="This is page 0"></text>
</hbox>

<!-- Tab2 -->
<hbox>
<text label="This is page 1"></text>
</hbox>

<!-- Tab3 -->
<hbox>
<text label="This is page 2"></text>
</hbox>

<!-- Tab4 -->
<hbox>
<text label="This is page 3"></text>
</hbox>

<variable>tab_0</variable>
<input file>inputfile</input>
</notebook>

<hbox>
<vbox>
<button  image-position="0" tooltip-text="View tab 0">
<label>View tab 0</label>
<input file stock="gtk-connect"></input>
<action>echo 0 > inputfile</action>
<action>refresh:tab_0</action>
</button>

<button  image-position="0" tooltip-text="View tab 1">
<label>View tab 1</label>
<input file stock="gtk-connect"></input>
<action>echo 1 > inputfile</action>
<action>refresh:tab_0</action>
</button>

<button  image-position="0" tooltip-text="View tab 2">
<label>View tab 2</label>
<input file stock="gtk-connect"></input>
<action>echo 2 > inputfile</action>
<action>refresh:tab_0</action>
</button>

<button  image-position="0" tooltip-text="View tab 3">
<label>View tab 3</label>
<input file stock="gtk-connect"></input>
<action>echo 3 > inputfile</action>
<action>refresh:tab_0</action>
</button>
</vbox>


<vscale height_request="200" range-min="0" range-max="3" value-pos="0"  tooltip-text="vscale change d'\''onglet">
<variable>hsc0</variable>
<output file>inputfile</output>
<action>save:hsc0</action>
<action>refresh:tab_0</action>
</vscale>
</hbox>

</vbox>'
export MAIN_DIALOG="$(sed 's@<!--.*-->@@g' <<<"$MAIN_DIALOG")";
gtkdialog3 --program=MAIN_DIALOG
exit 0
Back to top
View user's profile Send_private_message Visit_website 
zigbert


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

PostPosted: Wed 31 Aug 2011, 05:05    Post_subject:  

BarryK wrote:
Guys,
I'm pissed off.
You have no need to be. This is a development release, and you are the one to choose to include this code. I find it rather ambitious to include 'new' libs/backends in bugfix releases.

I have not used any new gtkdialog features in my scripts else of Pmusic 2 and the latest pprocess (because of much better performance). My intentions is to start using 0.7.21 at once it is released as stable.


Best wishes
Sigmund

_________________
Stardust resources
Back to top
View user's profile Send_private_message Visit_website 
zigbert


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

PostPosted: Wed 31 Aug 2011, 05:09    Post_subject:  

frafa wrote:
@zigbert
Hi
in the example of Thunor only primary tabs are hidden
Embarassed Embarassed Embarassed

Is stupidity a decease Laughing


Thank you for the eureka (and welcome to the forum)
Sigmund

_________________
Stardust resources
Back to top
View user's profile Send_private_message Visit_website 
zigbert


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

PostPosted: Wed 31 Aug 2011, 05:17    Post_subject:  

BarryK wrote:
yesterday I discovered that Pfind is broken, as the directory-select dialog is broken.
Very important. The directory-select dialog is not broken. In fact it is now working. My way of adding too much lines into the xml-code was ignored by gtkdialog-0.7.20. Now my dirty lines actually executes and *ucks up the result.

MY FAULT

I think we should encourage Thunors initiative... which could give Puppy a boost.



Sigmund

_________________
Stardust resources
Back to top
View user's profile Send_private_message Visit_website 
disciple

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

PostPosted: Wed 31 Aug 2011, 05:23    Post_subject:  

Is there a list somewhere of the changes to gtkdialog which require existing code to be updated?
_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send_private_message 
01micko


Joined: 11 Oct 2008
Posts: 7794
Location: qld

PostPosted: Wed 31 Aug 2011, 06:00    Post_subject:  

Barry, Sigmund, Thunor (et al)

The way I see it is that Pere Laszlo's s original gtkdialog is quite buggy and we have been used to coding to suit the bugs. Thankfully we have someone with the ability to fix the bugs and provide us the correct syntax to improve and enhance gtkdialog.

Sure, there is a transitional period where some things may not work as expected. We have been assured that backward compatibility is not broken.. I believe this.. it's our bad ways that are broken Wink .

It's our responsibility as coders to fix what's not right!

I think that it's really important for Puppy's future that gtkdiaog is fixed and further developed.

This is absolutely wonderful work... and who knows (Johnny?), what (Willy?), else (Matty?) might come of it? [subliminal message intended Razz ]

Cheers Smile

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send_private_message Visit_website 
frafa


Joined: 04 Aug 2011
Posts: 10
Location: MONTPELIER

PostPosted: Wed 31 Aug 2011, 06:46    Post_subject:  

Hello,
Just a quick note to thank for all the work Thunor
that it is to debug and develop gtkdialog
Through his work we have a tool that will help make advanced interfaces

Miles thank you for all that work:)
and sorry for my broken English ...
François
Back to top
View user's profile Send_private_message Visit_website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7047
Location: Perth, Western Australia

PostPosted: Wed 31 Aug 2011, 10:11    Post_subject:  

zigbert wrote:
BarryK wrote:
yesterday I discovered that Pfind is broken, as the directory-select dialog is broken.
Very important. The directory-select dialog is not broken. In fact it is now working.


You are playing with words here. Pfind was broken, full stop. The fact that it relied on quirks in an earlier release of gtkdialog is a different matter.

From what I read awhile back, I think that thunor stated that existing scripts would be supported. So, in good faith I started to use the gtkdialog versions from SVN.

Then I got into some pressure to keep upgrading from SVN. It was not just your Pprocess, but also latest Pnethood and Wallpaper that use the new features of gtkdialog. Then I went to revision 224 when it was reported to have fixed a bug introduced in an earlier revision.

I really didn't have much choice but to use the "development version", given that app coders, not just yourself are embracing it.

Yes, I am keen to encourage thunor also, but we have so many scripts out there that use gtkdialog, and we don't know now which of them are now broken. We have only tested some apps. More changes are coming to gtkdialog at a rapid pace, so what else is going to get broken?
That is why I am stopping at revision 224.

_________________
http://bkhome.org/news/
Back to top
View user's profile Send_private_message Visit_website 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Wed 31 Aug 2011, 12:30    Post_subject:  

BarryK wrote:
zigbert wrote:
Very important. The directory-select dialog is not broken. In fact it is now working.


You are playing with words here. Pfind was broken, full stop. The fact that it relied on quirks in an earlier release of gtkdialog is a different matter.


--tough bind for a developer! Recent improvements by Thunor are making gtkdialog FAR more useful in developing new apps. Hopefully it's not too difficult to update apps that relied on bugs.
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 19 of 55 Posts_count   Goto page: Previous 1, 2, 3, ..., 17, 18, 19, 20, 21, ..., 53, 54, 55 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


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