[Glade-devel] Glade-3 bug, or wrong understanding of what should happen ?



... meaning the property "stock" would actually better be removed from 
gtk+.xml for glade-widget-class GtkButton, not to confuse the users ? 
Minor improvement, OK, but still an improvement IMHO.

Then again I fail to find where the sensitivity is set to FALSE for the 
"stock" property :
$ grep -i -n 'glade_widget_property_set_sensitive' *.[ch] | grep stock
glade-gtk.c:3078:               glade_widget_property_set_sensitive 
(gwidget, "stock", TRUE, NULL);
glade-gtk.c:3239:       glade_widget_property_set_sensitive (gwidget, 
"glade-stock", FALSE,
glade-gtk.c:4492:       glade_widget_property_set_sensitive (gbutton, 
"glade-stock", FALSE,
glade-gtk.c:4506:                       
glade_widget_property_set_sensitive (gbutton, "glade-stock",

What am I missing ? Is there some other mechanism that sets the 
GtkButton's "stock" property's sensitivity to FALSE ? Forgive me my 
curiosity, but I'd like to understand the inner workings of glade (and 
it's mechanisms making it work the way it works)...

Kind regards,

PhB

Tristan Van Berkom wrote:

Philippe Bertin wrote:

Hello,

I am trying to understand why in glade-3, for a GtkButton, in the 
Properties window, the tooltip shows wrongly for the property 'stock 
button' : it shows the text "This only applies with stock type 
buttons". This seems to be coming from glade-gtk.c, line 2951. 
However, in gtk+.xml there is an apparent 'override' (?) :

<glade-widget-class name="GtkButton" generic-name="button" 
title="Button">
...
   <property save="False" id="stock" name="Stock Button">
     <spec>glade_standard_stock_spec</spec>
     <tooltip>The stock item for this button</tooltip>
     <set-function>glade_gtk_button_set_stock</set-function>
   </property>
...
So one would expect the tooltip to textually read "The stock item for 
this button". How come it doesn't read like it ? Because if one looks 
in glade-3 some properties further down, the property called 
"response-id" is correctly reflected in glade-3 (according to 
gtk+.xml's contents) :
   <property ignore="True" id="response-id" default="0" 
common="False" name="Response ID">
     <spec>glade_standard_int_spec</spec>
     <tooltip>The response ID of this button in a dialog (it's NOT 
useful if this button is not in a GtkDialog)</tooltip>
   </property>

Is this a bug ? Or is this some combination of tags (and their 
values) that makes the gtk+.xml- file's text not to be considered ? 
If it is a bug, where is it eventually to be corrected (knowing it 
may eventually make me find new similar bugs) ? Where is this 
behaviour described ?

Its not a bug - currently we use a mechanism that allows us to
make some properties insensitive - and we use an "insensitive tooltip"
override to communicate the reason to the user, agreed that
both informations should be available to the user, maybe we can
improve that somehow when we rework the property editor.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]