Re: auto-generated file 'gtkmm/widget.h' (widget.hg)

2013-08-17 Thread John Emmas

On 16/08/2013 08:05, Kjell Ahlstedt wrote:


I have fixed the bugs in _WRAP_SIGNAL, git commit 
https://git.gnome.org/browse/glibmm/commit/?id=118f894606a1016a15f48a1659ebb29a95f4cdf5.
That version of gmmproc inserts both #ifdef GTKMM_ATKMM_ENABLED and 
#ifndef GTKMM_DISABLE_DEPRECATED at the right locations in both 
widget.h and widget.cc.
Unfortunately it's still not easy to build gtkmm-2.24.4 with that 
newest version of glibmm/gmmproc.




Hi Kjell,

For those of us who are still building version 2, will you be pushing 
your fix to the latest 2.24 branch or should I just apply it locally as 
a patch?  (at the moment, it looks like your fix is only pushed to 
version 3 master).


John
___
gtkmm-list mailing list
gtkmm-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtkmm-list


Re: auto-generated file 'gtkmm/widget.h' (widget.hg)

2013-08-17 Thread John Emmas

On 17/08/2013 08:31, John Emmas wrote:


For those of us who are still building version 2, will you be pushing 
your fix to the latest 2.24 branch or should I just apply it locally 
as a patch?




Oops - forgive my misunderstanding, Kjell.  I assumed this morning that 
your fix was in gtkmm but I just re-read your email and realised that in 
fact, it's in glibmm.  So, armed with that information, I updated glibmm 
to pull in your fix.


Unfortunately, glibmm itself won't build at the moment because of some 
problems in class.h, class.cc and interface.cc (all of them, non 
auto-generated files so I doubt if the problems will be connected to 
Kjell's fix).


In the case of class.h, someone has removed the line #include 
vector.  This means that anything which #includes glibmm/class.h 
won't compile at the moment (because class.h uses std::vector).


Even if I fix that, neither class.cc nor interface.cc will compile. I 
get this error when trying to build with MSVC:-


error C2039: 'properties_type' : is not a member of 'Glib::Class'

That particular error is from line 69 of glibmm/interface.cc. AFAICT the 
line itself hasn't changed recently - so I assume it's the result of a 
header file change somewhere.   Hope someone can make sense of it.!


John
___
gtkmm-list mailing list
gtkmm-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtkmm-list


Re: What is the minimum number of lines to update a gui window without user clicking a button

2013-08-17 Thread L. D. James

On 08/15/2013 08:30 AM, Markus Elfring wrote:

You are telling me to do it a different way and at the same time telling me
how complicated it is.  Without examples of the different way, I don't know
where to start.

I guess that you want to become familiar with a general program structure
together with the GTK+ software. I assume that you want to display some text in
a log window for your use case. Would you like to reuse a list box or table
control? (Do you need any other higher sophisticated widget?)

How fast do you get the needed data for the desired output?

Regards,
Markus

Hi, Markus.

Thanks for the interest and your questions.  I appreciate any feedback.

You're right about my desire to log text in a gui window.  I don't want 
a list box or control widgets in this particular case.  As far as 
sophisticate widgets, I don't want any widgets at all.


I wouldn't mind an exit or close button, but at present the close button 
in the gui window (along with the minimize button) suits my immediate 
needs perfectly.


I had already got a developed a working example with the help of Alan:

Gui Update using the Label Widget:
https://mail.gnome.org/archives/gtkmm-list/2013-August/msg00052.html

It worked perfectly as desired... having only one widget, the label.

However, I decided to change the label widget to the textview widget.  
When I tried to change it, the code was broken at first, because I 
didn't fully understand what needed to be changed.


So, with this thread, I asked for the minimum amount of lines to do the 
same thing, so that I could study the lines and use it as a blank slate 
to build upon.


I eventually started to understand it, with the aid of the input from 
Kjell and change the widget from label to textview.


Now with the 47 lines of code I'm easily able to update a gui window.  
Wile, Chris has insisted there is a problem with the code, I can't 
identify a problem.  As far as I can see it is exactly consistent with 
the HelloWorld tutorial that uses a Button widget. I changed the branch 
that happens with a button click to go directly to the function.  I 
basically renamed the function from void on_button_clicked() to void 
cpp_app().


It's only 47 lines and should be very easy to check.  I can't identify a 
problem with it.  It does perfectly what I was trying to do.


With it having such a few lines I'm able to study each line in detail 
and easily repeat the code.


I'll eventually start to add other sophisticated widgets for other 
applications.  This is easier to do now since I have what I believe is 
the minimum amount of lines to update text to a gui window.


If there's something wrong with my example, I appreciate any comments or 
suggestions.  But if someone says it wrong and use programming terms 
that I don't fully understand, it's not much I can do with it as far as 
change and actually have it continue to perform the desired task (update 
the gui window after running a function).


The current cleaned up code is:
(By the way my programming environment is Ubuntu 13.04/Gtkmm3.0 from the 
repository)


// Code begin: HelloWorld.cpp
// 
#include HelloWorld.h
#include string

using namespace std;

HelloWorld::HelloWorld() : m_textview() {

add(m_textview);
m_textview.show();
Glib::Thread::create(sigc::mem_fun(*this, HelloWorld::cpp_app), true);
}

HelloWorld::~HelloWorld() {
}

void HelloWorld::cpp_app() {
string texttoprint = ;
Glib::RefPtrGtk::TextBuffer m_refTextBuffer;
m_refTextBuffer = Gtk::TextBuffer::create();
string runit(std::string c);

texttoprint +=
About to run a number of c++ functions\nand display the 
results\n;

m_refTextBuffer-set_text(texttoprint);
m_textview.set_buffer(m_refTextBuffer);

sleep(10);  // This sleep function represents any c++ function 
performaing a task


// This represents the resulting text from the function just run
texttoprint += Back from running a short 10 second function;
m_refTextBuffer-set_text(texttoprint);
m_textview.set_buffer(m_refTextBuffer);

sleep(60); // This is an example of a function that is responding 
with text


texttoprint += Just got back from a function that took a minute to 
execute.\n;

m_refTextBuffer-set_text(texttoprint);
m_textview.set_buffer(m_refTextBuffer);
}
// 
// Code end
// Code begin: HelloWorld.h
// 
#ifndef GTKMM_EXAMPLE_HELLOWORLD_H
#define GTKMM_EXAMPLE_HELLOWORLD_H

// #include gtkmm/button.h
// #include gtkmm/window.h
#include gtkmm.h

class HelloWorld: public Gtk::Window {

public:
HelloWorld();
virtual ~HelloWorld();

protected:
//Signal handlers:
// // void on_button_clicked();

//Member widgets:
Gtk::TextView m_textview;
void cpp_app();
};

#endif // GTKMM_EXAMPLE_HELLOWORLD_H
//