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, 09:59
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
GtkDialog - tips
Post new topic   Reply to topic View previous topic :: View next topic
Page 60 of 64 [955 Posts]   Goto page: Previous 1, 2, 3, ..., 58, 59, 60, 61, 62, 63, 64 Next
Author Message
afifio

Joined: 26 Oct 2013
Posts: 19

PostPosted: Thu 14 Nov 2013, 08:09    Post subject:  

sunburnt wrote:
XML syntax is another suck arse item. It`s a crappy way to describe anything.


I believe you got it a bit wrong there. XML is THE WAY to describe anything, that is the current common popular belief and practiced successfully almost everywhere. View source of this page and bam, its XML. Even MS in drawn to create XAML.

What interesting about gtkdialog is - the ability to define actions to perform. Most XML dont have this or in limited style using CDATA.

gtkdialog takes the pain away from GTK using XML and I'm trying to take the pain away from XML using gmould. In future, your grandchild might have <make><coffee type=latte></coffee></make> button, and guess what it do ? Laughing Laughing Laughing

Of course, there are other way to describe things, but I think they introduce more complexity.

About GTK sucks, I cant comment, I dont code in it. I never code in GTK, not yet, even its just C. Why bother when you can use XML. Notice that I dont know GTK but still able to build gtk app ? Thats the power of XML.

I believe you can accept these stuff as a game challenge, its more fun that way.
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5037
Location: Arizona, U.S.A.

PostPosted: Thu 14 Nov 2013, 10:35    Post subject:  

Just because it`s popular doesn`t mean it`s better in any way.
Obtuse syntax and too much typing to describe the items.
xml and html just use more text to describe less data and control.

Example`s easier to read, understand, type, and is smaller.
Less typing means fewer errors, people make mistakes.
Easy to read and understand means quicker to find the errors.
Code:
gui='title Example
list
   var LIST
   file /path/file
   click script1
button
   text Do Something
   click script2
button
   cancel'
Back to top
View user's profile Send private message 
Moose On The Loose


Joined: 24 Feb 2011
Posts: 528

PostPosted: Thu 14 Nov 2013, 11:05    Post subject:  

sunburnt wrote:
Just because it`s popular doesn`t mean it`s better in any way.
Obtuse syntax and too much typing to describe the items.
xml and html just use more text to describe less data and control.

Example`s easier to read, understand, type, and is smaller.
Less typing means fewer errors, people make mistakes.
Easy to read and understand means quicker to find the errors.
Code:
gui='title Example
list
   var LIST
   file /path/file
   click script1
button
   text Do Something
   click script2
button
   cancel'


Are you suggesting that a fixed indenting system would be the way to make clear what is going on.

BTW: Languages with default types and no need to explicitly define variables are the source of massive numbers of hard to find errors. They do require less typing but at least they don't lose space craft because of a mistyped "do".

My method of doing gtkdialog scripts is to make functions for the fragments and test them one by one and then combine fragments to make the whole GUI. It is easy to do and does not lead to errors. The only downside is that I have to do just a little more typing. The functions just echo to stdout.

The final mainline code looks a little like this:

Code:

function MakeGUI() {
  Fragment1
  Fragment2
  SomeButtons
  }

DIA=$( MakeGUI )
gtkdialog3 -p DIA


Its all very easy to trouble shoot
Back to top
View user's profile Send private message 
afifio

Joined: 26 Oct 2013
Posts: 19

PostPosted: Thu 14 Nov 2013, 15:46    Post subject:  

sunburnt wrote:
Just because it`s popular doesn`t mean it`s better in any way.
Obtuse syntax and too much typing to describe the items.
xml and html just use more text to describe less data and control.

Code:
gui='title Example
list
   var LIST
   file /path/file
   click script1
button
   text Do Something
   click script2
button
   cancel'


Correct, its more typing, but its the most simplest of code I guess. IMO, XML lose only to direct variable assignment.
Code:
<button>blue</button> vs
button=blue
....but then XML add more flexibility. Flexibility always come with complexity.
Code:
<button align="right">
<text align="left" style="underline">blue</text>
</button>

Now how do you do that in your algo ? even with python style indentation its quite hard to explain I think.

Anyway, want gmould ? (my shameless promo)
It save you from typing Laughing Laughing Laughing
its still in dev but pretty usable now.
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5037
Location: Arizona, U.S.A.

PostPosted: Thu 14 Nov 2013, 18:16    Post subject:  

It`s just an example, there are as many ways to do things as the imagination can muster.
And it is easier on the eyes ( many claim otherwise...), and it`ll do anything xml will do.

Code:
button
   align right
   text blue
   text align left
   text style underline


afifio; I don`t write apps much, a Filer is needed to replace Rox is my only use here.
If time permits I`ll look at it, I`m looking at RSH`s Modularity package at the moment.

Moose; Yes, my dynamic menu loops to make the buttons from lists or files.
Each loop creates code for a complete button. I wrote one in BaCon also.
But it needs to be compiled to work on different Puppies. Too much effort...
GtkDialog`s one saving grace, as only it needs compiling because it reads script.
.

Last edited by sunburnt on Sat 23 Nov 2013, 15:49; edited 1 time in total
Back to top
View user's profile Send private message 
afifio

Joined: 26 Oct 2013
Posts: 19

PostPosted: Thu 14 Nov 2013, 23:13    Post subject:  

A Filer is a file manager isn't it ?

How about xfe ? 3 pane filemanager, require fox toolkit, which is simply another file, the benefits is there are lots of fox program can be run too.

Another shameless plug! Laughing Laughing
gmould now available for download, will require about 5 minutes on 14.4kbps modem.

Requirements:
gtkdialog version 0.8.3 r473M or better
bash and its friends.
https://code.google.com/p/gmould/source/browse/gmould.tar.gz 600kb

git clone https://code.google.com/p/gmould/
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5037
Location: Arizona, U.S.A.

PostPosted: Sat 23 Nov 2013, 04:26    Post subject:  

afifio; Rox is the only filer that recognizes AppDir or RoxApp type no-install packages.

### Problems with the GtkDialog list box.
Code looks good and the output is good also, but it errors:
** (gtkdialog:837): ERROR **: gtkdialog: Error in line 58, near token '<item>': syntax error
/root/0_sda3/AppPkg/tools/ubu_new-build/main-apps-deps.gtkdlg: line 33: 837 Trace/breakpoint trap gtkdialog --program=UBU_GU
Code:
#!/bin/sh
P=`realpath $0`
cd ${P%/*}
List=$(<Ubuntu-Precise-Main_Apps-DB.lst)
Groups=`echo "$List" |sed 's,^.*/ ,    <item>,;s, |.*$,,;s,$,</item>,'`
TITLE=' Ubuntu Package Builder.'
export UBU_GUI='
<window title="'$TITLE'">
<vbox>
<hbox>
  <list>
    <variable>GROUP</variable>
    <width>400</width><height>200</height>
'$Groups'
  </list>
</hbox>
<hbox>
  <button ok></button>
  <button exit></button>
</hbox>
</vbox>
</window>
'
echo -e "$UBU_GUI"
gtkdialog --program=UBU_GUI

And the output, there`s 2 "/" and 1 "'" which I tried removing with no luck.
Code:
<window title=" Ubuntu Package Builder.">
<vbox>
<hbox>
  <list>
    <variable>GROUP</variable>
    <width>400</width><height>200</height>
    <item>Administration Utilities</item>
    <item>Mono/CLI</item>
    <item>Communication Programs</item>
    <item>Databases</item>
    <item>debian-installer udeb packages</item>
    <item>Debug packages</item>
    <item>Development</item>
    <item>Documentation</item>
    <item>Editors</item>
    <item>Electronics</item>
    <item>Embedded software</item>
    <item>Fonts</item>
    <item>Games</item>
    <item>GNOME</item>
    <item>GNU R</item>
    <item>GNUstep</item>
    <item>Graphics</item>
    <item>Ham Radio</item>
    <item>Haskell</item>
    <item>Web Servers</item>
    <item>Interpreters</item>
    <item>Java</item>
    <item>KDE</item>
    <item>Kernels</item>
    <item>Library development</item>
    <item>Libraries</item>
    <item>Lisp</item>
    <item>Language packs</item>
    <item>Mail</item>
    <item>Mathematics</item>
    <item>Miscellaneous</item>
    <item>Network</item>
    <item>Newsgroups</item>
    <item>OCaml</item>
    <item>Old Libraries</item>
    <item>Other OS's and file systems</item>
    <item>Perl</item>
    <item>PHP</item>
    <item>Python</item>
    <item>Ruby</item>
    <item>Science</item>
    <item>Shells</item>
    <item>Sound</item>
    <item>TeX</item>
    <item>Text Processing</item>
    <item>Translations</item>
    <item>Utilities</item>
    <item>Version Control Systems</item>
    <item>Video</item>
    <item>Virtual packages</item>
    <item>Web Software</item>
    <item>X Window System software</item>
    <item>Xfce</item>
    <item>Zope/Plone Framework</item>
  </list>
</hbox>
<hbox>
  <button ok></button>
  <button exit></button>
</hbox>
</vbox>
</window>

Last edited by sunburnt on Sat 23 Nov 2013, 15:50; edited 1 time in total
Back to top
View user's profile Send private message 
afifio

Joined: 26 Oct 2013
Posts: 19

PostPosted: Sat 23 Nov 2013, 06:23    Post subject:  

Code:
#!/bin/sh
P=`realpath $0`
cd ${P%/*}
#List=$(<Ubuntu-Precise-Main_Apps-DB.lst)  --- dont need anymore
#Groups=`echo "$List" |sed 's,^.*/ ,    <item>,;s, |.*$,</item>,'`  --- not work
#Groups=`tr -d | sed  -e i'<item>' -e a'</item>'   Ubuntu-Precise-Main_Apps-DB.lst ` --- works, but newline will screw up the item list
Groups=`cat Ubuntu-Precise-Main_Apps-DB.lst | awk '{print "<item>"$_"</item>"}'`
TITLE=' Ubuntu Package Builder.'
export UBU_GUI='
<window title="'$TITLE'">
<vbox>
<hbox>
  <list>
'$Groups'
    <variable>GROUP</variable>
    <width>400</width><height>200</height>
  </list>
</hbox>
<hbox>
  <button ok></button>
</hbox>
</vbox>
</window>
'
echo -e "$UBU_GUI"
gtkdialog --program=UBU_GUI[quote][/quote]


In curiousity, why you dont use the input file directive ? or treeview widget instead ?
Feeling bored so here the treeview snippet, might want to repair the input file, cause I dont know the path and whats in it. This was generated using gmould of course (another shameless plug LOL )
Code:
<tree icon-name="system-software-update">
   <variable>GROUP</variable>
   <label>Packages</label>
'$Groups'
   <width>200</width>
   <height>100</height>
   <input file>Ubuntu-Precise-Main_Apps-DB.lst</input>
<action>command:echo $GROUP</action>
</tree>


Anyway, I still dont understand the ROX thingy Smile. Using lxpup pcmanfm is good enough for me Smile
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5037
Location: Arizona, U.S.A.

PostPosted: Sat 23 Nov 2013, 15:37    Post subject:  

Thanks afifio; A list was all that`s needed, but the tree ( grid ) may just be a better control.
I`ll give it a go starting with your code example.
The gui will have 3 "listboxes", 1 for each of Ubuntu`s package web pages.
1) App groups, 2) App packages, 3) App deps. And an EditBox for the App Description.
I`ve done this before, but GtkDialog keeps changing so it`s always a new learning experience.
Here`s one line from the Ubuntu Apps DB file.
Code:
gnustep/ GNUstep | gnustep-dl2-postgresql-adaptor | gnustep-dl2-sqlite-adaptor | gorm.app | grr.app | systempreferences.app

Your line doesn`t need the redundant "cat". ( I read the whole file to a var. just once for reuse. )
Code:
Groups=`awk '{print "<item>"$_"</item>"}' Ubuntu-Precise-Main_Apps-DB.lst`

### But as you can see in my post above, the output GtkDialog listbox code looks proper.
.
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5037
Location: Arizona, U.S.A.

PostPosted: Tue 03 Dec 2013, 17:24    Post subject:  

### How to get GtkDialog`s current font.?

I have a "text-size" utility I made from vovchik`s BaCon code to get screen size of text.

I need to get GtkDialog`s current working font, with Bash code hopefully.
.
Back to top
View user's profile Send private message 
Moose On The Loose


Joined: 24 Feb 2011
Posts: 528

PostPosted: Sun 08 Dec 2013, 14:13    Post subject:  

sunburnt wrote:
### How to get GtkDialog`s current font.?

I have a "text-size" utility I made from vovchik`s BaCon code to get screen size of text.

I need to get GtkDialog`s current working font, with Bash code hopefully.
.


GTK2_RC_FILES tells you what to parse to find the font settings
It usually comes from the theme that gets included. In the theme, the default font is usually the only one set.



This is helpful to set the font:
Code:


#########################################################################
#  I add to the GTK styles to control the style of some one the text
#
#   Make the warnings come up red by setting up a style in Gtk that has
#   the text as red
#
#   For the display of data files, I want a mono spaced font
#########################################################################
echo 'style "specialwarning"
  {  fg[NORMAL] = { 1.0, 0, 0 } }
  widget "*warning" style "specialwarning"
  class "GtkText*" style "specialwarning"
style "specialmono"
  {  font = "mono 12" }
  widget "*mono" style "specialmono"
  class "GtkText*" style "specialmono"' > /tmp/gtkrc_fft

#  This is where GTK looks
GTK2_RC_FILES=/tmp/gtkrc_fft:/root/.gtkrc-2.0

Use like this
Code:

echo "<text name=\"mono\" xalign=\"0\" use-markup=\"true\">"
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5037
Location: Arizona, U.S.A.

PostPosted: Sun 08 Dec 2013, 14:24    Post subject:  

Thanks Moose; Looking at it...
Puppy has no: /tmp/gtkrc_fft
And: /root/.gtkrc-2.0 is an empty file.
Back to top
View user's profile Send private message 
koulaxizis


Joined: 17 Jul 2011
Posts: 428
Location: Greece

PostPosted: Mon 09 Dec 2013, 14:56    Post subject:  

Is it possible in a combobox when selecting an <item> to have a different action than reading the exact word written inside? For example: when selecting <item>hello</item>, the script will actually read/use <item>hello</item>. But i want to select <item>Greek</item> and use on the final output "el", not "Greek". I want to do that so i can change the ugly language shortcut code (eg "el) with the whole word (Greek) but on the final output it must be used the shortcut (el) for the command to work properly... I hope you understood what i mean, my English are not too good... :/

Here is the whole code to help you understand what i mean...

Code:
#!/bin/sh

export TEXTDOMAIN=find-subtitles
export OUTPUT_CHARSET=UTF-8

: ${GTKDIALOG:=gtkdialog}

export MAIN_DIALOG="
<window title=\"$(gettext 'Find Subtitles')\" window_position=\"1\" icon-name=\"gtk-bold\">

<vbox>
<notebook labels=\"$(gettext 'OpenSubtitles')|$(gettext 'MySubtiles')|$(gettext 'Subs4movies')|$(gettext 'AllSubs')\">

<vbox>
<hbox>
<text space-expand=\"false\" space-fill=\"false\">
 <label>$(gettext 'Preferred interface')</label>
</text>
<hbox space-expand=\"true\" space-fill=\"true\"><text><label>\"\"</label></text></hbox>
<comboboxtext space-expand=\"false\" space-fill=\"false\" tooltip-text=\"$(gettext 'The language used to display search results and information')\">
<variable>COMBOBOX0</variable>
<item>el</item>
<item>ar</item>
<item>cs</item>
<item>et</item>
<item>fi</item>
<item>he</item>
<item>hu</item>
<item>it</item>
<item>km</item>
<item>ms</item>
<item>oc</item>
<item>pt</item>
<item>si</item>
<item>sq</item>
<item>th</item>
<item>uk</item>
<item>bg</item>
<item>da</item>
<item>en</item>
<item>eu</item>
<item>fr</item>
<item>hi</item>
<item>id</item>
<item>ja</item>
<item>ko</item>
<item>nl</item>
<item>pb</item>
<item>ro</item>
<item>sk</item>
<item>sr</item>
<item>tl</item>
<item>vi</item>
<item>ca</item>
<item>de</item>
<item>es</item>
<item>fa</item>
<item>gl</item>
<item>hr</item>
<item>is</item>
<item>ka</item>
<item>mk</item>
<item>no</item>
<item>pl</item>
<item>ru</item>
<item>sl</item>
<item>sv</item>
<item>tr</item>
<item>zh</item>
</comboboxtext>
</hbox>
<hbox>
<text space-expand=\"false\" space-fill=\"false\">
 <label>$(gettext 'Preferred language')</label>
</text>
<hbox space-expand=\"true\" space-fill=\"true\"><text><label>\"\"</label></text></hbox>
<comboboxtext space-expand=\"false\" space-fill=\"false\" tooltip-text=\"$(gettext 'The language the subtitles should be in')\">
<variable>COMBOBOX2</variable>
<item>all</item>
<item>ell</item>
<item>afr</item>
<item>alb</item>
<item>ara</item>
<item>arm</item>
<item>baq</item>
<item>ben</item>
<item>bos</item>
<item>bop</item>
<item>bre</item>
<item>bul</item>
<item>bur</item>
<item>cat</item>
<item>chi</item>
<item>hrv</item>
<item>cze</item>
<item>dan</item>
<item>dut</item>
<item>eng</item>
<item>epo</item>
<item>est</item>
<item>fin</item>
<item>fre</item>
<item>gig</item>
<item>geo</item>
<item>ger</item>
<item>heb</item>
<item>hin</item>
<item>hun</item>
<item>ice</item>
<item>ind</item>
<item>ita</item>
<item>jpn</item>
<item>kaz</item>
<item>khm</item>
<item>kor</item>
<item>lav</item>
<item>lit</item>
<item>ltz</item>
<item>mac</item>
<item>may</item>
<item>mal</item>
<item>mon</item>
<item>mne</item>
<item>nor</item>
<item>oci</item>
<item>per</item>
<item>pol</item>
<item>por</item>
<item>rum</item>
<item>rus</item>
<item>scc</item>
<item>sin</item>
<item>slo</item>
<item>slv</item>
<item>spa</item>
<item>swa</item>
<item>swe</item>
<item>syr</item>
<item>tgl</item>
<item>tam</item>
<item>tel</item>
<item>tha</item>
<item>tur</item>
<item>ukr</item>
<item>urd</item>
<item>vie</item>
</comboboxtext>
</hbox>
<hbox>
<text space-expand=\"false\" space-fill=\"false\">
 <label>$(gettext 'Series/movie title:')</label>
</text>
<entry tooltip-text=\"$(gettext 'Copy-paste the file name or type the title of the series/movie in this box')\" activates-default=\"true\" space-expand=\"true\">
<variable>ent1</variable>
</entry>
</hbox>
<hbox>
<button tooltip-text=\"$(gettext 'Get subtitles')\" can-default=\"true\" has-default=\"true\">
<input file icon=\"gtk-ok\"></input>
<label>$(gettext 'Search')</label>
<action>defaultbrowser \"http://www.opensubtitles.org/\$COMBOBOX0/search/sublanguageid-\$COMBOBOX2/moviename-\$ent1\" &</action>
<action>exit:EXIT</action>
</button>
<button tooltip-text=\"$(gettext 'Exit program')\">
<label>$(gettext 'Cancel')</label>
<input file stock=\"gtk-cancel\"></input>
<action>exit:ABORT</action>
</button>
</hbox>
</vbox>

<vbox>
<hbox>
<text space-expand=\"false\" space-fill=\"false\">
 <label>$(gettext 'Preferred interface')</label>
</text>
<hbox space-expand=\"true\" space-fill=\"true\"><text><label>\"\"</label></text></hbox>
<comboboxtext space-expand=\"false\" space-fill=\"false\" tooltip-text=\"$(gettext 'The language used to display search results and information')\">
<variable>COMBOBOX1</variable>
<item>en</item>
</comboboxtext>
</hbox>
<hbox>
<text space-expand=\"false\" space-fill=\"false\">
 <label>$(gettext 'Preferred language')</label>
</text>
<hbox space-expand=\"true\" space-fill=\"true\"><text><label>\"\"</label></text></hbox>
<comboboxtext space-expand=\"false\" space-fill=\"false\" tooltip-text=\"$(gettext 'The language the subtitles should be in')\">
<variable>COMBOBOX3</variable>
<item>all</item>
<item>en</item>
<item>sq</item>
<item>ar</item>
<item>hy</item>
<item>bg</item>
<item>zh</item>
<item>hr</item>
<item>cs</item>
<item>da</item>
<item>nl</item>
<item>et</item>
<item>fi</item>
<item>fr</item>
<item>ka</item>
<item>de</item>
<item>el</item>
<item>he</item>
<item>hi</item>
<item>hu</item>
<item>it</item>
<item>ja</item>
<item>ko</item>
<item>lv</item>
<item>lt</item>
<item>mk</item>
<item>no</item>
<item>pl</item>
<item>pt</item>
<item>br</item>
<item>ro</item>
<item>ru</item>
<item>sr</item>
<item>sk</item>
<item>sl</item>
<item>es</item>
<item>sv</item>
<item>tr</item>
<item>uk</item>
<item>ve</item>
</comboboxtext>
</hbox>
<hbox>
<text space-expand=\"false\" space-fill=\"false\">
 <label>$(gettext 'Series/movie title:')</label>
</text>
<entry tooltip-text=\"$(gettext 'Type the title of the series/movie in this box (do not copy-paste the file name)')\" activates-default=\"true\" space-expand=\"true\">
<variable>ent2</variable>
</entry>
</hbox>
<hbox>
<button tooltip-text=\"$(gettext 'Get subtitles')\" can-default=\"true\" has-default=\"true\">
<input file icon=\"gtk-ok\"></input>
<label>$(gettext 'Search')</label>
<action>defaultbrowser \"http://www.mysubtitles.com/subtitles/search/\$ent2/\$COMBOBOX3\" &</action>
<action>exit:EXIT</action>
</button>
<button tooltip-text=\"$(gettext 'Exit program')\">
<label>$(gettext 'Cancel')</label>
<input file stock=\"gtk-cancel\"></input>
<action>exit:ABORT</action>
</button>
</hbox>
</vbox>

<vbox>
<hbox>
<text space-expand=\"false\" space-fill=\"false\">
 <label>$(gettext 'Preferred interface')</label>
</text>
<hbox space-expand=\"true\" space-fill=\"true\"><text><label>\"\"</label></text></hbox>
<comboboxtext space-expand=\"false\" space-fill=\"false\" tooltip-text=\"$(gettext 'The language used to display search results and information')\">
<variable>COMBOBOX1</variable>
<item>en</item>
</comboboxtext>
</hbox>
<hbox>
<text space-expand=\"false\" space-fill=\"false\">
 <label>$(gettext 'Preferred language')</label>
</text>
<hbox space-expand=\"true\" space-fill=\"true\"><text><label>\"\"</label></text></hbox>
<comboboxtext space-expand=\"false\" space-fill=\"false\" tooltip-text=\"$(gettext 'The language the subtitles should be in')\">
<variable>COMBOBOX4</variable>
<item>Greek</item>
<item>English</item>
<item>Portuguese-BR</item>
<item>Polish</item>
<item>Romanian</item>
<item>Spanish</item>
<item>Portuguese</item>
<item>French</item>
<item>Turkish</item>
<item>Czech</item>
<item>Bulgarian</item>
<item>Hungarian</item>
<item>Hebrew</item>
<item>Dutch</item>
<item>Serbian</item>
<item>Italian</item>
<item>Finnish</item>
<item>Croatian</item>
<item>Arabic</item>
<item>Slovak</item>
<item>Slovenian</item>
<item>Russian</item>
<item>Swedish</item>
<item>Estonian</item>
<item>German</item>
<item>Bosnian</item>
<item>Danish</item>
<item>Indonesian</item>
<item>Norwegian</item>
<item>Farsi</item>
<item>Chinese</item>
<item>Albanian</item>
<item>Catalan</item>
<item>Vietnamese</item>
<item>Malay</item>
<item>Icelandic</item>
<item>Japanese</item>
<item>Lithuanian</item>
<item>Ukrainian</item>
<item>Korean</item>
<item>Fyrom</item>
<item>Brazilian</item>
<item>Esperanto</item>
<item>Galician</item>
<item>Basque</item>
<item>Latvian</item>
<item>Thai</item>
<item>Sinhalese</item>
<item>Georgian</item>
<item>Hindi</item>
</comboboxtext>
</hbox>
<hbox>
<text space-expand=\"false\" space-fill=\"false\">
 <label>$(gettext 'Series/movie title:')</label>
</text>
<entry tooltip-text=\"$(gettext 'Copy-paste the file name or type the title of the series/movie in this box')\" activates-default=\"true\" space-expand=\"true\">
<variable>ent3</variable>
</entry>
</hbox>
<hbox>
<button tooltip-text=\"$(gettext 'Get subtitles')\" can-default=\"true\" has-default=\"true\">
<input file icon=\"gtk-ok\"></input>
<label>$(gettext 'Search')</label>
<action>defaultbrowser \"http://www.subs4movies.com/search_results.php?qs=\$ent3&qs_lang=\$COMBOBOX4&x=0&y=0\" &</action>
<action>exit:EXIT</action>
</button>
<button tooltip-text=\"$(gettext 'Exit program')\">
<label>$(gettext 'Cancel')</label>
<input file stock=\"gtk-cancel\"></input>
<action>exit:ABORT</action>
</button>
</hbox>
</vbox>

<vbox>
<hbox>
<text space-expand=\"false\" space-fill=\"false\">
 <label>$(gettext 'Preferred interface')</label>
</text>
<hbox space-expand=\"true\" space-fill=\"true\"><text><label>\"\"</label></text></hbox>
<comboboxtext space-expand=\"false\" space-fill=\"false\" tooltip-text=\"$(gettext 'The language used to display search results and information')\">
<variable>COMBOBOX5</variable>
<item>en</item>
</comboboxtext>
</hbox>
<hbox>
<text space-expand=\"false\" space-fill=\"false\">
 <label>$(gettext 'Preferred language')</label>
</text>
<hbox space-expand=\"true\" space-fill=\"true\"><text><label>\"\"</label></text></hbox>
<comboboxtext space-expand=\"false\" space-fill=\"false\" tooltip-text=\"$(gettext 'The language the subtitles should be in')\">
<variable>COMBOBOX5</variable>
<item>en</item>
<item>sq</item>
<item>ar</item>
<item>hy</item>
<item>bg</item>
<item>zh</item>
<item>hr</item>
<item>cs</item>
<item>da</item>
<item>nl</item>
<item>et</item>
<item>fi</item>
<item>fr</item>
<item>ka</item>
<item>de</item>
<item>el</item>
<item>he</item>
<item>hi</item>
<item>hu</item>
<item>it</item>
<item>ja</item>
<item>ko</item>
<item>lv</item>
<item>lt</item>
<item>mk</item>
<item>no</item>
<item>pl</item>
<item>pt</item>
<item>br</item>
<item>ro</item>
<item>ru</item>
<item>sr</item>
<item>sk</item>
<item>sl</item>
<item>es</item>
<item>sv</item>
<item>tr</item>
<item>uk</item>
<item>ve</item>
</comboboxtext>
</hbox>
<hbox>
<text space-expand=\"false\" space-fill=\"false\">
 <label>$(gettext 'Series/movie title:')</label>
</text>
<entry tooltip-text=\"$(gettext 'Type the title of the series/movie in this box (do not copy-paste the file name)')\" activates-default=\"true\" space-expand=\"true\">
<variable>ent4</variable>
</entry>
</hbox>
<hbox>
<button tooltip-text=\"$(gettext 'Get subtitles')\" can-default=\"true\" has-default=\"true\">
<input file icon=\"gtk-ok\"></input>
<label>$(gettext 'Search')</label>
<action>defaultbrowser \"http://www.allsubs.org//search-subtitle/\$ent4+\$COMBOBOX5/50\" &</action>
<action>exit:EXIT</action>
</button>
<button tooltip-text=\"$(gettext 'Exit program')\">
<label>$(gettext 'Cancel')</label>
<input file stock=\"gtk-cancel\"></input>
<action>exit:ABORT</action>
</button>
</hbox>
</vbox>

</notebook>
</vbox>
</window>
"

$GTKDIALOG -p MAIN_DIALOG

_________________
Christos Koulaxizis
Woof woof from Greece...

[ Puppy packages | Puppy search ]
Back to top
View user's profile Send private message Visit poster's website 
don570


Joined: 10 Mar 2010
Posts: 3337
Location: Ontario

PostPosted: Mon 09 Dec 2013, 17:00    Post subject: gettext  

When I wrote the gettext version of Baconrecorder
I believe I wrote the combobox items with gettext translations.
You can open the script up and see.

Wave
MP3 stereo
MP3 Mono

or 'case' command could convert

Greek) LANGUAGE=el
;;
German) LANGUAGE=de
;;
esac
__________________________________________

Code:

  case  $variable-name  in
                pattern1)       
               command1
                    ...
                    ....
                    commandN
                    ;;
                pattern2)
               command1
                    ...
                    ....
                    commandN
                    ;;           
                patternN)       
               command1
                    ...
                    ....
                    commandN
                    ;;
                *)             
          esac
Back to top
View user's profile Send private message 
koulaxizis


Joined: 17 Jul 2011
Posts: 428
Location: Greece

PostPosted: Mon 09 Dec 2013, 17:40    Post subject: Re: gettext  

don570 wrote:
When I wrote the gettext version of Baconrecorder
I believe I wrote the combobox items with gettext translations.
You can open the script up and see.

Wave
MP3 stereo
MP3 Mono

or 'case' command could convert

Greek) LANGUAGE=el
;;
German) LANGUAGE=de
;;
esac
__________________________________________

Code:

  case  $variable-name  in
                pattern1)       
               command1
                    ...
                    ....
                    commandN
                    ;;
                pattern2)
               command1
                    ...
                    ....
                    commandN
                    ;;           
                patternN)       
               command1
                    ...
                    ....
                    commandN
                    ;;
                *)             
          esac


I'll give it a try! Thank you! Smile

_________________
Christos Koulaxizis
Woof woof from Greece...

[ Puppy packages | Puppy search ]
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 60 of 64 [955 Posts]   Goto page: Previous 1, 2, 3, ..., 58, 59, 60, 61, 62, 63, 64 Next
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.2032s ][ Queries: 12 (0.0176s) ][ GZIP on ]