GdkPixbuf and click events

2017-08-03 Thread Ferdinand Ramirez via gtk-app-devel-list
I have a program that adds a GdkPixbuf to a GtkTextView. I would like to right 
click on the image and capture the mouse click event and execute a callback 
function. Is there any way of achieving this using GdkPixbuf?

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


GtkTextView loses selection when using GtkSpinButton

2015-10-15 Thread Ferdinand Ramirez
I have a GtkTextView as part of my application along with a GtkSpinButton 
object to control the font size on the GtkTextView.

If I make a selection in the text and then click in the entry portion of the 
spin button and then click the arrows, everything works fine.

However, if I do not click in the entry portion but directly click on the up or 
down arrow of the spin button, nothing happens and I even lose the selection in 
the GtkTextView.

Is this a known issue and is there a way to overcome this issue? This behavior 
can confuse users.

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


Threads and gtk_widget_show (code should not be reached?)

2013-01-30 Thread Ferdinand Ramirez
I have encountered a strange error followed by a crash when I add the following 
object to a GtkTextView by creating a child anchor and call gtk_widget_show_all.

The object that is added

The object that is added to the child anchor is a GtkFrame inside which is a 
GtkTable and each cell of the table contains another GtkFrame each of which 
contains a GtkTextView.

The error

This works fine if it is all done from the main program. However, when I create 
the hierarchy described above in another thread and call gtk_widget_show_all on 
the GtkFrame that is added, I get an error in paint saying code should not be 
reached. Before this error, there is a warning that the iterator in text view 
has changed. I am not sure if the warning and error are related.

Source of the error

I replaced gtk_widget_show_all by gtk_widget_show in a loop going down the tree 
and calling it for each object. The source of the error was the gtk_widget_show 
on the leaf level view objects in the frames contained in each cell of the 
table.

Situations under which it works

When the leaf level GtkTextView objects are not part of the hierarchy of 
widgets I create or they are replaced by GtkEntry objects, everything works 
fine. Again, note that it also works fine if I do not have another thread and 
call everything from the main program on startup but I need to have another 
thread as this object will be created during the course of the program. I've 
tried both g_idle_add as well as using the gdk_threads_enter/leave pair.

Any help will be appreciated.

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


Re: Threads and gtk_widget_show (code should not be reached?)

2013-01-30 Thread Ferdinand Ramirez
I used the gdk_threads_enter/gdk_threads_leave pair, but it did not work. It 
does not work even when the whole creation of the hierarchy is within the 
gdk_threads_enter/gdk_threads_leave pair.

I am able to get it to work without using GtkEntry instead of GtkTextView if I 
call the function in main().

However, as I pointed out, it works if I replace the GtkTextView with a 
GtkEntry within each cell of the table. 

-Ferdinand

--- On Wed, 1/30/13, Edscott Wilson edscott.wilson.gar...@gmail.com wrote:

 The current method for calling gtk_xx
 instructions is from the main thread
 only (i.e., that which owns the main loop context). You can
 do this by
 means of g_main_context_invoke(). Otherwise you must use the
 deprecated
 gdk_threads_enter/gdk_threads_leave mutex method. The
 deprecated method is
 slower.
 
 If you do not do the above, you will get all sort of errors
 just like the
 one you describe.
 
 HTH
 
 2013/1/30 Ferdinand Ramirez ramirez.ferdin...@yahoo.com
 
  I have encountered a strange error followed by a crash
 when I add the
  following object to a GtkTextView by creating a child
 anchor and call
  gtk_widget_show_all.
 
  The object that is added
 
  The object that is added to the child anchor is a
 GtkFrame inside which is
  a GtkTable and each cell of the table contains another
 GtkFrame each of
  which contains a GtkTextView.
 
  The error
 
  This works fine if it is all done from the main
 program. However, when I
  create the hierarchy described above in another thread
 and call
  gtk_widget_show_all on the GtkFrame that is added, I
 get an error in paint
  saying code should not be reached. Before this error,
 there is a warning
  that the iterator in text view has changed. I am not
 sure if the warning
  and error are related.
 
  Source of the error
 
  I replaced gtk_widget_show_all by gtk_widget_show in a
 loop going down the
  tree and calling it for each object. The source of the
 error was the
  gtk_widget_show on the leaf level view objects in the
 frames contained in
  each cell of the table.
 
  Situations under which it works
 
  When the leaf level GtkTextView objects are not part of
 the hierarchy of
  widgets I create or they are replaced by GtkEntry
 objects, everything works
  fine. Again, note that it also works fine if I do not
 have another thread
  and call everything from the main program on startup
 but I need to have
  another thread as this object will be created during
 the course of the
  program. I've tried both g_idle_add as well as using
 the
  gdk_threads_enter/leave pair.
 
  Any help will be appreciated.
 
  -Ferdinand
  ___
  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


Re: Threads and gtk_widget_show (code should not be reached?)

2013-01-30 Thread Ferdinand Ramirez
--- On Wed, 1/30/13, Andrew Potter agpot...@gmail.com wrote:
 
 If you are getting an iterator warning, you may be trying to
 use an
 invalidated GtkTextIter. Be sure to read
 http://developer.gnome.org/gtk3/stable/TextWidget.html

I have nothing in there that modifies the buffer. I just create the view and 
add it. In fact, the error comes from the line gtk_widget_show_all. If I 
replace this line with code to traverse the hierarchy and do a gtk_widget_show 
on each object, the error manifests itself only when I get to the GtkTextView 
at the leaf nodes. 

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


Displaying tabular data in GtkTextView

2012-12-30 Thread Ferdinand Ramirez
Does anyone here know what is the best way to display a table in GtkTextView? I 
want to have a table with borders and editable cells like in MS Word.

Thanks for any advice to achieve this,

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


Incrementally inserting GdkPixbuf into GtkTextBuffer

2012-11-01 Thread Ferdinand Ramirez
How do I insert an image into a GtkTextBuffer incrementally so that I can see 
that the image is loading instead of having to wait for some time with no 
apparent activity and seeing it all at once after a time lag?

I looked at GdkPixbufLoader, but am unable to figure out how to use this. 

I called gdk_pixbuf_loader_write within a while loop as and when the image 
array was getting data and then in the update callback, I called 
gdk_pixbuf_loader_get_pixbuf followed by gtk_text_buffer_insert_pixbuf. 
However, I keep getting an error that the assertion on GDK_IS_PIXBUF failed.

Note that I am able to insert a GdkPixbuf into GtkTextBuffer using 
gtk_text_buffer_insert_pixbuf, but this works only if I read the image fully 
before creating the pixbuf.

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


GtkTreeView Editable cells?

2012-07-17 Thread Ferdinand Ramirez
I have a GtkTreeView and I am able to double click and trigger my function on 
double clicking. 

Now if I add a renderer and make it editable, double clicking always goes to 
edit mode for the cell.

Instead, I want to edit only when I single click on an already selected cell 
and my double click action should still trigger a separate function.

How can I achieve both? I am able to test my program by having either of the 
two functionalities but not both.

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


Re: How do I fix the window size?

2012-06-06 Thread Ferdinand Ramirez
--- On Tue, 6/5/12, Chris Vine ch...@cvine.freeserve.co.uk wrote:

 Are you calling
 gtk_scrolled_window_add_with_viewport()?  If so, use
 gtk_container_add() instead, because tree views have native
 scrolling
 capabilities.

Tried out both. I'm in the process of trying out other options like using boxes 
and will let you know what works. 

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


How do I fix the window size?

2012-06-05 Thread Ferdinand Ramirez
Apologies if this has been asked before, but I searched online and could not 
find any discussion on this issue and I did not find anything on the 
documentation page.

I have a treeview and a scrollbar which are both within a hbox. The hbox is 
within a window. When I expand the treeview, the window resizes itself to 
include the whole treeview. 

The biggest problem is when the treeview has more elements than what can be 
seen on a single screen. The window size becomes larger than the display.

I want the window size to remain the same and use my scrollbar to navigate my 
treeview. How do I achieve this? gtk_window_resize does not seem to be the 
solution.

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


Re: How do I fix the window size?

2012-06-05 Thread Ferdinand Ramirez
--- On Tue, 6/5/12, James Tappin jtap...@gmail.com wrote:

 I think the solution is to place the treeview in a gtk_scrolled_window 
 rather than using an hbox and an explicit scrollbar. 

The reason for trying out with an explicit hbox is that the column headers 
scroll out of view with a gtk_scrolled_window.

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


Re: GtkTextView and bidi text

2012-04-24 Thread Ferdinand Ramirez
--- On Mon, 4/23/12, Dov Grobgeld dov.grobg...@gmail.com wrote:

 Lots of years ago we spoke about having a direction override as a paragraph 
 attribute, but we never got around to implementing it.

I think it is a good idea to give control to the programmer rather than make it 
automatic. 

Making everything automatic and making the programmer feel helpless is the 
Microsoft way. There, now that I've insulted you, I am sure you will consider 
adding this feature. :-)

Seriously, this should not even be at the paragraph level, but in the complete 
control of the programmer. The programmer should be able to set the direction 
and this should hold until it is set again. Even if the automatic direction 
detection exists, there should be the ability to override it.

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


GtkTextView and bidi text

2012-04-23 Thread Ferdinand Ramirez
How can I force GtkTextView object to use left to right rendering when I type 
in a character which has the default behavior of being from a RTL language? I 
need this behavior when I mix some RTL characters with LTR characters and the 
first character on a line is of RTL type.

The following lines seem to have no impact.

GtkTextView *view;
...

gtk_widget_set_direction(view, GTK_TEXT_DIR_LTR);
gtk_widget_set_default_direction(GTK_TEXT_DIR_LTR);

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


GtkTextView and PangoFcDecoder

2012-02-23 Thread Ferdinand Ramirez
Is it possible to use PangoFcDecoder with GtkTextView so that I can use the 
glyph index to render the glyphs? If so, at what point does the program invoke 
the callback provided as a parameter in 
pango_fc_font_map_add_decoder_find_func? 

The documentation says it is called during create_font and the examples I see 
use GnomeCanvas. However, my program does not use GnomeCanvas. I am not sure if 
GnomeCanvas is related to GtkTextView. I am looking for the best way to render 
my glyphs based on glyph index in an already existing program that is based on 
GtkTextView.

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


Re: GtkTextView and PangoFcDecoder

2012-02-23 Thread Ferdinand Ramirez
The confusing line in the documentation for PangoFcDecoder at 
http://developer.gnome.org/pango/stable/PangoFcFontMap.html#pango-fc-font-map-add-decoder-find-func

is this: This function saves a callback method in the PangoFcFontMap that will 
be called whenever new fonts are created.

So after I write my decoder, do I have to explicitly create a font? 

For example, Mozilla has a decoder at 
http://people.mozilla.com/~chofmann/l10n/tree/mozilla/gfx/src/gtk/mozilla-decoder.cpp

Is this complete in itself or does mozilla_find_decoder get invoked only when a 
font is explicitly created somewhere in the code? If it needs to be explicitly 
created, does anyone know where in Mozilla code it gets created so that I can 
use it as an example?

Thanks,
-Ferdinand

--- On Thu, 2/23/12, Ferdinand Ramirez ramirez.ferdin...@yahoo.com wrote:

 Is it possible to use PangoFcDecoder
 with GtkTextView so that I can use the glyph index to render
 the glyphs? If so, at what point does the program invoke the
 callback provided as a parameter in
 pango_fc_font_map_add_decoder_find_func? 
 
 The documentation says it is called during create_font and
 the examples I see use GnomeCanvas. However, my program does
 not use GnomeCanvas. I am not sure if GnomeCanvas is related
 to GtkTextView. I am looking for the best way to render my
 glyphs based on glyph index in an already existing program
 that is based on GtkTextView.
 
 -Ferdinand
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


cursor position in filename entry of gtkfilechooserdialog

2012-02-02 Thread Ferdinand Ramirez
If I set the filename using gtk_file_chooser_set_current_name from a callback 
method for key-press-event, the filename shows up in the text entry box, but 
the cursor position is at 0 once the filename has been set. How do I set the 
cursor position to be at the end of the string I set as the filename?

Thanks,
-Ferdinand
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: cursor position in filename entry of gtkfilechooserdialog

2012-02-02 Thread Ferdinand Ramirez
--- On Thu, 2/2/12, Emmanuel Thomas-Maurin manutm...@gmail.com wrote:

 I think you may use something like:
 gtk_editable_set_position(GTK_EDITABLE(entry), -1)
 

The problem is that I don't seem to have access to location_entry in 
GtkFileChooser for me to use the above function. Do you know how I can get hold 
of location_entry? I believe location_entry is the GtkEntry object and I need a 
handle to that.

Thanks,
-Ferdinand
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Need control of filename entry area in gtkfilechooser

2012-01-12 Thread Ferdinand Ramirez
When I type in the filename into the filename entry area in gtkfilechooser 
dialog, I want to intercept the text that is entered, modify it and then 
display it in the filename area. How do I do this?

For a regular text buffer, I know how to do this: I can do a 
gtk_text_view_get_buffer and then have a callback for insert-text. I can then 
modify the text that is entered and then insert it into the buffer, all from 
inside the callback.

I want to be able to achieve the same thing for filename entry. Does anyone 
know how to do this?

Thanks,
-Ferdinand
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Custom font for application

2011-07-24 Thread Ferdinand Ramirez
Does anyone here know how I can create and load a custom font for my 
application from the source code? What method or methods do I need to invoke to 
load the font that I can render? What rendering methods do I need to override 
so that my custom fonts are the ones rendered? Are there any examples of source 
code on how to achieve this?

Thanks,
-Ferdinand
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Questions on creation of glyphs

2011-07-18 Thread Ferdinand Ramirez
I am sorry to ask a basic question. Was this the right list to post my queries 
or am I on the wrong list? If this is the wrong list, can someone point me to 
the correct list?

I need to create these glyphs and use them in the manner I described for an 
application. Is there a basic tutorial or is there another thread with this 
information?

Thanks,
-Ferdinand

--- On Thu, 7/14/11, Ferdinand Ramirez ramirez.ferdin...@yahoo.com wrote:

 From: Ferdinand Ramirez ramirez.ferdin...@yahoo.com
 Subject: Questions on creation of glyphs
 To: gtk-app-devel-list@gnome.org
 Date: Thursday, July 14, 2011, 6:33 PM
 I want to create a small set (say
 5-10 symbols) of custom glyphs and want these symbols to be
 part of the alphabet of a fictional language. I also want to
 assign unused unicode values to these symbols and want these
 symbols to appear on my application as well as the terminal
 when I press specific keys. 
 
 I want it to appear on my terminal screen because that is
 the easiest way for me to test my compilation. (I know I
 have to recompile gnome terminal for this but I am fine with
 that.)
 
 So here are my questions.
 
 (1) How do I create new glyph files?
 (2) Where in the source code are the unicode values mapped
 to the glyphs and which files will I need to modify to map
 some unused unicode values to the newly created glyphs?
 (3) Where in the source code are keycodes mapped to the
 unicode values and which files will I need to modify this
 map?
 
 I want to understand the flow through the source code and
 will appreciate anyone who can give me this information.
 
 Thanks,
 -Ferdinand
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list