summaryrefslogtreecommitdiff
path: root/ldmicro/maincontrols.cpp
diff options
context:
space:
mode:
authorRr422018-06-26 23:21:33 +0530
committerRr422018-06-26 23:21:33 +0530
commitc70ccfc936bdb59c4934111db79ea0205d8c5dc8 (patch)
treec71b91fffe41aaf3efa8bb9ba5df388704520e76 /ldmicro/maincontrols.cpp
parent9673954adfd5a563072e085df5e09d427557466b (diff)
downloadLDMicroGtk-c70ccfc936bdb59c4934111db79ea0205d8c5dc8.tar.gz
LDMicroGtk-c70ccfc936bdb59c4934111db79ea0205d8c5dc8.tar.bz2
LDMicroGtk-c70ccfc936bdb59c4934111db79ea0205d8c5dc8.zip
iolist.cpp ported, io pin selection dialog added.
Diffstat (limited to 'ldmicro/maincontrols.cpp')
-rw-r--r--ldmicro/maincontrols.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/ldmicro/maincontrols.cpp b/ldmicro/maincontrols.cpp
index c24c4af..0deaf73 100644
--- a/ldmicro/maincontrols.cpp
+++ b/ldmicro/maincontrols.cpp
@@ -131,7 +131,6 @@ static int IoListSelectionPoint;
static BOOL IoListOutOfSync;
int IoListHeight;
int IoListTop;
-GtkTreeModel **IoListPtr = (GtkTreeModel**)GTK_TREE_MODEL (IoList);
// whether the simulation is running in real time
static BOOL RealTimeSimulationRunning;
@@ -970,9 +969,10 @@ void RefreshControlsToSettings(void)
GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
- if(gtk_tree_selection_get_selected (selection, IoListPtr, &iter))
+ GtkTreeModel *IoModelPtr;
+ if(gtk_tree_selection_get_selected (selection, &IoModelPtr, &iter))
{
- GtkTreePath *path = gtk_tree_model_get_path ( *IoListPtr , &iter ) ;
+ GtkTreePath *path = gtk_tree_model_get_path ( IoModelPtr, &iter ) ;
ip = gtk_tree_path_get_indices ( path ) ;
i = ip[0];
IoListSelectionPoint = i;
@@ -986,6 +986,7 @@ void RefreshControlsToSettings(void)
h.code = LVN_GETDISPINFO;
h.hlistFrom = IoList;
+ gtk_tree_model_get_iter_first (GTK_TREE_MODEL(IoList), &iter);
for(i = 0; i < Prog.io.count; i++) {
gtk_list_store_append (GTK_LIST_STORE(IoList), &iter);
h.item.iItem = i;
@@ -1065,21 +1066,20 @@ void GenerateIoListDontLoseSelection(void)
int * i ;
IoListSelectionPoint = -1;
-
+
// GtkTreeSelection * tsel = gtk_tree_view_get_selection (tv);
// GtkTreeModel * tm ;
GtkTreePath * path ;
+ GtkTreeModel *IoModelPtr;
GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
-
- if(gtk_tree_selection_get_selected (selection, IoListPtr, &iter))
+ if(gtk_tree_selection_get_selected (selection, &IoModelPtr, &iter))
{
- path = gtk_tree_model_get_path ( *IoListPtr , &iter ) ;
+ path = gtk_tree_model_get_path ( IoModelPtr , &iter ) ;
i = gtk_tree_path_get_indices ( path ) ;
IoListSelectionPoint = i[0];
}
-
// gtk_tree_model_iter_next (GTK_TREE_MODEL(IoList), iter);
// BOOL iter_v = gtk_list_store_iter_is_valid(GTK_LIST_STORE(IoList), iter);
// g_print("iter = %i\n", iter_v);
@@ -1095,7 +1095,6 @@ void GenerateIoListDontLoseSelection(void)
// can't just update the listview index; if I/O has been added then the
// new selection point might be out of range till we refill it
-
IoListOutOfSync = TRUE;
RefreshControlsToSettings();
}