From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!cleanfeed1-a.proxad.net!nnrp3-1.free.fr!not-for-mail From: Thomas Newsgroups: comp.lang.ada Mail-Copies-To: nobody Subject: Re: Gtk.Image.Gtk_Image References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Date: Sat, 26 Mar 2022 02:38:02 +0100 Message-ID: Organization: Guest of ProXad - France NNTP-Posting-Date: 26 Mar 2022 02:38:03 CET NNTP-Posting-Host: 91.175.52.121 X-Trace: 1648258683 news-2.free.fr 4998 91.175.52.121:6705 X-Complaints-To: abuse@proxad.net Xref: reader02.eternal-september.org comp.lang.ada:63652 List-Id: In article , "Dmitry A. Kazakov" wrote: > On 2022-03-25 20:37, Thomas wrote: > > In article , > > "Dmitry A. Kazakov" wrote: > > > >> I am using Gtk_Image in Gtk_Box, it works perfectly well, and worked in > >> GTK 2 (I am using GTK 3). > > > > (Gtk_Pixmap were fully removed from GTK 3) > > It is Gdk_Pixbuf now. > > > afaiu, the specific thing about Gtk_Pixmap is that i need not to call > > Show on it, calling Show on its parent is enough. > > No, I think that pixmap handles the Draw signal, so you do not need Show > because all rendering optimizations are turned off. i don't understand details, but i understand Gtk_Pixmap was badly categorized, it is in fact from Gdk familly. that's why it has not the same behavior than other Gtk Widgets. > > > but, I thought calling Show on a container was recursive on its childs, > > wrong? > > It is recursive, but it affects only actual children. New children are > hidden by default. I think this is going to change in GTK 4. i understand that about mcc.tki.Widget.Picture.Set_Image. but in mcc.tki.Widget.Picture.Create, when i call Gtk.Container.Add, and then Gtk.Widget.Show on the container, it doesn't work. i need to call Gtk.Widget.Show on the image too. (no matter if i don't understand, at least that works :-) but if you have enough patience, i like understand things :-) ) > > > is it ok, or do you think i should avoid it anyway? > > My understanding is that some widgets are optimized not to process > signals from input devices, e.g. Gtk_Label and Gtk_Image. Because > normally, you would not use keyboard or mouse buttons on them. But if > you need that, you add Gtk_Event_Box. If things work without it, then > leave it as is. - i need a container anyway, - there was already a Gtk_Event_Box around the Gtk_Pixmap when i found it, - not sure, but i think that RAPID design allows RAPID users to set handlers on any Widgets, including Picture. so I think it's best to keep Gtk_Event_Box for now. thank you for the thinking :-) > > > if i should avoid it, is there an other Gtk_Bin that i could use, or do > > you think Gtk_Box is the only one i should use for this purpose? > > I think any container is OK. I use Gtk_Box just because I want both > label and icon on the button. ok, you need it but not me. > > Gtk_Fixed is bad because it breaks widget resizing protocol. If you > never resize (e.g. when changing the widget style, fonts, for example) > then Gtk_Fixed is just fine. i don't understand details, but i think since RAPID was designed with Gtk_Fixed I can keep it without inconvenience in the short term. (i plan to make an other design in the medium term.) -- RAPID maintainer http://savannah.nongnu.org/projects/rapid/