bennyboy2791
June 18th, 2009, 08:32 PM
I am using a libglade project in monodevelop.
It builds okay however I cannot for the life of me figure out how to use the press_icon function in C# for a text entry widget. I have the signals all there and the icon has the sensitive property to true. All I want is for it to be able to clear the text entry.
Glade Code:
<widget class="GtkEntry" id="Search">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="activates_default">True</property>
<property name="truncate_multiline">True</property>
<property name="caps_lock_warning">False</property>
<property name="secondary_icon_stock">gtk-clear</property>
<property name="secondary_icon_sensitive">True</property>
<property name="secondary_icon_tooltip_text">Clear</property>
<signal name="changed" handler="OnSearchChanged"/>
<signal name="icon_press" handler="OnSearchClearClick"/>
</widget>C# Code:
public void OnSearchClearClick (object sender, EventArgs e) {
Search.Text = "";
}I'm guessing it's extremely simple.
My second problem is that, in Glade, I've added a volume button. It shows up fine in Glade, but whenever I run the program, I get this "libglade-WARNING **: unknown widget class 'GtkVolumeButton'" which I find silly.
Thanks in advanced!
It builds okay however I cannot for the life of me figure out how to use the press_icon function in C# for a text entry widget. I have the signals all there and the icon has the sensitive property to true. All I want is for it to be able to clear the text entry.
Glade Code:
<widget class="GtkEntry" id="Search">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
<property name="activates_default">True</property>
<property name="truncate_multiline">True</property>
<property name="caps_lock_warning">False</property>
<property name="secondary_icon_stock">gtk-clear</property>
<property name="secondary_icon_sensitive">True</property>
<property name="secondary_icon_tooltip_text">Clear</property>
<signal name="changed" handler="OnSearchChanged"/>
<signal name="icon_press" handler="OnSearchClearClick"/>
</widget>C# Code:
public void OnSearchClearClick (object sender, EventArgs e) {
Search.Text = "";
}I'm guessing it's extremely simple.
My second problem is that, in Glade, I've added a volume button. It shows up fine in Glade, but whenever I run the program, I get this "libglade-WARNING **: unknown widget class 'GtkVolumeButton'" which I find silly.
Thanks in advanced!