Porting Between Linux and Windows

2012-06-23 Thread Eric Tavenner
I am trying to teach myself C++.  My goal is to be able to write code for
the same app in either Linux or Windows, and compile for both from the same
code.  Is this possible?
I have Code::Blocks 10.05 on both OSes, (Fedora 17 and Windows 7) on a 64
bit machine.  Currently Fedora has GTK 2.24.10 and Windows has 2.22.1.  Is
this going to cause problems with compiling?

I have some experience with many versions of basic, but almost none with C
or C++, so please keep your answers simple.
Thanks.
Eric Tavenner
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: How To Script .gtkrc-2.0?

2012-06-23 Thread Paul Davis
On Tue, Jun 12, 2012 at 12:11 AM, johny why  wrote:

> Can gtk_rc_parse_string or other functions on the page below be used
> to write to the gtkrc-2.0 file? Or only read?
>

as already explained, read only.


> http://developer.gnome.org/gtk/stable/gtk-Resource-Files.html
>
> Is there dev support for noobs? All tips appreciated!
>

you're on it. i don't know what you're trying to do but rewriting RC files
from code seems .. odd.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: How To Script .gtkrc-2.0?

2012-06-23 Thread Paul Davis
On Tue, Jun 12, 2012 at 1:48 AM, Johny Why  wrote:

> Why odd?
> How do other gtk theme editors do it?
>

what other theme editors? if they exist, go read the source ...
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


gdk_pixbuf_save() and const argument issue

2012-06-23 Thread Tom
Hi,

I am a user of gtkmm library.

In my application I show some calculated image data employing a
Gtk::Image that is initialized with a Glib::RefPtr .
Within my saving method I fetch the data as follow:

1 Gtk::Image const& img (my_canvas->getImage()); // getImage() is const
2 Glib::RefPtr pix_buf (img.get_pixbuf());
3 pix_buf.save(fname, "png"); // fname is a std::string

But this approach is not possible since the save() method of class
Gdk::Pixbuf is not const.

In gtkmm library Gdk::Pixbuf::save() and save_to_buffer() are C++
wrappers around the C functions gdk_pixbuf_save() and
gdk_pixbuf_save_to_buffer(), resp.

Those C++ methods are not declared const since the C functions take a
"GdkPixbuf* pixbuf" parameter (i.e. not const GdkPixbuf* pixbuf).

I wonder why the C functions do not take const GdkPixbuf* argument? Is
the pixbuf modified inside the save functions?

Tom

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


Re: Porting Between Linux and Windows

2012-06-23 Thread jcupitt
On 16 June 2012 01:33, Eric Tavenner  wrote:
> I am trying to teach myself C++.  My goal is to be able to write code for
> the same app in either Linux or Windows, and compile for both from the same
> code.  Is this possible?

Yes, I have a largish C/C++ program which I can build for Windows and
Linux from the same source code.

I think the difficulty is likely to be in your build system rather
than the source code. I've found building gtk programs on Windows
rather painful. I build WIndows programs on Linux with a
cross-compiler.

> I have Code::Blocks 10.05 on both OSes, (Fedora 17 and Windows 7) on a 64
> bit machine.

I've never used code blocks, perhaps it removes some of the pain from
building on win.

Try a hello world program and see if you can get it to build and run.
For example:

http://www.levien.com/gimp/hello.html

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


Re: Porting Between Linux and Windows

2012-06-23 Thread Allin Cottrell

On Fri, 15 Jun 2012, Eric Tavenner wrote:


I am trying to teach myself C++.  My goal is to be able to write code for
the same app in either Linux or Windows, and compile for both from the same
code.  Is this possible?


Yes, not much of a problem, particular if you cross-compile on 
Linux.



I have Code::Blocks 10.05 on both OSes, (Fedora 17 and Windows 7) on a 64
bit machine.  Currently Fedora has GTK 2.24.10 and Windows has 2.22.1.  Is
this going to cause problems with compiling?


You'll just have to watch out for symbols that are new in GTK 2.24, 
but there aren't many of those and they're clearly indicated in the 
developer documentation.


You say you're learning C++. If you have good reason to do that, 
then fine, but note that GTK itself is written in C and is 
C-oriented. Using C++ will complicate matters. You say you're new to 
this, so let me point out that C and C++ are separate languages and 
although C++ interfaces for GTK are available (gtkmm) the more 
standard development path is to use C with GTK.


Allin Cottrell
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Porting Between Linux and Windows

2012-06-23 Thread Michael Cronenworth

On 06/15/2012 07:33 PM, Eric Tavenner wrote:
[snip]

Other people have answered the rest of your e-mail pretty well. I'd 
recommend C over C++ as well, as explained in the other e-mails.


There are "Hello World" C source files in GTK documentation. Be sure to 
look them over.


http://developer.gnome.org/gtk-tutorial/2.24/c39.html


I have Code::Blocks 10.05 on both OSes, (Fedora 17 and Windows 7) on a 64
bit machine.  Currently Fedora has GTK 2.24.10 and Windows has 2.22.1.  Is
this going to cause problems with compiling?


Fedora allows you to cross-compile with MinGW and I use Fedora myself to 
build 32-bit and 64-bit, Linux and Windows executables. I'd highly 
recommend you compile on one platform. It makes life much easier and you 
can use GDB on Windows for any debugging needs.


Fedora carries GTK 2.24 for both Linux and Windows and I'd recommend 
sticking to this version as the Windows build of GTK 2.24 is very 
stable. Previous GTK versions were very unstable.

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


Re: Porting Between Linux and Windows

2012-06-23 Thread Chris Vine
On Sat, 23 Jun 2012 18:13:41 -0400 (EDT)
Allin Cottrell  wrote:
> You say you're learning C++. If you have good reason to do that, 
> then fine, but note that GTK itself is written in C and is 
> C-oriented. Using C++ will complicate matters. You say you're new to 
> this, so let me point out that C and C++ are separate languages and 
> although C++ interfaces for GTK are available (gtkmm) the more 
> standard development path is to use C with GTK.

To put the counter argument for someone who says he is a newbie, I
think you are looking at this from the wrong direction.  The GTK+
headers are in the subset common to C and C++, and can be used in
either language (there is also no need to use gtkmm in C++, and
sometimes good reasons not to do so).

The real question is what language best suits the problem space the
program is trying to solve.  For some things, C++ is better (in my
opinion). With C++11 auto variables, variadic templates and particularly
lambda expressions, it is quicker to write code for some problem areas
using C++ than C. The GTK+ code you write for a graphical interface
will look pretty much the same in either language, if you are not using
a wrapper, for the reasons I have mentioned.

In other words, GTK+ is the servant and not the master in language
choice here.

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


Re: Porting Between Linux and Windows

2012-06-23 Thread 3rdShift
Eric,

I would suggest to go with Gtkmm [1] as it is the official Gnome C++
wrapper. It is pretty mature by now, has plenty of documentation, and
used by a plethora of real world applications. The one I would recommend
to look at and learn from is WorkRave [2]. You can quickly install and
try it out both on Linux and Windows to explore the possibilities.

Although, Gtk/Gtkmm is my personal choice,there are other C++ GUI
toolkits to consider such as Qt [3] and wxWidgets [4] which might be
tighter coupled with C++. Both have superb documentation and books
written to help you started. In his latest book [5], Stroustrup uses
FLTK [6].

Another angle to consider is commercial applicability. Here, along US
Eastern Shore, you would be hard-pressed to find any Linux work that
requires anything by Qt (sadly enough).

By the same token, employers value Java [7] and C#/.NET [8] skills more
than C/C++ these days.

good luck,
--Vlad

[1] http://www.gtkmm.org/en/
[2] http://www.workrave.org/
[3] http://qt.nokia.com/products/
[4] http://www.wxwidgets.org/
[5]
http://www.amazon.com/Programming-Principles-Practice-Using-C/dp/0321543726/ref=sr_1_1?s=books&ie=UTF8&qid=1340506852&sr=1-1&keywords=stroustrup
[6] http://www.fltk.org/index.php
[7] http://www.java.com/en/java_in_action/
[8] http://msdn.microsoft.com/en-us/vstudio/hh388566.aspx




On Fri, 2012-06-15 at 17:33 -0700, Eric Tavenner wrote:
> I am trying to teach myself C++.  My goal is to be able to write code for
> the same app in either Linux or Windows, and compile for both from the same
> code.  Is this possible?
> I have Code::Blocks 10.05 on both OSes, (Fedora 17 and Windows 7) on a 64
> bit machine.  Currently Fedora has GTK 2.24.10 and Windows has 2.22.1.  Is
> this going to cause problems with compiling?
> 
> I have some experience with many versions of basic, but almost none with C
> or C++, so please keep your answers simple.
> Thanks.
> Eric Tavenner
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

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


Re: multiple GTKentry inside a GTKnotebook

2012-06-23 Thread Rudra Banerjee
Friends, 
Plz show me how to do that.

On Mon, 2012-06-18 at 23:28 +0530, Rudra Banerjee wrote: 
> Friends,
> pasted is a minimal layout of my trial to create a bibliography maker.
> The problem is, in Authors tab inside notebook, I want to edit 3 more
> entry, as Editor an example. But its taking only the first entry.
> Please show me where I am making the error.
> (NB. I am neither a C programmer nor GTK. I am creating this via reading
> various tutorials. So please don't get too irritated)
> 
> #include 
> #include 
> #include 
> #include 
> GtkWidget *window;
> GtkWidget *vbox, *hbox, *combo;
> GtkWidget *entry1;
> GtkWidget *entryAuth;
> GtkWidget *entryEdit;
> 
> GtkWidget *window;
> 
> #include "menubar.c"
> 
> int main(int argc,
> char *argv[]) {
> GtkWidget *window;
> GtkWidget *button;
> GtkWidget *table;
> GtkWidget *frame;
> GtkWidget *notebook;
> GtkWidget *label;
> GtkWidget *checkbutton;
> int i;
> char bufferf[32];
> char bufferl[32];
> 
> gtk_init(&argc, &argv);
> 
> window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
> gtk_window_set_title(GTK_WINDOW(window), "BibMk");
> gtk_container_set_border_width(GTK_CONTAINER(window), 20);
> g_signal_connect(window, "delete-event",
> G_CALLBACK(gtk_main_quit), NULL);
> 
> 
> 
> vbox = gtk_vbox_new(FALSE, 0);
> hbox = gtk_hbox_new(FALSE, 0);
> gtk_container_add(GTK_CONTAINER(window), hbox);
> gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0);
> frame = gtk_frame_new("Properties");
> 
> 
> combo = gtk_combo_box_new_text();
> gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Book");
> gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Article");
> gtk_box_pack_start(GTK_BOX(vbox), combo, TRUE, TRUE, 0);
> gtk_widget_show(combo);
> 
> 
> entry1 = gtk_entry_new();
> gtk_entry_set_text(GTK_ENTRY(entry1), "bibKey");
> gtk_box_pack_start(GTK_BOX(hbox), entry1, TRUE, TRUE, 0);
> gtk_widget_show(entry1);
> 
> 
> /*
> * CREATE THE NOTEBOOK PAN
> */
> 
> table = gtk_table_new(3,6,FALSE);
> 
> /* Create a new notebook, place the position of the tabs */
> notebook = gtk_notebook_new ();
> gtk_notebook_set_tab_pos (GTK_NOTEBOOK (notebook), GTK_POS_TOP);
> gtk_table_attach_defaults(GTK_TABLE(table), notebook, 0,6,0,1);
> gtk_widget_show(notebook);
> 
> 
> /*
> * CREATE BASIC NOTEBOOK
> */
> /*
>  * Authors Tab
>  */
> frame = gtk_frame_new ("Authors");
> gtk_container_set_border_width (GTK_CONTAINER (frame), 10);
> gtk_widget_set_usize (frame, 400, 175);
> 
> entryAuth = gtk_entry_new();
> gtk_entry_set_text(GTK_ENTRY(entryAuth), "Author");
> gtk_container_add (GTK_CONTAINER (frame), entryAuth);
> gtk_widget_show (entryAuth);
> 
> 
> entryAuth = gtk_entry_new();
> gtk_entry_set_text(GTK_ENTRY(entryEdit), "Editor");
> gtk_container_add (GTK_CONTAINER (frame), entryEdit);
> gtk_widget_show (entryEdit);
> 
> label = gtk_label_new ("Authors/Title");
> gtk_notebook_append_page (GTK_NOTEBOOK (notebook), frame,
> label);
> 
> 
> gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 0);
> 
> gtk_widget_show(table);
> gtk_widget_show_all(window);
> gtk_main();
> return 0;
> }
> 
> 
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


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


Re: multiple GTKentry inside a GTKnotebook

2012-06-23 Thread Mariano Gaudix
Rudra can see the example . I uploaded a new code
.downloads in   .. MEDIAFIRE  ..
http://www.mediafire.com/?4l8qo1wtk35dcqb     Rudra ,
let me know if you will download  , the example.

2012/6/24 Rudra Banerjee 

> Friends,
> Plz show me how to do that.
>
> On Mon, 2012-06-18 at 23:28 +0530, Rudra Banerjee wrote:
> > Friends,
> > pasted is a minimal layout of my trial to create a bibliography maker.
> > The problem is, in Authors tab inside notebook, I want to edit 3 more
> > entry, as Editor an example. But its taking only the first entry.
> > Please show me where I am making the error.
> > (NB. I am neither a C programmer nor GTK. I am creating this via reading
> > various tutorials. So please don't get too irritated)
> >
> > #include 
> > #include 
> > #include 
> > #include 
> > GtkWidget *window;
> > GtkWidget *vbox, *hbox, *combo;
> > GtkWidget *entry1;
> > GtkWidget *entryAuth;
> > GtkWidget *entryEdit;
> >
> > GtkWidget *window;
> >
> > #include "menubar.c"
> >
> > int main(int argc,
> > char *argv[]) {
> > GtkWidget *window;
> > GtkWidget *button;
> > GtkWidget *table;
> > GtkWidget *frame;
> > GtkWidget *notebook;
> > GtkWidget *label;
> > GtkWidget *checkbutton;
> > int i;
> > char bufferf[32];
> > char bufferl[32];
> >
> > gtk_init(&argc, &argv);
> >
> > window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
> > gtk_window_set_title(GTK_WINDOW(window), "BibMk");
> > gtk_container_set_border_width(GTK_CONTAINER(window), 20);
> > g_signal_connect(window, "delete-event",
> > G_CALLBACK(gtk_main_quit), NULL);
> >
> >
> >
> > vbox = gtk_vbox_new(FALSE, 0);
> > hbox = gtk_hbox_new(FALSE, 0);
> > gtk_container_add(GTK_CONTAINER(window), hbox);
> > gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0);
> > frame = gtk_frame_new("Properties");
> >
> >
> > combo = gtk_combo_box_new_text();
> > gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Book");
> > gtk_combo_box_append_text(GTK_COMBO_BOX(combo), "Article");
> > gtk_box_pack_start(GTK_BOX(vbox), combo, TRUE, TRUE, 0);
> > gtk_widget_show(combo);
> >
> >
> > entry1 = gtk_entry_new();
> > gtk_entry_set_text(GTK_ENTRY(entry1), "bibKey");
> > gtk_box_pack_start(GTK_BOX(hbox), entry1, TRUE, TRUE, 0);
> > gtk_widget_show(entry1);
> >
> >
> > /*
> > * CREATE THE NOTEBOOK PAN
> > */
> >
> > table = gtk_table_new(3,6,FALSE);
> >
> > /* Create a new notebook, place the position of the tabs */
> > notebook = gtk_notebook_new ();
> > gtk_notebook_set_tab_pos (GTK_NOTEBOOK (notebook), GTK_POS_TOP);
> > gtk_table_attach_defaults(GTK_TABLE(table), notebook, 0,6,0,1);
> > gtk_widget_show(notebook);
> >
> >
> > /*
> > * CREATE BASIC NOTEBOOK
> > */
> > /*
> >  * Authors Tab
> >  */
> > frame = gtk_frame_new ("Authors");
> > gtk_container_set_border_width (GTK_CONTAINER (frame), 10);
> > gtk_widget_set_usize (frame, 400, 175);
> >
> > entryAuth = gtk_entry_new();
> > gtk_entry_set_text(GTK_ENTRY(entryAuth), "Author");
> > gtk_container_add (GTK_CONTAINER (frame), entryAuth);
> > gtk_widget_show (entryAuth);
> >
> >
> > entryAuth = gtk_entry_new();
> > gtk_entry_set_text(GTK_ENTRY(entryEdit), "Editor");
> > gtk_container_add (GTK_CONTAINER (frame), entryEdit);
> > gtk_widget_show (entryEdit);
> >
> > label = gtk_label_new ("Authors/Title");
> > gtk_notebook_append_page (GTK_NOTEBOOK (notebook), frame,
> > label);
> >
> >
> > gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 0);
> >
> > gtk_widget_show(table);
> > gtk_widget_show_all(window);
> > gtk_main();
> > return 0;
> > }
> >
> >
> > ___
> > gtk-app-devel-list mailing list
> > gtk-app-devel-list@gnome.org
> > https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>
>
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list