Re: Past and future evolution of Gtk+

2017-09-17 Thread Ian Chapman
This is not a troll, only a trawler as in fishing boat. I found the 
discourse on “traditional file chooser” quite interesting and 
informative. I'm using glade 3.18.3 and I'm able to do useful work so 
possibly I'm off subject.


Point 1

In glade I can select GtkMenuItem and GtkImageMenuItem and when I look 
at the GTK+ 3 Reference Manual the latter is depreciated. It's working 
great so I wonder what depreciated actually implies? At some time in the 
future will it vanish and working software will fail or simply fail to 
compile on the newer distribution?


Point 2

Lots of acronyms were mentioned. Qt was one and it's in the LMDE 
repositories. Wiki has a long list of GUIs in 
“https://en.wikipedia.org/wiki/List_of_widget_toolkits” but only a few 
could be of interest. In any case there would be a learning curve to use 
any them and maybe no glade which greatly simplifies Gtk for me. Is 
there an evaluation on these alternative GUIs?


Regards Ian.


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


Re: Cross-compiling GTK+, missing icons

2017-05-28 Thread Ian Chapman
Hi, maybe your previous thread was one that I initiated.  The reply was 
nogo or use a docker.  I'm wondering if you managed to generate a 
Win.exe that ran without loading any extras on all versions of windows?  
I'm sure what I was doing would work only with the exact compile version 
even on the same distro version.  Regards Ian.


On 28/05/17 12:09 PM, Gerardo Ballabio wrote:

It looks like no moderators are actually _reading_ this list...
Resending without attachments.

2017-05-23 22:54 GMT+02:00 Gerardo Ballabio 
>:


Hello all,

I'm trying to cross-compile GTK+ for Windows on Linux (Debian)
using MXE (http:/mxe.cc/ ). My goal is to produce
a statically linked executable that just runs without having to
install anything else (libraries, themes, etc.). I saw that in a
previous thread someone said that GTK+ can't be statically linked,
but that isn't true, it actually works fine (at least on Windows).

There is only one thing that doesn't work: the icons that are part
of the standard interface (for example, the "+" and "-" that
appear on the buttons of a GtkSpinButton) aren't displayed. When I
run it, the program prints a warning saying that it can't find the
"hicolor" theme, and all icons are replaced by a "missing icon"
symbol.

I suppose that if I installed the theme on the target system, it
would work (although I'm not sure in which directories GTK+ looks
for it). But as I wrote above, I want the icons to be embedded in
the executable, so that one can just download the file and run it.
That is definitely possible with GTK+ 2, I compiled several
programs and they all work without issues. But I haven't been able
to make it work with GTK+ 3, so I'm asking for your help.

The problem is demonstrated by the attached screenshots:
- a window containing a GtkSpinButton (spinbutton-gtk3.png)
- a window containing a GtkToolbar with two buttons (toolbar-gtk3.png)
- the latter program rewritten for GTK+ 2 (toolbar-gtk2.png). As
you can see, here the icons are displayed correctly.
I'm also attaching the source code of those examples.

I've tried to dig into the GTK+ sources to find where the icons
are generated, but got lost. I found that there's a program called
gtk-update-icon-cache that I guess might have to do with that, but
I didn't understand how it's supposed to be used and where it's
called during the build process (if it's called at all).

To reproduce what I did, go to http:/mxe.cc/  and
follow the instructions. The GTK+ 3 library is configured with the
following options (specified in the src/gtk3.mk 
file in the MXE source tree):

--disable-glibtest --disable-cups --disable-test-print-backend
--disable-gtk-doc --disable-man --with-included-immodules
--enable-win32-backend

MXE also applies a few patches to the GTK+ sources (file
src/gtk3-1-fixes.patch).

Thank you in advance for any help that you can provide.

Gerardo





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



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


$HOME and gtk_file_chooser_set_current_folder

2017-03-01 Thread Ian Chapman
Hi, this is most likely my failure to fully understand gtk.  I have 
enclosed the following code snippets that work and fail to work.  I have 
a work round so it is not too bad an issue for me.


gchar WorkingPath[500] = {"$HOME/Project/" };//FAILS (this grows as 
sub-projects are selected in project)


gchar WorkingPath[500] = {"~/Project/" };//Also fails

gchar WorkingPath[500] = {"/home/name/Project/" };//Is OKAY but if 
name changes to Tom, Dick or Harry oops.


Mycode()

gtk_widget_show (ChooseProjectDialog);
gtk_file_chooser_set_current_folder(filechooser, WorkingPath);

MyWorkRound()

strcpy (WorkingPath, getenv("HOME"));
strcat (WorkingPath, "/Project/");

I am curious to hear expert comments.  Regards Ian.



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


Re: Gtk3 portability

2017-02-11 Thread Ian Chapman

Thanks guys, these suggestions give me something to work on.  Regards Ian.'

On 11/02/17 02:48 PM, Paul Davis wrote:
GTK cannot be statically linked. Or if it can (I may have failed to 
keep up with changes in GTK3) it requires special compile-time 
configuration options.


On Sat, Feb 11, 2017 at 7:22 PM, Ian Chapman <ichap...@videotron.ca 
<mailto:ichap...@videotron.ca>> wrote:


Gtk3 portability

Hi, I have made a Linux gtk3 program and have it running on my
Debian Mint AMD64 machine.

I mistakenly thought that the program file (binary file) held all
that was needed to run.

I moved the program file to a newly installed Mint 18.1 and ran
into a few difficulties.

1. I had to install libsdl2 to get over the first hick.

2. My program was looking for libglew.so.1.10 but what was in the
repository was 1.13 obviously a slightly later version.

3. I overcame hick 2 by pulling over C++ and gtk3 and recompiling
from source.

Maybe you guys and gals can give me a few pointers so that I can
generate the program file (binary file) without all the above
hassle? Regards Ian.


___
gtk-list mailing list
gtk-list@gnome.org <mailto:gtk-list@gnome.org>
https://mail.gnome.org/mailman/listinfo/gtk-list
<https://mail.gnome.org/mailman/listinfo/gtk-list>




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


Gtk3 portability

2017-02-11 Thread Ian Chapman

Gtk3 portability

Hi, I have made a Linux gtk3 program and have it running on my Debian 
Mint AMD64 machine.


I mistakenly thought that the program file (binary file) held all that 
was needed to run.


I moved the program file to a newly installed Mint 18.1 and ran into a 
few difficulties.


1. I had to install libsdl2 to get over the first hick.

2. My program was looking for libglew.so.1.10 but what was in the 
repository was 1.13 obviously a slightly later version.


3. I overcame hick 2 by pulling over C++ and gtk3 and recompiling from 
source.


Maybe you guys and gals can give me a few pointers so that I can 
generate the program file (binary file) without all the above hassle? 
Regards Ian.


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


gtk_entry_set is a bit late.

2016-07-04 Thread Ian Chapman

extern "C"
void on_Signal_activate(){
/*Phase 1  */
gtk_entry_set_text(Status, "Starting phase 1"); //just 
show activity.

std::cout << "Starting phase 1"  << std::endl;
/*Phase 2  */
gtk_entry_set_text(Status, "Starting phase 2"); //just 
show activity.

std::cout << "Starting phase 2"  << std::endl;
/*etc */
gtk_entry_set_text(Status, "All phases complete"); 
//just show activity.

std::cout << "All phases complete"  << std::endl;
return; }
I guess the guys who understand gtk can see what happens.  The progress
messages come out on the terminal in order as expected from cout. The
only message in the status field (GtkEntry) is the last one at the 
termination

of servicing the signal.  The various phases do take some real time to run.
Any pointers on how to update the status as the program goes through the
phases showing something is working would be appreciated.  It is a gui
application so there should be a way to do it without resort to the 
terminal.

  Regards Ian.

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


Re: signal for closing app

2016-06-06 Thread Ian Chapman
The signal delete event is for the top level widget (usually window) and 
it's under the signal tab, and it's way way down under GtkWidget.  You 
also need code like

extern "C"
int on_MainScreen_delete_event(){
std::cout << "Quit main widget little x." << std::endl;
gtk_main_quit ();
return(FALSE);
For the file/quit I use "on_MainQuit_activate" and code like
extern "C"
void on_MainQuit_activate (void) {
std::cout << "File/Quit." << std::endl;
gtk_main_quit ();
return;}
With a Chooser as the top levels you may need "gtk_widget_destroy 
(ChooseProjectDialog);" to get rid of it, but I'm getting a bit deeper 
than I should with that.  Regards Ian.



On 06/06/16 17:52, Paul Davis wrote:
the window manager "close" button being clicked causes 
signal_delete_event() to be emitted for the window.


On Mon, Jun 6, 2016 at 5:21 PM, Krzysztof > wrote:


I'm the very beginner in GTKmm.
I design a simple interface in Glade. The application itself is
written in C++.

Which signal should I choose and which handler should I specify in
File-Quit menu item to have the same action as clicking the X at
upper right corner of window?
How should I make it working in my application?

-- 
Regards

Krzysztof J.

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




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


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


Re: multiple windows

2016-05-23 Thread Ian Chapman
Thanks Paul, that fixed it.  I thought the reply was a wee bit terse for 
me but there is a radio button at the bottom of the general tab in 
glade.  Modal, the dictionary was of no help with that one.


I also acted on Martin's suggestion and that fixed that.  I guess that I 
need to fully build all the widgets that I put in the glade file even 
though I only need to see them.  Regards and thanks to you both Ian.


On 05/19/16 09:48, Paul Davis wrote:

You need to make the 2nd window modal.

And you need to fix the bugs in your code. Use a debugger and set a 
breakpoint in g_logv, then look at the backtrace to get clues on where 
those error messages are coming from.


On Thu, May 19, 2016 at 9:19 AM, Ian Chapman <ichap...@videotron.ca 
<mailto:ichap...@videotron.ca>> wrote:


Hi,
I must have missed a basic point on how to use tdk and glade. 
I have my main window and that works the way it should.  I have a

signal from a button that opens a second window and three thing
are not right.
When the window opens the terminal shows ---
(main:17061): Gtk-WARNING **: Symbolic icon pan-down-symbolic-ltr
of size 16 is in an icon theme directory of size 128
When I close the window2 (same way as window1) the terminal
shows ---
(main:17061): Gtk-CRITICAL **: gtk_widget_destroy: assertion
'GTK_IS_WIDGET (widget)' failed

The second window2 works that way I expect, the only hick is
that window1 functions can be executed in parallel and that is not
desired.
I'm using the top level window but there are also offscreen
and application windows and I've not determined when they should
be used?  Any pointers greatly appreciated.  Regards Ian.


___
gtk-list mailing list
gtk-list@gnome.org <mailto:gtk-list@gnome.org>
https://mail.gnome.org/mailman/listinfo/gtk-list




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


multiple windows

2016-05-19 Thread Ian Chapman

Hi,
I must have missed a basic point on how to use tdk and glade. I 
have my main window and that works the way it should.  I have a signal 
from a button that opens a second window and three thing are not right.

When the window opens the terminal shows ---
(main:17061): Gtk-WARNING **: Symbolic icon pan-down-symbolic-ltr of 
size 16 is in an icon theme directory of size 128

When I close the window2 (same way as window1) the terminal shows ---
(main:17061): Gtk-CRITICAL **: gtk_widget_destroy: assertion 
'GTK_IS_WIDGET (widget)' failed


The second window2 works that way I expect, the only hick is that 
window1 functions can be executed in parallel and that is not desired.
I'm using the top level window but there are also offscreen and 
application windows and I've not determined when they should be used?  
Any pointers greatly appreciated.  Regards Ian.


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


Re: "Cannot finding signal handler" even after compiling with -rdynamic

2016-01-17 Thread Ian Chapman
Yes, I had something like that and ended with this which I hope may help 
you.  I was thinking pull the widgets out of the glade file if that 
makes sense.  Ian

main.cpp

GtkWidget *Battery, *Temp, *Chip_volts; //these are GtkProgressBar 
derived from glade.


int
main (int argc, char *argv[])
{
GtkBuilder  *builder;
GtkWidget   *window;

printf("Entered gtk_init.\n");

gtk_init (, );//Gets gtk going.
builder = gtk_builder_new ();
gtk_builder_add_from_file (builder, "main.glade", NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
Battery = GTK_WIDGET (gtk_builder_get_object (builder, "Battery"));
Temp = GTK_WIDGET (gtk_builder_get_object (builder, "Temp"));
Chip_volts = GTK_WIDGET (gtk_builder_get_object (builder, 
"Chip_volts"));

gtk_builder_connect_signals (builder, NULL);
g_object_unref (G_OBJECT (builder));

gtk_widget_show (window);
printf("Main set up and showing window. \n");
// 
gtk_main ();

printf("Exiting MAIN. \n");

return 0;
}



On 01/17/16 10:25, Jay Aurabind wrote:

Hi,

I am learning GTK programming. I am using glade to create a UI and
then using GtkBuilder to show it.

When I run my application, it gives number errors regarding signal handlers:
--
(vaken_gtk:11467): Gtk-WARNING **: Could not find signal handler
'cb_ld_payload'.  Did you compile with -rdynamic?

(vaken_gtk:11467): Gtk-WARNING **: Could not find signal handler
'cb_loadkey'.  Did you compile with -rdynamic?

(vaken_gtk:11467): Gtk-WARNING **: Could not find signal handler
'cb_genkey'.  Did you compile with -rdynamic?
--
I have these functions in the same file. One of them look like:



static void cb_genkey(GtkWindow *wid,gpointer user_data)   {
 printf("Hi\n");
}


I found some other posts in which people got the issue solved after
putting proper compiler/linker flags. I am using Anjuta and tried a
lot of combination for passing  "-rdynamic" and/or
"-Wl,--export-dynamic". Yet my application always complain it cannot
find the signal handler.

My make -n output (removing echo) is:
--
gcc -DHAVE_CONFIG_H -I. -I/home/aj/learning/c/gtk/vaken/src -I..
-DPACKAGE_LOCALE_DIR=\""/usr/local/share/locale"\"
-DPACKAGE_SRC_DIR=\""/home/aj/learning/c/gtk/vaken/src"\"
-DPACKAGE_DATA_DIR=\""/usr/local/share/vaken_gtk"\" -pthread
-I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0
-I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0
-I/usr/lib64/dbus-1.0/include -I/usr/include/gtk-3.0
-I/usr/include/gio-unix-2.0/ -I/usr/include/cairo
-I/usr/include/pango-1.0 -I/usr/include/harfbuzz
-I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo
-I/usr/include/pixman-1 -I/usr/include/freetype2
-I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libdrm
-I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0
-I/usr/include/libpng16 -I/usr/include/glib-2.0
-I/usr/lib64/glib-2.0/include   -Wl,--export-dynamic -rdynamic  -g -O0
-MT vaken_gtk-main.o -MD -MP -MF .deps/vaken_gtk-main.Tpo -c -o
vaken_gtk-main.o `test -f 'main.c' || echo
'/home/aj/learning/c/gtk/vaken/src/'`main.c
mv -f .deps/vaken_gtk-main.Tpo .deps/vaken_gtk-main.Po
rm -f vaken_gtk

gcc -Wl,--export-dynamic -rdynamic  -g -O0   -o vaken_gtk
vaken_gtk-main.o -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0
-latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0
-lgobject-2.0 -lglib-2.0
-

Still the application complains about missing signal handlers. Full C
code at https://paste.gnome.org/pdg0iivsg
  Glade UI file at https://paste.gnome.org/ppnpbtkid

Please help.



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


Tracking Gtk2 error messages

2015-06-13 Thread Ian Chapman

Hi All,

How do I determine which widget is the cause of errors such as this?

Gtk-CRITICAL **: IA__gtk_widget_grab_default: assertion 
'gtk_widget_get_can_default (widget)' failed


I'm using perl-gtk2 and gtkbuilder. It gives a line number but that's 
simply where I'm adding the xml file...


i.e. $builder-add_from_file ($filename))

which isn't particularly useful. Thanks.

--
Ian Chapman.
___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-perl-list


g_idle_add() clarification

2015-01-20 Thread Ian Chapman

Hi all,

Sorry to bother but I'm lost with the workings of

guint g_idle_add ()

My code is as
follows

extern C

void on_StartScan_activate() //from gtk menu item

{ printf(Start Scan Activated. \n);

scan_on_fg =1;

Scanning_lvl = g_idle_add((GSourceFunc) Scanning(), (gpointer) 0);

printf(Exiting StartScan.\n);  //main.cpp, Line 129

return; }

I get to Scanning() okay but I don't exit on_StartScan_activeat() until 
I exit Scanning() (not what I expected).


Worse still when I step through Scanning as I exit I get

(gdb) next

(main:24011): GLib-CRITICAL **: g_idle_add_full: assertion `function != 
NULL' failed


on_StartScan_activate () at main.cpp:129

(gdb) next

Exiting StartScan.


guint Scanning(void)

{

while(1 == scan_on_fg)

{ //Bean counting with rest of GUI in control, I hoped. }

return(FALSE); //Remove this thread.

}


Regards Ian.

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


Re: g_idle_add() clarification

2015-01-20 Thread Ian Chapman

Thanks Chris,
I think that not only is my code broken my idea on how to do what I 
want is broken.  I must fix that before I start on the code.


My starting point was two button, scan off and scan on in glade.  
Scan on sets a flag and it scans til the off button is pressed.  So the 
off button could not be pressed til end-of-scan, a situation commonly 
known as a deadly embrace in hardware design.  After that g_idle_add() 
was pointed out to me and I've been innovating rather blindly ever since.


I interpreted g_idle_add() as inserting Scanning() into the main 
loop and if Scanning returned FALSE it was removed from the main loop.  
So I guess I'm not understanding the following explanation of

guint g_idle_add(GSourceFunc function, gpointer data); :-

Adds a function to be called whenever there are no higher priority 
events pending to the default main loop.  The function is given the 
default idle priority, G_PRIORITY_DEFAULT_IDLE. If the fRegards 
Ian.unction returns FALSE it is automatically removed from the list of 
event sources and will not be called again.
This internally creates a main loop source using g_idle_source_new() and 
attaches it to the main loop context using g_source_attach(). You can do 
these steps manually if you need greater control.

Parameters
function,  function to call
data, data to pass to function .

Also Chris you indicated that maybe g_idle_add() should not be in a 
callback.  Maybe it should be in main() after gtk_widget_show (window);  
I'm stuck for the moment not understanding.


Richard's suggestion improved things but my code and idea is still 
broken on exiting Scanning()


Regards Ian.

On 01/20/2015 04:57 PM, Chris Vine wrote:

On Tue, 20 Jan 2015 16:47:27 -0500
Ian Chapman ichap...@videotron.ca wrote:

Thanks for your reply Richard.
Yes, I know that.  I thought Scanning() was a lower level than the
gtk window and thus the StartScan_active() would exit before the
mainloop would add Scanning() and then only execute Scanning() when
nothing else (signals) was active.

I was also asking about the GLib-CRITICAL stuff on exiting
Scanning().  Ian.

On 01/20/2015 03:34 PM, richard boaz wrote:

hi,

you are calling the function Scanning() in the g_idle_add() call.g_idle_add()

richard

On Tue, Jan 20, 2015 at 3:23 PM, Ian Chapman ichap...@videotron.ca
mailto:ichap...@videotron.ca wrote:

 Hi all,

 Sorry to bother but I'm lost with the workings of

 guint g_idle_add ()

 My code is as
 follows

 extern C

 void on_StartScan_activate() //from gtk menu item

 { printf(Start Scan Activated. \n);

 scan_on_fg =1;

 Scanning_lvl = g_idle_add((GSourceFunc) Scanning(), (gpointer)
0);g_idle_add()
g_idle_add()
 printf(Exiting StartScan.\n);  //main.cpp, Line 129

 return; }

 I get to Scanning() okay but I don't exit
on_StartScan_activeat() until I exit Scanning() (not what I
expected).

 Worse still when I step through Scanning as I exit I get

 (gdb) next

 (main:24011): GLib-CRITICAL **: g_idle_add_full: assertion
 `function != NULL' failed

 on_StartScan_activate () at main.cpp:129

 (gdb) next

 Exiting StartScan.


 guint Scanning(void)
g_idle_add()
 {

 while(1 == scan_on_fg)

 { //Bean counting with rest of GUI in control, I hoped. }

 return(FALSE); //Remove this thread.

 }


 Regards Ian.

What Richard is telling you is that your code is broken.  Fix that
before dealing with warnings.  The point is that your broken code is
doing what the warning is telling you about - passing a FALSE value
(which equates here to NULL here), as returned by Scanning(), to the
function pointer argument of g_idle_add().

You have other problems.  You are passing a callback to g_idle_add()
which does not have the correct signature and surpressing this failure
by a cast.  (Why?.)  Fix that as well and see what warnings are left
over.

Chris
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list



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


Re: Progress_bar failing to change

2014-12-16 Thread Ian Chapman
Spot on Hrvoje, that's my problem, many thanks for the help.  I'll have 
to change the way I'm thinking.


Paul, your comment is correct, I should have taken more care in cutting 
the clutter from the my problem, sorry about that.  Ian.


On 12/16/2014 03:55 AM, Hrvoje Niksic wrote:

On 12/15/2014 10:49 PM, Ian Chapman wrote:

Hi All, I'm having a strange problem using

gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR(Battery), x);

I have it in two places, the first in my file that has main() and that
works like I'd expect. The second in a different module and that
compiles and runs but fails to change the progress bar.


Are you returning to the main loop after updating the progress bar? 
Failing to return to the main loop is a frequent source of problems 
with progress bar updates.


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



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


Progress_bar failing to change

2014-12-15 Thread Ian Chapman

Hi All, I'm having a strange problem using

gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR(Battery), x);

I have it in two places, the first in my file that has main() and that 
works like I'd expect. The second in a different module and that 
compiles and runs but fails to change the progress bar. Stepping using 
cgdb I can step through the Gtk code but I'm lost with that. I've 
included a simplified code modules to give some idea of what I'm doing. 
Is this because I'm using g++ rather than gcc?


/* First Module */
Main.cpp
#include gtk/gtk.h
GtkWidget *Battery;

extern C
void on_StartScan_activate() //Signal to update the battery
{ printf(Start Scan Activated. \n);
scan_fg =1;
controller(); //In module comms.cpp
return; }

extern C
void on_Refresh_activate() { //Signal to test the progress bar.
gdouble x;
x = (float)0xe000 / (float)0x;
printf(Refresh clicked. \n);
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR(Battery), x); //This works
return; }

main (int argc, char *argv[])
{
// The code to pull pointers from main.glade into builder, window and 
Battery.

}

/* Second Module */
comms.cpp

#include gtk/gtk.h
extern GtkWidget *Battery;

void controller(void)
{
int n, unpack_fg, w;
gdouble w;
/* The following seems to be ignored */
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR(Battery), w); //BAR IS 
UNCHANGED!

}

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


Gtk and SDL

2014-10-30 Thread Ian Chapman
Is it simple to put a dynamic SDL generated image into a Gtk 3 container 
or is it best to keep them as separate as possible?  Ian.

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


Widget

2014-09-12 Thread Ian Chapman

Hi,
Is there a gtk+-3 widget a bit like a progress bar but simply a 
light where the brilliance can be controlled?  That is lamp off, lamp 
dim, lamp brighter and lamp bright as a minimum.  Ian.

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


printf okay strcpy with cName_pt segment fault

2014-06-06 Thread Ian Chapman


void
on_filechooserwidget2_selection_changed(GtkFileChooser *fs) {
printf(\n Selection changed. \n);
char*cName_pt;
cName_pt = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(fs));
printf(\n cName_pt =  %s .\n, cName_pt);//Prints selected 
file okay.

//  strcpy(fileselected, cName_pt);//This gives segment fault?
strcpy(fileselected, test_pt);//This works okay, test=1234 
passed to high level.

return;
Hi All,
I do not understand why I'm getting a segment fault from strcpy 
using cName_pt in the above code.  I can printf using cName_pt and it 
prints the file that I selected using the glade gtkfilechooserwidget.  I 
must be doing something silly, I hope that someone can see what it is?  
Regards Ian.

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


$widget-get_name() and gtk2-perl 1.220+

2010-05-18 Thread Ian Chapman

Hi,

I have a program using gtkbuilder and Glade3 which takes the names of 
the widgets (as seen in Glade) and builds a hash, with each key 
referencing the corresponding widget, ie


foreach ($builder-get_objects) {
my $name;
eval{ $name = $_-get_name(); };
$gui{$name} = $_ if ($name);
}

This works as I expected (rightly or wrongly) with v1.203, however for 
v1.220+ the behaviour of $widget-get_name() has been intentionally 
changed and it no longer returns the name of the widget (according to 
Glade), except bizarrely, liststores and a few others. Is there 
equivalent an way of achieving this with V1.220+ without having to 
significantly rewrite my program? In other words, is there another 
method I can use which does much as the same as the old behaviour of 
$widget-get_name(). Thanks.



--
Ian Chapman.
___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list