From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,20b056211a3391ce X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!k17g2000yqb.googlegroups.com!not-for-mail From: Srini - Newsgroups: comp.lang.ada Subject: Re: GTK strangeness Date: Thu, 1 Oct 2009 06:19:25 -0700 (PDT) Organization: http://groups.google.com Message-ID: <75f68bf9-7647-4b3b-b46a-12bdb4033c31@k17g2000yqb.googlegroups.com> References: <12f2c1f9-9f42-49f8-9a0d-d565d8ddb8be@l13g2000yqb.googlegroups.com> NNTP-Posting-Host: 209.104.243.242 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1254403166 27142 127.0.0.1 (1 Oct 2009 13:19:26 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 1 Oct 2009 13:19:26 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k17g2000yqb.googlegroups.com; posting-host=209.104.243.242; posting-account=mZyFSQoAAABfOmklsh1d8TPbS2LncUKl User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 GTB5,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8558 Date: 2009-10-01T06:19:25-07:00 List-Id: On Oct 1, 3:39 am, "Dmitry A. Kazakov" wrote: > On Wed, 30 Sep 2009 18:52:15 -0700 (PDT), RasikaSriniva...@gmail.com wrote: > > I have a strange situation. > > > I attempt to set the font to a different font than normal. > > > It appears this works fine for gtk.label.gtk_label but > > gtk.button.gtk_button > > > Is this expected? > > That depends on how are you doing what. There are numerous ways of setting > fonts to particular widgets and the font itself as a parameter/property of > the widget can be of different flavors, e.g. a property, a style, a > property style, bare argument of a call, coming with another widget etc. > > > Also I expected that all widgets would inherit some settings like font > > from their container. Is this not so in gtk? > > There is no standard mechanism because of the variety of ways a widget may > decide which font to use. > > Specifically to Gtk_Button, it is a container and the text in it can be any > sort of thing. You can for example create a tree view and put it into the > button. What would be the font? The answer is, that depends on what font > and whom it actually belongs. In this case certainly not to the button. > > In the standard scenario, when the button label is set with Set_Label, the > font is set by the widget style. There are ways to influence that and it > again depends on how are you going to do it (programmatically, using > resource files and schemas etc). Sorry, if that sounds confusing, but it > is. > > OK, I didn't want to leave you with that. (:-)) So here is the most simple > way to set the font programmatically. You create a button (Gtk_Button) with > no text or images. Then you create a label (Gtk_Label) with the desired > font and text. Then put that label into the button, which is a mere bin > container. Here you are. > > If you need an icon too, create a Gtk_HBox put there the label and the > image, put the box into the button. Done. > > -- > Regards, > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de Great. I was using Modify_font which did not work. This technique works great. Perhaps there is a wiki or FAQ dedicated to GtkAda? If not might be worth it. many subtleties. My next question has to do with : - font selection - a. the right way to access fonts installed on a system with and without a selection dialog? for example I want to use Verdana as the font for my dialogs/messages etc. should i look at some mods to pango.aliases file? - File_Selection Dialog My reading of the doc says, I build a dialog based on the file_selection widget. and it does not appear to match the native file_selection dialog. Eg windows or the mac have their own "style" if you will. thanks, srini