comp.lang.ada
 help / color / mirror / Atom feed
* A Gtk/GtkAda and Glade question
@ 2020-04-27 12:16 ldries46
  2020-05-09 15:06 ` mgr
  0 siblings, 1 reply; 5+ messages in thread
From: ldries46 @ 2020-04-27 12:16 UTC (permalink / raw)


I like the principal of Glade and the way the GUI works but the way it 
interfaces with an ADA program I don't like. In one of the older 
versions of Glade you can have an Ada output now you only can have an 
XML output.
That means that if you have standard packages with dialog's that they 
need to have their own .glade file. So you need several GtkBuilder 
statements with their own pointer to a .glade file at different 
positions on your computer.
Another problem I encountered is that you have for your program constant 
strings in your GUI and I do want variables in that positions to change 
the look of my GUI by a simple redraw action. One reason is that I want 
to create a multi language program So I need for instance the menu to be 
possible in several languages (f.i. English, Dutch, German, French and 
Spanish) and just switch these languages with one redraw. I can do that 
when I do not use the GtkBuilder statement.
I am busy to prepare a program that can create from a .glade file an Ada 
Package for initiation of the GUI but I cannot find the necessary 
documentation on the XML for the .glade file. I need to know which 
objects, properties and signals are possible and the parameters they 
need. And if possible the Gtk Statements they must create.
Can anyone tell me where to find them. I have already tried to find a 
way via Gate3 but that was also not a way I could go

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: A Gtk/GtkAda and Glade question
  2020-04-27 12:16 A Gtk/GtkAda and Glade question ldries46
@ 2020-05-09 15:06 ` mgr
  2020-05-13  7:04   ` ldries46
  0 siblings, 1 reply; 5+ messages in thread
From: mgr @ 2020-05-09 15:06 UTC (permalink / raw)


On 27/4/20 14:16, ldries46 wrote:
 > Another problem I encountered is that you have for your program constant
 > strings in your GUI and I do want variables in that positions to change
 > the look of my GUI by a simple redraw action. One reason is that I want
 > to create a multi language program So I need for instance the menu to be
 > possible in several languages (f.i. English, Dutch, German, French and
 > Spanish) and just switch these languages with one redraw. I can do that
 > when I do not use the GtkBuilder statement.

You should look for gettext library support in Glade and the gtkada.intl 
package (which is a binding to the former). I haven't tried it, but 
interfaces produced by Glade should be translatable using gettext files.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: A Gtk/GtkAda and Glade question
  2020-05-09 15:06 ` mgr
@ 2020-05-13  7:04   ` ldries46
  2020-05-13  8:18     ` Dmitry A. Kazakov
  0 siblings, 1 reply; 5+ messages in thread
From: ldries46 @ 2020-05-13  7:04 UTC (permalink / raw)
  To: mgr

Op 9-5-2020 om 17:06 schreef mgr:
> On 27/4/20 14:16, ldries46 wrote:
> > Another problem I encountered is that you have for your program 
> constant
> > strings in your GUI and I do want variables in that positions to change
> > the look of my GUI by a simple redraw action. One reason is that I want
> > to create a multi language program So I need for instance the menu 
> to be
> > possible in several languages (f.i. English, Dutch, German, French and
> > Spanish) and just switch these languages with one redraw. I can do that
> > when I do not use the GtkBuilder statement.
>
> You should look for gettext library support in Glade and the 
> gtkada.intl package (which is a binding to the former). I haven't 
> tried it, but interfaces produced by Glade should be translatable 
> using gettext files.
I am glad somebody answered. I could not find the listing of gettext but 
I suspect that the answer is not inside that listings. I just want to 
know all the possibilities and where applicable for lines like:
  <object class="GtkBox" id="box1">
  <property name="visible">True</property>
  <signal name="activate" handler="On_New" swapped="no"/>
I just found three different types of lines that matter. I think that I 
have found all object class names like "GtkBox" here but of the property 
name I need far more as which is the case with signal name.
I need the complete set of each of the different types an if there are 
more events like object class etc.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: A Gtk/GtkAda and Glade question
  2020-05-13  7:04   ` ldries46
@ 2020-05-13  8:18     ` Dmitry A. Kazakov
  2020-05-15  9:17       ` ldries46
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry A. Kazakov @ 2020-05-13  8:18 UTC (permalink / raw)


On 2020-05-13 09:04, ldries46 wrote:
> Op 9-5-2020 om 17:06 schreef mgr:
>> On 27/4/20 14:16, ldries46 wrote:
>> > Another problem I encountered is that you have for your program 
>> constant
>> > strings in your GUI and I do want variables in that positions to change
>> > the look of my GUI by a simple redraw action. One reason is that I want
>> > to create a multi language program So I need for instance the menu 
>> to be
>> > possible in several languages (f.i. English, Dutch, German, French and
>> > Spanish) and just switch these languages with one redraw. I can do that
>> > when I do not use the GtkBuilder statement.
>>
>> You should look for gettext library support in Glade and the 
>> gtkada.intl package (which is a binding to the former). I haven't 
>> tried it, but interfaces produced by Glade should be translatable 
>> using gettext files.
> I am glad somebody answered. I could not find the listing of gettext but 
> I suspect that the answer is not inside that listings. I just want to 
> know all the possibilities and where applicable for lines like:
>   <object class="GtkBox" id="box1">
>   <property name="visible">True</property>
>   <signal name="activate" handler="On_New" swapped="no"/>
> I just found three different types of lines that matter. I think that I 
> have found all object class names like "GtkBox" here but of the property 
> name I need far more as which is the case with signal name.
> I need the complete set of each of the different types an if there are 
> more events like object class etc.

It is not properties, it is style properties you are looking for. Style 
properties can be set in a CSS sheet for a class of widgets and for 
individual instances of. It has a quite complex matching algorithm, 
admittedly poorly documented. The CSS sheet is defaulted by GTK per user 
basis. A sheet can be loaded by the GTK application explicitly. The 
widgets get a signal when the style gets changed. For further 
information see:

    https://developer.gnome.org/gtk3/stable/chap-css-overview.html

So, when you create your custom widget, you can define all texts it 
would use as style properties of the widget class. Default these 
properties to English, that will serve as a fallback. Within the widget 
implementation get texts from the corresponding style properties. For 
each locale create a CSS file. Load this file when the language is 
changed. You can also consider setting left-to-right vs. right-to-left, 
if you ever plan Hebrew or Arabic. Of course you can set fonts and 
colors. Alas, you cannot embed images into CSS as you could in GTK 2.x 
RC files, but there is a workaround via icon factory.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: A Gtk/GtkAda and Glade question
  2020-05-13  8:18     ` Dmitry A. Kazakov
@ 2020-05-15  9:17       ` ldries46
  0 siblings, 0 replies; 5+ messages in thread
From: ldries46 @ 2020-05-15  9:17 UTC (permalink / raw)


Op 13-5-2020 om 10:18 schreef Dmitry A. Kazakov:
> On 2020-05-13 09:04, ldries46 wrote:
>> Op 9-5-2020 om 17:06 schreef mgr:
>>> On 27/4/20 14:16, ldries46 wrote:
>>> > Another problem I encountered is that you have for your program 
>>> constant
>>> > strings in your GUI and I do want variables in that positions to 
>>> change
>>> > the look of my GUI by a simple redraw action. One reason is that I 
>>> want
>>> > to create a multi language program So I need for instance the menu 
>>> to be
>>> > possible in several languages (f.i. English, Dutch, German, French 
>>> and
>>> > Spanish) and just switch these languages with one redraw. I can do 
>>> that
>>> > when I do not use the GtkBuilder statement.
>>>
>>> You should look for gettext library support in Glade and the 
>>> gtkada.intl package (which is a binding to the former). I haven't 
>>> tried it, but interfaces produced by Glade should be translatable 
>>> using gettext files.
>> I am glad somebody answered. I could not find the listing of gettext 
>> but I suspect that the answer is not inside that listings. I just 
>> want to know all the possibilities and where applicable for lines like:
>>   <object class="GtkBox" id="box1">
>>   <property name="visible">True</property>
>>   <signal name="activate" handler="On_New" swapped="no"/>
>> I just found three different types of lines that matter. I think that 
>> I have found all object class names like "GtkBox" here but of the 
>> property name I need far more as which is the case with signal name.
>> I need the complete set of each of the different types an if there 
>> are more events like object class etc.
>
> It is not properties, it is style properties you are looking for. 
> Style properties can be set in a CSS sheet for a class of widgets and 
> for individual instances of. It has a quite complex matching 
> algorithm, admittedly poorly documented. The CSS sheet is defaulted by 
> GTK per user basis. A sheet can be loaded by the GTK application 
> explicitly. The widgets get a signal when the style gets changed. For 
> further information see:
>
> https://developer.gnome.org/gtk3/stable/chap-css-overview.html
>
> So, when you create your custom widget, you can define all texts it 
> would use as style properties of the widget class. Default these 
> properties to English, that will serve as a fallback. Within the 
> widget implementation get texts from the corresponding style 
> properties. For each locale create a CSS file. Load this file when the 
> language is changed. You can also consider setting left-to-right vs. 
> right-to-left, if you ever plan Hebrew or Arabic. Of course you can 
> set fonts and colors. Alas, you cannot embed images into CSS as you 
> could in GTK 2.x RC files, but there is a workaround via icon factory.
>
I am just interested in a list of XML- code used in the .glade files and 
Gtk routines they should be translated in. I cannot find this list so 
where can I find it?

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-05-15  9:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-27 12:16 A Gtk/GtkAda and Glade question ldries46
2020-05-09 15:06 ` mgr
2020-05-13  7:04   ` ldries46
2020-05-13  8:18     ` Dmitry A. Kazakov
2020-05-15  9:17       ` ldries46

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox