I am new to Gtk# and Monodevelop. So please forgive the basic-ness of this question. But I am trying to do something really simple – and I can’t seem to do it. Not sure if it matters, but I am developing on Linux
I have a MainWindow which has a button. When I click on this button, I want a custom widget to pop-up
I created a custom widget as a separate project, compile it as a .dll and refer it in the main project
In the main project, I have defined a call-back for button click – loadCustomWidget()
However, the code below does not show the custom-widget on screen
public partial class CustomWidget : Gtk.Bin ; // in the other project
protected void loadCustomWidget() {
Console.WriteLine(" show custom widget ") ;
wg = new CustomWidget() ;
wg.Show() ;
}
The WriteLine() is printed. So I know the call-back is being called. But why isn’t the widget showing on screen?
You need to put the widget into a container, for example add it to your main window.