Questions About Customwidgets

Gtk# + MonoDevelop: How to pop-up a custom widget on button click

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?

Installing eventFilter on QListView for indexWidgets

I have a customWidgets with some components (combobox, lineEdit, labels..etc), This customWidget is added to a QListView using setIndexWidget(QModelIndex,QWidget) , My requirement is that when i click any component on the customWidget the QListView item should get selected/focused.

How can I installEventFilter from cutomWidget to QListView, i have installed event filter for the customWidget.


help with mixing widget painting and UDP data transfers in a multi-threaded context

Here is what I need to do.

-I receive log data through a udp connection -I stack relevant data in a qlist -I have a timer running in the main thread that, on timeout, unstacks this data, updates some arrays then calls widget->update -The widget re-implements paintEvent and uses these arrays to draw charts.

What would be the best way to do this in order to not have any bugs.

this task is basically three processes, two of which are done in the main thread

1-I have a qthread that asks for and receives log through udp packets. This thread also stacks the data in a qlist.

2-I have a qtimer that on timeout, unstacks these events, preps the chart arrays and then calls update

3-I have a reimplementation of the paintEvent method on that widget.

I have mutexes to synchronise and protect data. Is this a bad way of doing it? Some suggestion for a "SAFE" way of doing would be appreciated.

On a side note the paintEvent is dont on

Connect custom widget to QWidgetTab for sizing

I'm trying to get every widget to scale with change in window size. I have a main window which has a QTabWidget with a QWidget holder for each tab. I then have a custom widget with a seperate .ui file that I set to fill the QWidget space of the tab. The problem is, I can't get the contents of the QWidget to expand, only the tab and QWidget of the main window. Also, I noticed if i change the ui->setupUi( ) argument for the custom widget from "this" to "parent" the problem is fixed, and the custom widget will scale correctly. The only problem with this is none of the buttons work when I do that. The application output reads out "No Slot" found errors for the buttons. What is the correct way to make this connection?

Edit: Example code

MainWindow:: ...
    //assign customWidget to widget placeholder on tabWidget.
    //holder is just a blank widget set in gridLayout on tab widget.
    CustomWidget * customWidget = new CustomWidget(ui->customWidgetHolder);