Hannu Vuolasaho | 20 May 16:15
Picon
Favicon

Using std string when ustring is not available.


Hello everyone!

I'm thinking of supporting UTF-8 in my small console application and ustring would be quite useful and
using gtkmm there is possibility to add GUI also. However some systems might not have gtkmm installed and
in that case I'd like to fall back to std string.

Is this behaviour achievable some kind of wrapper class easily?
I'm thinking something like:
#ifdef HAVE_GTKMM
class myString: public ustring{
....
#else
class myString:public std::string{
...
#endif
and myString would act like stdstring or ustring.
Or what kind solution would be good?

best regards,
Hannu Vuolasaho
 		 	   		  
Andy Gilman | 16 May 22:07
Favicon

another simple ( I imagine ) problem

I am trying to write an extremely simple program, which will be animated 
by showing an image, then redrawing it one pixel over, etc.

I have followed the clock example in the tutorial with the following 
successes:

the image is displayed.
the timer works
the timer connects to a function (following the clock example),

But I can't figure out how to redraw the image.

Here is the function that I thought would lead to the image disappearing 
(Header is the drawing area):

bool Header::update()
{
Glib::RefPtr<Gdk::Window> win = get_window();
     if (win)
     {
       Gdk::Rectangle r(600, 2, 70,70);// this is the rectangle where 
the image is displayed
       win->invalidate_rect(r, false);
     };
return TRUE;
}

Thanks for any help.

Andy Gilman
(Continue reading)

Luís Vaz | 16 May 15:14
Picon

Re: Immediately updating status bar

Try to iterate Gtk::Main while has pending events...

On 05/16/2012 01:00 PM, gtkmm-list-request <at> gnome.org wrote:
Date: Tue, 15 May 2012 17:08:43 +0200 From: jody <jody.xha <at> gmail.com> To: gtkmm-list <gtkmm-list <at> gnome.org> Subject: Immediately updating status bar Message-ID: <CAKbzMGdUF1JofUySzd734Ud_jsOMdYMSyWAfgZNJ+cHZRzfw9A <at> mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Hi I have a window with some buttons and a status bar. When i click one of the buttons this starts a lengthy operation. I would like to have a message like "loading data..." appear on the status bar as soon as i press the button. This is what i do: void IQWin::on_button_load_data_clicked() { m_Status.push("loading data...");
    while (Gtk::Main::events_pending ())
    {
        Gtk::Main::iteration ();
    }
m_IQScene.loadData(m_txtDataFile.get_text().c_str()); } But that way the message on the status bar only appears when the function has completed (after all the data has been loaded). I guess by starting a thread which does the loading i could solve this problem, but is there a more simple way to do this? Thank You Jody

Luis Vaz

_______________________________________________
gtkmm-list mailing list
gtkmm-list <at> gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list
Basile Starynkevitch | 16 May 14:25

Gtk::Application with a non-unique gtk appl

Hello All,

### context ###
I'm working on the MELT plugin of the GCC compiler, see http://gcc-melt.org/ for more.

I'm adding to MELT the ability to interact with a graphical probe. In broad terms, 
when you invoke the GCC compiler with specific arguments 
  gcc -fplugin=melt -fplugin-arg-melt-mode=probe -c -O your-source.c 
for example, a GTK application is "magically" forked by GCC and communicates with
GCC (actually the cc1 program) to display various information about the compilation.
The probe is communicating thru two textual asynchronous pipes with cc1.

The probe (GPLv3 licensed) is written in C++11 using GtkMM 3.4 & GtkSourcecViewMM; you could find its 
code under contrib/ of the melt-branch of GCC. In particular, see 
http://gcc.gnu.org/viewcvs/branches/melt-branch/contrib/simplemelt-gtkmm-probe.cc

This is a self-contained GtkMM application. A comment near the end of the file shows how to compile it.
The probe is currently in bad state (svn rev 187541); in its previous revision 
svn 187245 it worked a bit better but did not use Gtk::Application but just Gtk::Main..

And my probe GtkMM application wants to parse some arguments, in particular it 
could be invoked by cc1 (thru a user-provided shell script called melt-probe) as
  simple-melt-probe -T --command-from-MELT 5 --request-to-MELT 6 
where 5 is the file descriptor of the pipe from MELT to the probe and 6 
is the file descriptor from the graphical probe to MELT; You might test it
using 0 (for stdin) instead of 5 and 1 (for stdout) instead of 6. The you would
type commands like

   SHOWFILE_pcd "testfile.c" 1

   VERSION_pcd 

   
[notice that commands should be ended by two consecutive newlines]

### question ####
I don't understand exactly when should I use the Gtk::Application class, 
and when should I avoid using it and instead use Gtk::Main which is 
marked as deprecated.

In particular, my application has no "uniqueness" requirement. I would imagine 
that some user might want to run a few processes (e.g. a few "instances") of it 
on the same desktop.

Should I still use Gtk::Application for an application which could have several
(unrelated) processes (all running the same ELF executable)? Or is Gtk::Application 
useless (or even harmful) in that case?

Regards.
--

-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***
jody | 15 May 17:08
Picon

Immediately updating status bar

Hi

I have a window with some buttons and a status bar.
When i click one of the buttons this starts a lengthy operation.
I would like to have a  message like "loading data..." appear
on the status bar as soon as i press the button.

This is what i do:

void IQWin::on_button_load_data_clicked() {
    m_Status.push("loading data...");
    m_IQScene.loadData(m_txtDataFile.get_text().c_str());
}

But that way the message on the status bar only appears when
the function has completed (after all the data has been loaded).

I guess by starting a thread which does the loading i could solve this problem,
but is there a more simple way to do this?

Thank You
  Jody
José Alburquerque | 15 May 01:03
Picon

gstreamermm-0.10.10.2

gstreamermm 0.10.10.2 is now available for download at: http://ftp.gnome.org/pub/GNOME/sources/gstreamermm/0.10/ 9094485085e08c85ef71832555a983e65f020d41b8b3a98d1288b64dace7c0f1  gstreamermm-0.10.10.2.tar.xz General Information =================== gstreamermm provides C++ bindings for the GStreamer streaming multimedia library (http://gstreamer.freedesktop.org). With gstreamermm it is possible to develop applications that work with multimedia in C++. gstreamermm is developed over glibmm, libsigc++ and libxml++ and the functionalities they provide. This means that, among other things, referencing and unreferencing of GObjects is handled automatically via glibmm's automatic pointer class, Glib:RefPtr<>, and libsigc++'s slots are used for callbacks and signals. There are several examples, including a media player, in the examples/ directory, that demonstrate how to use the API and there are API docs in the docs/reference/html directory. The core plug-ins, such as Gst::Identity and Gst::FileSrc are also provided along with many of the base plug-ins. Changes: ======= 0.10.10.2 (unstable): * Plugins: Remove conflict with GStreamer *_get_type() function names. Links ===== git: git://git.gnome.org/gstreamermm http://git.gnome.org/cgit/gstreamermm/ (It's in jhbuild) download: http://ftp.gnome.org/pub/GNOME/sources/gstreamermm/ submit bugs: http://bugzilla.gnome.org/enter_bug.cgi?product=gstreamermm view bugs:   http://bugzilla.gnome.org/buglist.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&product=gstreamermm&content=
-- -- José
_______________________________________________
gnome-announce-list mailing list
gnome-announce-list <at> gnome.org
http://mail.gnome.org/mailman/listinfo/gnome-announce-list
_______________________________________________
gtkmm-list mailing list
gtkmm-list <at> gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list
Arbol One | 14 May 14:54
Picon
Gravatar

Visual Studio and GTKmm-2.4

I have VS11 as my IDE, 'cons Anjuta will never make it to the Win platform. Does anyone know good tutorial about adding working with Visual Studio 11 and GTKmm 2.4?

 

A pessimist is one who makes difficulties of his opportunities and an optimist is one who makes opportunities of his difficulties.

 

_______________________________________________
gtkmm-list mailing list
gtkmm-list <at> gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list
Arbol One | 13 May 14:55
Picon
Gravatar

Uninstalling GTKmm-64

After downloading and installing Glade  from http://ftp.gnome.org/pub/GNOME/binaries/win32/glade3/3.6/, I was unable to run the program 'cos there were some dll files missing, good! I thought, I will uninstall it and continue my development without it. However, after uninstalling Glade, I went back to recompile my GTKmm-64 application, well… Code::Blocks now reports that there are some gtkmm-64's dlls missing. I thought, Glade must've done something wrong when uninstalling, so I proceeded to reinstall gtkmm-64. As we all know before installing, the gtkmm-64 installer first checks for the existence of another gtkmm-64 installation and ask you to uninstall it, I clicked on 'Yes' and so it was done, or at least so I thought. Now, there is no gtkmm-64 in my computer, but the gtkmm-64 installer keeps saying that there is another gtkmm-64 installation and ask for it to be uninstalled, and sure enough it fails uninstalling it… 'cos there is not gtkmm-64.

 

Anyone knows the solution to this problem?

 

 

A pessimist is one who makes difficulties of his opportunities and an optimist is one who makes opportunities of his difficulties.

 

_______________________________________________
gtkmm-list mailing list
gtkmm-list <at> gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list
Kurt Miller | 10 May 23:56

Deadlock in Gst::init()

Using gstreamermm-0.10.10.1 with gstreamer-0.10.36 Gst::init()
indirectly attempts a recursive load of the adder plugin. The
recursive load deadlocks due to the use of a static mutex in
gst_plugin_load_by_name(). This is reproduceable with
subtitleeditor on OpenBSD HEAD/current.

Here is the stack trace showing the recursive call to
gst_plugin_load_by_name():

#2  0x0009c065 in _rthread_mutex_lock (mutexp=0x7c1e6670, trywait=0, abstime=0x0) at /usr/src/lib/librthread/rthread_sync.c:127
#3  0x08c68ec2 in g_mutex_lock () from /usr/local/lib/libglib-2.0.so.3200.0
#4  0x02f1f3e5 in gst_plugin_load_file (filename=0x7c1f6580
"/usr/local/lib/gstreamer-0.10/libgstadder.so", error=0xcfbc0bc8)
    at /usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstplugin.c:722
#5  0x02f2022b in gst_plugin_load_by_name (name=0x7c3c2bf5 "adder") at /usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstplugin.c:1297
#6  0x02f2185d in gst_plugin_feature_load (feature=0x7c3c32e8) at /usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstpluginfeature.c:111
#7  0x0b5e3954 in gst_adder_get_type () at /usr/obj/ports/gstreamermm-0.10.10.1/gstreamermm-0.10.10.1/gstreamer/gstreamermm/adder.cc:29
#8  0x0ff679e1 in plugin_init (plugin=0x7c397d48) at /usr/obj/ports/gst-plugins-base-0.10.36/gst-plugins-base-0.10.36/gst/adder/gstadder.c:1322
#9  0x02f1e6ff in gst_plugin_register_func (plugin=0x7c397d48, desc=0x2ff66020, user_data=0x0)
    at /usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstplugin.c:557
#10 0x02f1f611 in gst_plugin_load_file (filename=0x7c1f6580
"/usr/local/lib/gstreamer-0.10/libgstadder.so", error=0xcfbc0dc8)
    at /usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstplugin.c:843
#11 0x02f2022b in gst_plugin_load_by_name (name=0x7c3c2bf5 "adder") at /usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstplugin.c:1297
#12 0x02f2185d in gst_plugin_feature_load (feature=0x7c3c32e8) at /usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstpluginfeature.c:111
#13 0x0b5e3954 in gst_adder_get_type () at /usr/obj/ports/gstreamermm-0.10.10.1/gstreamermm-0.10.10.1/gstreamer/gstreamermm/adder.cc:29
#14 0x0b624d21 in Gst::wrap_init () at /usr/obj/ports/gstreamermm-0.10.10.1/gstreamermm-0.10.10.1/gstreamer/gstreamermm/wrap_init.cc:386
#15 0x0b6258d0 in initialize_wrap_system () at /usr/obj/ports/gstreamermm-0.10.10.1/gstreamermm-0.10.10.1/gstreamer/gstreamermm/init.cc:36
#16 0x0b625a77 in Gst::init (argc=@0xcfbc0fb4, argv=@0xcfbc0fb8)
    at /usr/obj/ports/gstreamermm-0.10.10.1/gstreamermm-0.10.10.1/gstreamer/gstreamermm/init.cc:53
#17 0x1c01d13c in Glib::PropertyProxy<Glib::ustring>::get_value ()

Here are the debug messages:

GST_INIT /usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gst.c:805:init_post: GLib
runtime version: 2.32.2
GST_INIT /usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gst.c:807:init_post: GLib
headers version: 2.32.2
GST_INIT /usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gst.c:437:gst_init_check:
already initialized gst
GST_REFCOUNTING
/usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstobject.c:311:gst_object_ref:<adder>
0x7c3c32e8 ref 1->2
GST_PLUGIN_LOADING
/usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstpluginfeature.c:106:gst_plugin_feature_load:
loading plugin for feature 0x7c3c32e8; 'adder'
GST_PLUGIN_LOADING
/usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstpluginfeature.c:110:gst_plugin_feature_load:
loading plugin adder
GST_PLUGIN_LOADING
/usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstplugin.c:1293:gst_plugin_load_by_name:
looking up plugin adder in default registry
GST_REFCOUNTING
/usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstobject.c:311:gst_object_ref:<plugin96>
0x7c397d48 ref 1->2
GST_REFCOUNTING
/usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstobject.c:311:gst_object_ref:<plugin96>
0x7c397d48 ref 2->3
GST_REFCOUNTING
/usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstobject.c:337:gst_object_unref:<plugin96>
0x7c397d48 unref 3->2
GST_PLUGIN_LOADING
/usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstplugin.c:1296:gst_plugin_load_by_name:
loading plugin adder from file /usr/local/lib/gstreamer-0.10/libgstadder.so
GST_REFCOUNTING
/usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstobject.c:311:gst_object_ref:<plugin96>
0x7c397d48 ref 2->3
GST_PLUGIN_LOADING
/usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstplugin.c:737:gst_plugin_load_file:
attempt to load plugin "/usr/local/lib/gstreamer-0.10/libgstadder.so"
GST_PLUGIN_LOADING
/usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstplugin.c:834:gst_plugin_load_file:
Plugin 0x7c397d48 for file "/usr/local/lib/gstreamer-0.10/libgstadder.so" prepared, calling
entry function...
GST_PLUGIN_LOADING
/usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstplugin.c:841:gst_plugin_load_file:
Plugin 0x7c397d48 for file "/usr/local/lib/gstreamer-0.10/libgstadder.so" prepared, registering...
GST_PLUGIN_LOADING
/usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstplugin.c:540:gst_plugin_register_func:
plugin "/usr/local/lib/gstreamer-0.10/libgstadder.so" looks good
GST_REFCOUNTING
/usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstobject.c:311:gst_object_ref:<adder>
0x7c3c32e8 ref 2->3
GST_PLUGIN_LOADING
/usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstpluginfeature.c:106:gst_plugin_feature_load:
loading plugin for feature 0x7c3c32e8; 'adder'
GST_PLUGIN_LOADING
/usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstpluginfeature.c:110:gst_plugin_feature_load:
loading plugin adder
GST_PLUGIN_LOADING
/usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstplugin.c:1293:gst_plugin_load_by_name:
looking up plugin adder in default registry
GST_REFCOUNTING
/usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstobject.c:311:gst_object_ref:<plugin96>
0x7c397d48 ref 3->4
GST_REFCOUNTING
/usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstobject.c:311:gst_object_ref:<plugin96>
0x7c397d48 ref 4->5
GST_REFCOUNTING
/usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstobject.c:337:gst_object_unref:<plugin96>
0x7c397d48 unref 5->4
GST_PLUGIN_LOADING
/usr/obj/ports/gstreamer-0.10.36/gstreamer-0.10.36/gst/gstplugin.c:1296:gst_plugin_load_by_name:
loading plugin adder from file /usr/local/lib/gstreamer-0.10/libgstadder.so

It is not clear to me what globals are being protected by the
gst_plugin_loading_mutex in gst/gstplugin.c gst_plugin_load_file().
Perhaps the scope of the lock is to0 broad covering the potential
recursion caused by the call to gst_plugin_register_func().

Any pointers on how to address this problem would be appreciated.

Thanks,
-Kurt
g4hx | 10 May 23:47
Picon
Picon

Using glade and Actions

Hello everyone,

unfortunately, I have a new problem with gtk3mmm: I have some
Actions/ActionGroups created using glade. Now I want to connect the
on_activate() signal of a certain Action to a member function of my
class. To this end, I need to get a reference to this Action from the
Builder. However, the Builder only has a get_widget method, which fails
with:

"gtkmm: object `ActZoomIn' (type=`gtkmm__GtkActionGroup') (in GtkBuilder
file) is not a widget type."

My question is how to obtain the Action form the Builder or else how to
rewrite the code or modify the glade file to connect the Action's
method. Btw I also need a reference to an ActionGroup to call its
set_sensitive method, so glade's handler functions alone won't be
sufficient for me.

g4hx
Luís Vaz | 9 May 19:07
Picon

Refresh Gtk::TreeView mysterious crash

Hi all,

I'm developing an application with Gtkmm (2.4) that consists in acquire data and
show that data to a user in a Gtk::Window throw a Gtk::TreeView.
The main process launches different Glib::Threads, each one acquiring data from
different sources, and then each one is consulted for the results to update the
values in the TreeView.

Recently I notice a program crash without any apparent reason.

The program was running OK in a WinXP EN and PT-PT installation, the problem was
reported in a WinXP PT-BR installation. Initially I thought that the error could
be a bad WinXP installation or disc/memory problem, but then the test was made
in a brand new PC with WinXP PT-BR without sucess.

After some time debugging all code and memory, I've found out that the crash
happens when some object accesses to the method HasContainer in (I think)
msvcr90.dll.

Initially the program was compiled in MSVS2008, and to confirm/debug the error
then compiled with gcc (4.5.2), and the problem continues with the same
information. Also try to see if could exist any difference between debug and
release versions: in debug crashes earlier!

Then, after more debug/research, I've turned off the TreeView update, just
collect the data and don't try to access or write or update the TreeView values,
and the program works just fine without crashing...

Does anyone already notice this error and/or knows how to fix it?

Thanks in advance,
--

Luís Vaz

_______________________________________________
gtkmm-list mailing list
gtkmm-list <at> gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list

Gmane