John,
I am maintaining several gtk2 applications for windows that I'm cross
compiling from Linux. I'm using Fedora for the cross compilation and the
way I'm working is as follows:
- Install the necessary mingw64 packages through dnf
- Install mingw32-nsis for the generation of a windows Ins
Why don't you cross compile from Linux to Windows?
I have for years maintained several gtk based applications, including the
building of installers for windows through make-nsis, and done everything
from Linux.
Regards,
Dov
On Mon, May 7, 2018 at 10:30 AM, arkkimede wrote:
> Hi!
> I need an ad
The key is to not draw directly, but to invalidate one or more rectangles
needed to for changing the image from the old to the new one.
I worked on this problem some years ago and I think my solution is very
relevant to your question.
See the gtk3 branch at: https://github.com/dov/dovtk-lasso .
Note that if you are using fedora (and possibly other Linux distributions)
it comes with lots of win32 packages precompiled. E.g. all you need to do
to get gtk2 and its dependencies is to do:
dnf install mingw32-gtk2
You can then compile your gtk programs for windows through cross
compilation
Another equivalent scons-based way of compiling for windows with gcc is
shown in my program giv.
See: https://github.com/dov/giv/blob/master/SConstruct
SCons uses the Sconstruct files to do the cross-compilation and also calls
out to nsis to create a windows installer.
The complete gtk run time
Please define what you mean with an "output" widget. All widgets are output
widgets in a sense, but e.g. GtkLabel is an output label for text messages
(and images).
On Mon, Oct 7, 2013 at 12:44 PM, Mahesh Chaudhari <
mahesh.chaudh...@ymail.com> wrote:
> Are there any output widgets available wit
There is another solution that I have used extensively, which is to draw
the cairo commands twice. Once for the actual drawing, and once again in an
offline image (called label image), with the following differences:
1. Use solid colors corresponding to "labels" of the different graphical
co
You just need to use gtk_widget_hide() on the widget and it and its child
widgets will not be shown.
On Sun, Jun 16, 2013 at 4:28 AM, John Coppens wrote:
> Hi...
>
> I created a program with three elements in an HBox (gtk2): two
> treeviews and a GtkGlExt drawing area. I'd like to toggle the dr
Is there any keybinding that allows copying into the clip-board the full
path of a filename that you hover over in the file chooser dialog? E.g.
when looking at the "Recent file" menu, there is a tooltip popup of the
full path of a file. Is it possible to copy the contents of this tooltip so
that y
See http://developer.gnome.org/pango/stable/PangoMarkupFormat.html for the
syntax for subscripts and superscripts.
Regards,
Dov
On Mon, May 14, 2012 at 3:38 PM, David Nečas wrote:
> On Mon, May 14, 2012 at 08:20:26PM +0800, Rudra Banerjee wrote:
> > Can anybody please take some time to show me
The following, though a bit old and referring to perl, might still help:
http://gtk2-perl.sourceforge.net/doc/yapc-2004-perl-gtk2/slides.html
Regards,
Dov
On Sun, Apr 29, 2012 at 20:41, Steve wrote:
>
> I'm using linux. I've tried dozens of different methods and a few
> examples which seem to s
But it is much better than
the being blindfolded. ;-)
Regards,
Dov
On Tue, Apr 24, 2012 at 23:36, Ferdinand Ramirez <
ramirez.ferdin...@yahoo.com> wrote:
> --- On Mon, 4/23/12, Dov Grobgeld wrote:
>
> > Lots of years ago we spoke about having a direction override as a
>
Indeed there is no higher level override determine the text direction. You
have to change the buffer contents to get what you want. The easiest way of
doing this is by inserting the character zero-width character LRM (U+200E)
before your first RTL character.
Lots of years ago we spoke about having
On Wed, Feb 29, 2012 at 01:17, Roger Davis wrote:
> [stuff deleted]
Does Cairo have a way
> of mimicking an X11 XOR-op GC for doing low-overhead ephemeral drawing ops
> of rubberband-lines, etc.?
>
> I have over the years been intrigued of how to do flicker free rubberband
selection with gtk/ca
I suggest that you have a look at the configuration file for the nsis
installer (badly) named giv.wine.nsi.in of my application giv at:
https://github.com/dov/giv
It should give you a starting point of what you need to include and where
to place it.
Regards,
Dov
On Thu, Jan 12, 2012 at 17:38,
> A label can use Pango-Markup language, but I didn't find a way to make a
> newline using a markup.
> When parsing xml, all line-ends are ignored.
>
> regards,
> Arne
>
>
> Am 11.09.2011 13:45, schrieb Dov Grobgeld:
>
> Just use gtk_label_set_markup().
>
Just use gtk_label_set_markup().
Regards,
Dov
On Sat, Sep 10, 2011 at 20:35, Craig wrote:
> Hi,
>
> I am not expert on this issue, but isn't Pango the way to go. I think
> you should look up the Pango functions or how gtk deals with the Pango
> thing.
>
> Craig Bakalian
>
> > Hello,
> >
> > in
One way of doing this is as follows:
- Cross compile for windows from Linux. E.g. on Fedora, this may be done
by installing the mingw32* packages.
- Install the cross compiled makensis package to create an installer for
Windows under Linux.
- Run the installer under Windows installi
There is no such thing as default folder under Linux/Unix. The user might
want to install an application in her home directory, or in /opt, or in
/usr/bin depending on permissions or the visibility of the application.
Perhaps you meant to ask if it is possible to know where the application was
run
As far as I know (but perhaps someone else knows better) the only freely
available postscript interpreter is ghostscript (which is used by gv).
Ghostscript is distributed under the GPL license which prevents Gtk, which
is distributed under the LGPL, to depend on it. The easiest way round this
is si
If all you want is a popup, then you might as well create a new process
instead of a new thread. There is no advantage of using a thread as it does
not seem like you want to pass any info between the window and the
monitoring loop. Further, the way you described it, if more than one event
occurs, t
Last time I checked (which was a long time ago) gtksourceview did not
support BiDi and possibly other i18n issues. But this per se is no
explanation for it being slower. And yes, performance can always be
improved.
Regards,
Dov
On Thu, Nov 4, 2010 at 18:12, Olivier Sessink wrote:
> Hi all,
>
> l
For an example of how to do it without having a secondary thread do any gtk
commands, see my example program in:
http://www.mail-archive.com/gtk-app-devel-list@gnome.org/msg14213.html
Basically the work thread, that is taking a long time doing its thing,
requests the gui thread to update the GUI
I use gdk-pixbuf-csource in my build system to generate c-files from my
icons that I then insert into the source list of programs.
Let me know if you need more examples.
Regards,
Dov
On Sun, Oct 10, 2010 at 17:46, Arne Pagel wrote:
> Hello,
>
> I created some special icons for my application.
I might be missing something but it seems like this is a Linux kernel
question and doesn't have much to do with Gtk. Unless I'm missing something
you need to write a device driver for your kernel than makes your hardware
buttons appear as keyboard key-presses, e.g. F1-F10, and then use standard
Gtk
sible.
//==
// test-gtk-lasso.c - This example is in the public domain
//
// Dov Grobgeld
// Mon Aug 16 09:09:56 2010
//--
#include
#include
#include
#include "dov
I don't know if you noticed it in another thread, but I created a working
example of the approach that I described in my earlier email. See:
http://github.com/dov/dovtk-lasso
See the program test-dovtk-lasso.c for an example of how to use it.
Please let me know if you need more explanations. Th
The following solution does the job though it causes flickering.
- If there is a previous backing store (see below) then restore it to the
underlying image.
- Define the rectangle to draw by the button-press and the
motion-notify-events.
- Copy the four edges of below the rectangle
What do you mean with drawing text? Through the text property of the label
widget? Then the answer is indeed no.
But you can always create a drawing area and draw whatever you want with
cairo in the expose event. You will then have no problem drawing in a circle
as you can loop over each character
Why don't you just draw a grid with lines on the canvas, and then whenever
you "select" a square you create a canvas rectangle item and put it in the
grid between the grid lines? When you unselect, you just destroy the canvas
item. You will still need 2 items, which might still be too much...
Attached below is a simple example. Something that you should keep in mind
is that gtkplot expects you to keep the data around as long as the plot is
displayed, i.e. it accepts a pointer to the data, but it does not copy it.
Presumably for perfomance reasons.
Regards,
Dov
#include
#include
#i
I've been using GtkPlot for real time plots for a number of years. It
basically does the job, though its feature set is quite limited.
In case you will be using PyGtk then there is no doubt that you should be
using MatPlotLib which has vastly more options. I have often wished that
there was a C po
verting More than 8bit image to 8 bit
> image.
>
> And, apart from GtkImageView, is there no other way of image scaling?
>
>
> Thanks
> Gorav
>
>
> On 02/03/2010 12:02 PM, Dov Grobgeld wrote:
>
>> Even if your image has more than eight bits you can always convert
Even if your image has more than eight bits you can always convert it to
8-bit according to a user setting defining the grey level max and min to be
used for the convertion (known as window and level in the medical image
community). That's exactly how I do it in my image viewer giv. The image is
he
No, you don't create threads to handle events. Instead you connect to
callbacks through g_signal_connect().
But in order to get an intelligent reply from this list, you should provide
a complete compilable program that exhibit the problem that you experience.
Regards,
Dov
On Tue, Jan 12, 2010 at
No, don't use gtk-i18n-list and don't cross post. gtk-app-devel-list is just
fine.
Gtk works only with unicode in utf8 encoding internally, so if you want a
different format on the disk you will have to convert your text on input and
output.
Regards,
Dov
On Mon, Dec 28, 2009 at 19:59, Han wrote
I don't really understand what you mean with emiting a changed event. You
mean that someone is doing something like:
gtk_label_set_text(GTK_LABEL(gtk_container_get_child(GTK_CONTAINER(my_button)),
"new text")
or something simar (e.g. changing the image shown on the
iew.c
//==
// stdout-to-textview.c
//
// An example how to place stdout from a an external process
// into a text view buffer by running the process in a separate
// thread.
//
// This program is released under the LGPL v3.0.
//
// Dov Grobgeld
// Fri Nov 20 09:22:39
You don't manually loop for events, but instead set up your drawing in the
expose handle of the drawing widget. You then connect to this handle
through:
g_signal_connect(drawing_area, "expose-event",
G_CALLBACK(my_expose_handler),
user_data);
See the
Here are two programs that implement through the text viewer widget what you
are asking for:
- The Python console in gimp
- GemTcl - a tcl interpreter
The way I set up the interaction is to listen to both the key-press-event
and the insert-text events of the text-viewer. The key-press-event
Oops. Make that:
http://ftp.gnome.org/pub/gnome/binaries/win32/
Regards,
Dov
2009/7/11 Dov Grobgeld
> I've been doing cross platform development and windows installer during the
> last few years of lots of C/C++ programs. Here is an outline of my
> practices:
>
>- Buil
I've been doing cross platform development and windows installer during the
last few years of lots of C/C++ programs. Here is an outline of my
practices:
- Build done through scons.
- Special scons rules for doing cross compilation for Windows from Linux.
- Use NSIS for Windows installer
As I've said in he past, I believe the best thing is to sub-class GtkWindow
and then make all the pointers you want to pass around members of your new
class. Conceptually this looks like:
class MyWindow : GtkWindow {
GtkWidget *w_label;
GtkWidget *w_button;
Hello Frederico,
What you are doing is basically hit detection. What I wonder is why you are
doing it the "hard" way. Why don't you use one of the canvas widgets, e.g.
goocanvas? It allows you to tie events to specific geometric objects.
If you want to do it on your own I first of all suggest tha
my tutorial at:
http://giv.sourceforge.net/gtk-image-viewer/gtkimageviewer_tutorial.html
for an example of how to use agg with gtk.
Regards,
Dov
2009/4/13 Jose Hevia
> 2009/4/13 Dov Grobgeld :
> > gdk_draw_line() is deprecated. Use cairo instead.
>
> And the problem with cairo is
gdk_draw_line() is deprecated. Use cairo instead.
Regards,
Dov
2009/4/13 Paolo
> Hi!
> I'm drawing lines into GtkDrawingArea through gdk_draw_line function. The
> results is good, but not enough. How can I increase the rendering?
> ___
> gtk-app-deve
I know this is not answering your question, but you can get the same effect
of the drawing area by using my GtkImageViewer widget, without an image. See
the tutorial at:
http://giv.sourceforge.net/gtk-image-viewer/gtkimageviewer_tutorial.html
for an example.
Regards,
Dov
2009/4/12 Paolo
> hi!
Since hex characters only has an alphabet of 16 characters, you can draw
these once into separate pixbufs, and then use gdk_pixbuf_copy_area() to
draw the prerendered characters to the screen. If you have the memory you
can e.g. create 256 two-nibble precomposed glyphs. I'm not sure how much
more e
gdk_pixbuf have different ideas about
their order.
(These examples are copied from the GtkImageViewer tutorial.)
Regards,
Dov
2009/3/26 Alexander
> Hi, Dov.
>
> On Thursday 26 March 2009, Dov Grobgeld wrote:
>
> >- If the annotation is static, it certainly faster to prepare a
Hi Chen,
For the application that you described, using a canvas doesn't give you much
and you can just as well create a cairo context and draw on the image
directly. But there are a few things that you should be aware of:
- Drawing overlays on av full realtime speed is going to take a lot of
No, doing it for the GtkImage is enough. Manually resizing or maximizing is
one and the same.
Regards,
Dov
2009/3/15 Luis Gonzalez
>
> Hi,
>
> I have do this in size-request event of the GtkViewport?, Does it works if
> the user maximize the window?
>
> Thanks.
>
> >
> > No, GtkImage doesn't re
No, GtkImage doesn't resize the pixbuf automatically for you. You will have
to do it manually whenever you get a resize event. Thus you will need to
store your original image in an off screen GdkPixbuf, and on an resize event
create a resized copy through gdk_pixbuf_scale_simple() that you then
pro
Hi Frederico,
(Copied from my own post from Mar 23, 2006 12:31:00 pm)
Here are four additional possibilities:
1. Use global variables for your widgets.
2. Create a struct containing pointers to all your widgets and use the
userdata field to pass this struct around in all callbacks.
3. Use the
First of all, since C++ is basically a superset of C, you can add as much or
little C++ as you want to your C-program. In another word, you can program
in C++, but use the C-api for widget creation, etc. That is what I have been
doing e.g. in my projects GemTCL and giv. In contrast to what was said
Hi Dominique,
Do yourself a favour and take the time to get rid of the use of XOR for
drawing and erasing. You'll have to keep a backing store of your data and
restore it when erasing. I've done the same thing for creating a rubber band
distance measuring tool in my image viewer giv. (Look at giv-
The message means exactly what it sais, that you try to reduce the ref count
of an object that doesn't exist. If it is a C-program the way to trace this
is to rerun the program with the flag g-fatal-warnings in which case the
program will exit such that if you run the program in a debugger, the err
Here are a couple of options:
- Parse your variable list through regular expressions and dynamically
build your interface.
- Offline generate a glade (or GtkBuilder file) based on the same
parsing. The syntax of glade and GtkBuilder is very straight forward.
Regarding the callback, th
In glade, try erasing the size. There is almost never any need to set the
size of a widget in glade. Instead the size of a widget should be the size
of its contained widgets.
Regards,
Dov
2009/1/29 frederico schardong
> 2009/1/29 Dov Grobgeld :
> > The GtkImage will change
If you use glade, then after loading the interface, the widget has already
been created for you. There is therefore no need to generate another image
widget through a call to gtk_image_new_from_file() and you should use
gtk_image_set_from_file instead:
GtkWidget *image = ...*get widget pointer fro
Actually, if you have postscript, it should be pretty straightforward to
convert to cairo as they use the same drawing model. This is also the only
way to get proper cross
2009/1/15 Dan McMahill
> Hello,
>
> I have a gtk app I wrote about 12 years ago. I've slowly evolved it. I
> have about a
The data of a GdkPixbuf is layed out as a continous allocated chunk of
memory in one of the following format RGBRGBRGB for 24-bit images, or
RGBARGBARGBA, for 32-bit images, where R,G,B,A stands for the red, green,
blue, and alpha components respectively. Lines may be also padded to
row_stride byte
Just loop over the pixels and calculate a gray level through a linear
combination of R, G, and B. For example ppmtopgm uses:
grey = .299 r + .587 g + .114 b
Then assign the resulting gray to the red, green, and blue components, and
voila! You've got yourself a gray scale image.
See my previous p
It is almost correct except the fact that the rows of a pixbuf may be
padded. You are therefore supposed to use gdk_pixbuf_get_rowstride(pixbuf)
to get the distance between the rows.
Here is e.g. an example of vertically flip an image:
guint8 *buf = gdk_pixbuf_get_pixels(img);
gint w = gdk_
I just tested your compilation line and except from the fact that I needed
to add:
-I$MINGW/lib/gtk-2.0/include
to the include flags, I had no problem compiling with it. So either the
download at gtk is broken or you made some mistake when downloading it.
Btw, you might be interested in checking
Both GtkImage and GtkLabel are subclasses of GtkMisc, which means that you
can set their alignments through the GtkMisc methods. Thus after after
packing them together, set the yalignment of the image to 1.0 and the
yalignment of the label to 0.0 (default for both are 0.5) and you should be
ok.
Se
Hi Tomas,
You are certainly right The style method is more suited when you want to
change additional properties like background color, etc. I stand corrected.
Regards,
Dov
2008/8/28 Tomas Carnecky <[EMAIL PROTECTED]>
> Dov Grobgeld wrote:
> > Hi Lazy (great name),
> >
&g
Hi Lazy (great name),
The way to do it is to set the name of the label through:
gtk_widget_set_name(label, "foo");
and then define a style for the name "foo", that includes a font
specification:
gtk_rc_parse_string("style \"foo\" {\n"
"font = \"Seri
Box is one dimensional, either horizontal (hbox) or vertical (vbox)
and the widgets are packed in the beginning or the end of them.
Table is two dimensional and widgets are packed by specifying the
coordinates of the four sides to which the widget is to be attached.
You can also get two dimension
Just do:
gtk_rc_parse_string("include \"/usr/share/themes/Bumblebee\"\n")
and you will use the Bumblebee theme.
Regards,
Dov
On Wed, May 11, 2005 at 07:41:52AM +0100, abhi rocks wrote:
> hi
>
> Well i couldnt change my gtk theme using the .gtkrc
> file in my home directory. Is there anyway
Hello Jamiil,
Writing the makefile with the proper flag for cygwin is a lot
less text than the contents of your email ;-) :
COPT = -mms-bitfields -mno-cygwin
DEBUG = -g -Wall
INCLUDE = `pkg-config --cflags gtk+-2.0`
LDFLAGS = `pkg-config --libs gtk+-2.0` -mwindows
CFLAGS = $(C
70 matches
Mail list logo