Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

They can always run stderr through uniq. :-) -- Larry Wall in <199704012331.PAA16535@wall.org>


devel / comp.lang.ada / GtkAda Buttons

SubjectAuthor
* GtkAda ButtonsAdaMagica
`- Re: GtkAda ButtonsDmitry A. Kazakov

1
GtkAda Buttons

<a8abb9c1-0b52-4d08-bade-d74b2a65114bn@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5716&group=comp.lang.ada#5716

 copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:135c:: with SMTP id c28mr26590982qkl.18.1629815814607; Tue, 24 Aug 2021 07:36:54 -0700 (PDT)
X-Received: by 2002:a25:4090:: with SMTP id n138mr18446153yba.339.1629815814448; Tue, 24 Aug 2021 07:36:54 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.usenet.farm!feed.usenet.farm!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Tue, 24 Aug 2021 07:36:54 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=94.31.103.138; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf
NNTP-Posting-Host: 94.31.103.138
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a8abb9c1-0b52-4d08-bade-d74b2a65114bn@googlegroups.com>
Subject: GtkAda Buttons
From: christ-u...@t-online.de (AdaMagica)
Injection-Date: Tue, 24 Aug 2021 14:36:54 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 15
 by: AdaMagica - Tue, 24 Aug 2021 14:36 UTC

Dear all,

GtkAda is a big mess. There is no real documentation. Neither the GtkAda_UG nor the GtkAda_RM are a real help.

My present problem:

What is the use of
procedure Set_Action_Name
(Self : not null access Gtk_Button_Record;
Action_Name : UTF8_String);

I am unable to find a documentation of this procedure. If I call it for a button, the callback does no longer work.

Gtk.Button.Gtk_New (XXX, Name);
Gtk.Button.Set_Action_Name (XXX, "yyy");

Re: GtkAda Buttons

<sg31nv$q3m$1@gioia.aioe.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=5717&group=comp.lang.ada#5717

 copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!Hx95GBhnJb0Xc8StPhH8AA.user.46.165.242.91.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: GtkAda Buttons
Date: Tue, 24 Aug 2021 17:03:28 +0200
Organization: Aioe.org NNTP Server
Message-ID: <sg31nv$q3m$1@gioia.aioe.org>
References: <a8abb9c1-0b52-4d08-bade-d74b2a65114bn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="26742"; posting-host="Hx95GBhnJb0Xc8StPhH8AA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Tue, 24 Aug 2021 15:03 UTC

On 2021-08-24 16:36, AdaMagica wrote:

> GtkAda is a big mess.

Yep.

> There is no real documentation. Neither the GtkAda_UG nor the GtkAda_RM are a real help.

They are automatically generated. It is usually better to look the
original GTK documentation. It is not bad just incredibly complicated to
find what you are looking for and understand how it works.

My method:

1. Search the GtkAda body. It will be like this:

procedure Set_Action_Name
(Self : not null access Gtk_Color_Button_Record;
Action_Name : UTF8_String)
is
procedure Internal
(Self : System.Address;
Action_Name : Gtkada.Types.Chars_Ptr);
pragma Import (C, Internal, "gtk_actionable_set_action_name");
Tmp_Action_Name : Gtkada.Types.Chars_Ptr := New_String (Action_Name);
begin
Internal (Get_Object (Self), Tmp_Action_Name);
Free (Tmp_Action_Name);
end Set_Action_Name;

[ AdaCore, why do not you use a local C string on the stack? It is freed
anyway! ]

2. Look for gtk_actionable_set_action_name

This is your starting point since the thing is an "interface" like Ada's
interface.

3. Look which widgets implement the interface.

4. If nothing helps, look in the GTK sources. They are not bad for a C
library.

> My present problem:
>
> What is the use of
> procedure Set_Action_Name
> (Self : not null access Gtk_Button_Record;
> Action_Name : UTF8_String);

https://developer-old.gnome.org/gtk3/stable/GtkActionable.html

> I am unable to find a documentation of this procedure. If I call it for a button, the callback does no longer work.
>
> Gtk.Button.Gtk_New (XXX, Name);
> Gtk.Button.Set_Action_Name (XXX, "yyy");

The button must have an appropriate parent to activate the action on it,
e.g.

https://developer-old.gnome.org/gtk3/stable/GtkApplicationWindow.html

The action name must be registered, known to the parent, it cannot be
any "yyy" and there could be a parameter necessary for pass for the action.

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

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor