Re: TreeView - set border on individual cells

2019-04-09 Thread Eric Cashon via gtk-app-devel-list
I looked into this a little more. It looks like using an overlay is the easiest solution that I could find. You can override the render function of the cell renderer but then you will probably need all the code in the text cell renderer. This isn't too bad since the text cell renderer is

Re: TreeView - set border on individual cells

2019-04-06 Thread Eric Cashon via gtk-app-devel-list
I see gtk_cell_renderer_render() in the documentation and it has a cairo_t to draw with. I haven't tried to subclass from a treeview and override the rendering. Something I should probably figure out. Do you know of an example of doing something like this in C? Maybe I can put together a

Re: TreeView - set border on individual cells

2019-04-06 Thread Eric Cashon via gtk-app-devel-list
Hi Emmanuele, The second cairo_t is used so that the rectangle can be lined up to the cell. If I use the cairo_t in the "draw" callback then the rectangle doesn't line up. Eric ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org

Re: TreeView - set border on individual cells

2019-04-06 Thread Eric Cashon via gtk-app-devel-list
Hi Mike, I gave what you said a try and it looks to work well enough. Then, how do you get a box around a selected cell. It seems to me if you let the built in renderer do it's thing and then get a cairo_t to just draw a rectangle after, it should work, right? OK, a bit of a hack but it

Re: Setting attributes per cell in treeview (list store)

2019-04-03 Thread Eric Cashon via gtk-app-devel-list
Hi Mike, I think that you would need to set up individual color columns so that you can color individual cells in the table. For colors, “cell-background-rgba” gives better color control but “cell-background” with html basic colors might be simpler. Eric    //gcc -Wall stripe_list1.c -o

Re: Treeview (liststore) CSS question

2019-03-19 Thread Eric Cashon via gtk-app-devel-list
Hi Mike, Have you tried gtk_widget_set_vexpand(tree, FALSE); on the treeview? This might work to show a different background color on the unused space of the treeview. I don't know if this is of any help but also remember that you can set individual row colors in a treeview by having a

Re: Problem with sizes of pixbuf in left gutter

2018-12-26 Thread Eric Cashon via gtk-app-devel-list
It looks like the pixbuf sizes rendered are going to be tied to the size of the font in the sourceview. If the pixbufs are bigger than the gutter has space for then they get clipped. I don't know how the sourceview works very well myself. Gave it a try. Maybe it will help. Eric //gcc -Wall

Re: PDF page not rendering properly if the page is changed

2018-11-28 Thread Eric Cashon via gtk-app-devel-list
Didn't get an attachment either. Try something like the following and see if it makes any difference. ...     GtkWidget *da=gtk_drawing_area_new();     //Request a large drawing area.     gtk_widget_set_size_request(da, 1, 1);     GtkWidget *scroll=gtk_scrolled_window_new(NULL,

Re: State actions and Glade

2018-10-05 Thread Eric Cashon via gtk-app-devel-list
I don't know if this is of any help. Another try at it. This one uses a GtkApplication. Setup an action on the button along with the standard "clicked" callback. A menu in there also. Eric //gcc -Wall toolbar2.c -o toolbar2 `pkg-config --cflags --libs gtk+-3.0` #include static void

Re: State actions and Glade

2018-10-04 Thread Eric Cashon via gtk-app-devel-list
"I am not sure what you mean" I don't have a good answer for this. I see that GtkRadioToolButton is in the list of Known Implementations for GtkActionable but doesn't use the GAction interface directly.

Re: State actions and Glade

2018-10-02 Thread Eric Cashon via gtk-app-devel-list
Hi Mitko, The GtkToolbar doesn't implement the GAction interface so you are out of luck there. You can use gtk_toggle_tool_button_get_active() to get the state of one of the GtkRadioToolButton's in the toolbar. Eric //gcc -Wall toolbar1.c -o toolbar1 `pkg-config --cflags --libs gtk+-3.0`

Re: is there a signal for typing at bottom of window?

2018-09-27 Thread Eric Cashon via gtk-app-devel-list
You might be able to fiddle around with the newlines at the end of the buffer to get something to work with the textview. Eric //gcc -Wall text_space1.c -o text_space1 `pkg-config --cflags --libs gtk+-3.0` #include static void value_changed(GtkAdjustment *v_adjust, GtkWidget **widgets)  

Re: is there a signal for typing at bottom of window?

2018-09-25 Thread Eric Cashon via gtk-app-devel-list
Hi Doug, Try getting the vertical adjustment of the scrolled window and connect to "value-changed". See if that will work. Something like ... static void value_changed(GtkAdjustment *v_adjust, gpointer user_data)   {   } ... GtkWidget *scroll=gtk_scrolled_window_new(NULL, NULL);

Re: How can I change the font of a text field using non-deprecated way?

2018-09-23 Thread Eric Cashon via gtk-app-devel-list
Hi Radomir, The function gtk_widget_override_font() is deprecated but as far as I know it still works fine in GTK3. With the Pango font description and the textview you should be able to set everything up without getting any deprecated warnings. It doesn't set the textview widget itself to

Re: GTK3 + gnuplot

2018-09-18 Thread Eric Cashon via gtk-app-devel-list
Hi Arkkimede, With gnuplot you can output to a file and then open the file with GTK+. https://gitlab.com/cecashon/OrderedSetVelociRaptor/blob/master/Misc/Pipes/gnuplot5.c At one time gnuplot could directly write to GTK but that was a possible security problem so it no longer works to do this.

Re: "draw" icon with string

2018-09-10 Thread Eric Cashon via gtk-app-devel-list
Give this a try. It creates a surface, draws on it and then returns the surface so that it can be put in an image widget. import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk, Gdk import cairo class MainWindow(Gtk.Window):     def __init__(self):    

Re: Use Xcode to run Gtk code instead of terminal

2018-07-20 Thread Eric Cashon via gtk-app-devel-list
Hi Evan, I am unfamiliar with Xcode but if you can compile the code at the command line and have pkg-config working then check where the include files are that you need and add them to your Xcode development environment. Try pkg-config --cflags --libs gtk+-3.0 at the command line for your

Re: GtkTextBuffer : Applying tags to newly input text

2018-06-22 Thread Eric Cashon via gtk-app-devel-list
With the text buffer and tag table you can get the text with pango attributes or even rebuild pango markup for print output. This allows the pango markup to be parsed into and then to be extracted from the text buffer without loss(Easier said than done). You only need one text buffer to

Re: GtkTextBuffer : Applying tags to newly input text

2018-06-21 Thread Eric Cashon via gtk-app-devel-list
The textview understands Pango markup. Maybe something to give a try. There are a lot of text formats and you might have to do some text parsing depending on the format. If it is possible to use gtk_text_buffer_insert_markup(), this can save a lot of time dealing with text tags especially

Re: GtkTextBuffer : Applying tags to newly input text

2018-06-13 Thread Eric Cashon via gtk-app-devel-list
Hi Gary, Test setting up your callback with g_signal_connect_after. Then the location iter should be at the end of the insert. Then the tag can be applied to the inserted text. Eric //gcc -Wall highlight1.c -o highlight1 `pkg-config --cflags --libs gtk+-3.0` #include static

Re: Link Gtk.ListStore to the real data

2018-06-02 Thread Eric Cashon via gtk-app-devel-list
Try a relational database. Sqlite is an easy one to use. It can sort and save data to multiple tables. Use the list model and treeview to retrieve and view the data. That way the columns can be set up dynamically along with the renderer. Use SQL to update the database. Eric

Re: This takes 30 secs to render

2018-06-01 Thread Eric Cashon via gtk-app-devel-list
The other way to go about it is to just use cairo. I don't think that it will give a speed improvement but it might be worth a try. I figure you are trying to scale the png first and then draw it in a widget. Once the image is sized it shouldn't be a problem to draw quickly. Eric //gcc

Re: PyGObject Maybe bug with alternate row colors in a Gt.TreeView

2018-05-16 Thread Eric Cashon via gtk-app-devel-list
I took a look at the stackoverflow discussion about this and there is some sample code there to change colors of individual records in the treeview list. You can no longer do even and odd colors in CSS but being able to connect a cell renderer property to a column value can be very useful.

Re: Need help in GTK3 Draw event

2018-04-28 Thread Eric Cashon via gtk-app-devel-list
Hi Dhrubajyoti, The textview widget has text tags built in that you can use to draw rectangles around text. If you want to draw a rectangle to block out text you can match the background and foreground colors. This code works on Ubuntu16.04, GTK3.18 and Python2.7. Give it a try and see

Re: Using Gtk.Builder to create a menubar.

2018-04-26 Thread Eric Cashon via gtk-app-devel-list
"1. It uses "QMenu" (from Gtk or Gio?) to build a menu structure. I would prefere this way instead of an XML string. It should be possible in Python, too? Gtk.Menu or Gio.Menu?" My understanding of this is that the GMenu is used with the GtkApplication and a GtkMenu is used with the "regular"

Re: Using Gtk.Builder to create a menubar.

2018-04-25 Thread Eric Cashon via gtk-app-devel-list
There is a basic setup for the Gtk Application in Python here https://developer.gnome.org/gnome-devel-demos/stable/hello-world.py.html.en For C you can check https://github.com/cecashon/OrderedSetVelociRaptor/blob/master/Misc/Csamples/gtk_app1.c which has a menu but doesn't use builder

Re: Overriding CSS style

2018-04-19 Thread Eric Cashon via gtk-app-devel-list
Hi Yannick, You have some options here. You can set a priority with https://developer.gnome.org/gtk3/stable/GtkStyleContext.html#gtk-style-context-add-provider with CSS. If you want to just stick with drawing in C, connect your "draw" handler for the window. If you need a pixbuf you can

Re: Scrolling to a GtkListBoxRow after adding it to a GtkListBox

2018-04-15 Thread Eric Cashon via gtk-app-devel-list
" Is the issue that the widget is not yet drawn, so it size is not settled yet? Total guesses: What about using g_signal_connect_after on size-allocate? Or connecting to map-event signal on that widget? Or spinning on gtk_events_pending() until all are done, then scroll down? " Hi Matthew

Re: Scrolling to a GtkListBoxRow after adding it to a GtkListBox

2018-04-14 Thread Eric Cashon via gtk-app-devel-list
Hi Mike, It looks like the new rows height isn't getting added to the adjustment. If the height of the new row gets added to the upper value of the adjustment then the last row of the list box can be shown when added. This is what I came up with to test it out. Is this similar to what you

Re: A simple GtkSpinner is very costly in CPU cycles

2018-03-22 Thread Eric Cashon via gtk-app-devel-list
Hi Kian For effeciency, use one of the default cursors. https://developer.gnome.org/gdk3/stable/gdk3-Cursors.html If you want, you can try creating your own cursor with animation and using that. I got this working on my netbook which isn't a very high powered computer by todays

Re: LuckyB.C.'s reply to GtkDrawingArea "width" and "height"

2018-03-17 Thread Eric Cashon via gtk-app-devel-list
Hi Roger, I spend a bit of time drawing with cairo and GTK. If I get a drawing to work out then maybe merge it into a widget for reuse. Sort of a bunch of rough drafts in https://github.com/cecashon/OrderedSetVelociRaptor/tree/master/Misc/cairo_drawings and then one back in Misc is

Re: Lucky B.C.'s reply to GtkDrawingArea "width" and "height"

2018-03-06 Thread Eric Cashon via gtk-app-devel-list
Hi Roger, Not sure about your builder question and setting the width and height of the drawing area there. For drawing lines though it looks like you are trying to get the width and height of the GtkWindow instead of the drawing area. The drawing area widget is passed to your "draw"

Re: GtkTreeViewColumn width

2018-02-18 Thread Eric Cashon via gtk-app-devel-list
Try switching the sizing to what is needed. Something like ... gint combo_id=gtk_combo_box_get_active(combo); if(combo_id==0) { g_print("%i\n", gtk_tree_view_column_get_width(column2)); gtk_tree_view_column_set_sizing(GTK_TREE_VIEW_COLUMN(column2),

Re: GtkTreeViewColumn width

2018-02-18 Thread Eric Cashon via gtk-app-devel-list
Hi Phil, You should be able to resize columns if you want. If you have set sizes of text to display in the tree view and want to allocate sizes you can do that. Eric /* Tested with Ubuntu16.04 and GTK3.18. gcc -Wall tree_column1.c -o tree_column1 `pkg-config --cflags --libs

Re: Scrolling a GtkTreeview cell

2018-01-25 Thread Eric Cashon via gtk-app-devel-list
Hi Kian, A list box is more flexible for allowing different widgets but the performance might not be so good if you have a lot of rows. Don't have the numbers to show that though. You can put your individual widgets into a scrolled window if you want. The scroll bars will show if the

Re: Scrolling a GtkTreeview cell

2018-01-24 Thread Eric Cashon via gtk-app-devel-list
Hi Kian, Have you tried a GtkListBox for this? You can probably setup a scrolling window in a row in a listbox. https://blog.gtk.org/2017/06/01/drag-and-drop-in-lists-revisited/ Eric ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org

Re: g_log_set_fatal_mask() not working for me.

2017-12-18 Thread Eric Cashon via gtk-app-devel-list
I found this bug for the scrollbar warning. https://bugzilla.gnome.org/show_bug.cgi?id=769566 I don't know about the critical warning that you have or have a solution figured out. I am not much help there. Eric ___ gtk-app-devel-list mailing

Re: g_log_set_fatal_mask() not working for me.

2017-12-17 Thread Eric Cashon via gtk-app-devel-list
Hi Richard, This sounds similar to the problem Dino Aljević had in "Scrolled TreeView and size allocation warnings" in this list in September? I can get the warning "(treeview4:3830): Gtk-WARNING **: Allocating size to GtkWindow 0x843e188 without calling

Re: GTK3 - GtkExpander problem, bug ?

2017-12-15 Thread Eric Cashon via gtk-app-devel-list
Thanks Matthias. I probably should have checked bugzilla first. Just rebuilt GTK to version 3.22.26 and it works fine. There is no click through after closing the expander. Eric ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org

Re: GTK3 - GtkExpander problem, bug ?

2017-12-14 Thread Eric Cashon via gtk-app-devel-list
Hi Sébastien, An out of sync reply. I must have accidently deleted your last response after I read it. Also I didn't notice there were two mailing lists referenced. Probably just need the app dev list. It looks like it is a bug that has been recently introduced. If I test, test.c with

Re: GTK3 - GtkExpander problem, bug ?

2017-12-14 Thread Eric Cashon via gtk-app-devel-list
Hi Sébastien, If I try some test code... it should work. The code uses a grid instead of a fixed container. Is this similar to what you have tried? Eric /* gcc -Wall buttons1.c -o buttons1 `pkg-config --cflags --libs gtk+-3.0` Tested with GTK3.18 on Ubuntu16.04 */ #include static

Re: gtk_widget_size_allocate(): attempt to allocate widget with width -19 and height 1

2017-12-04 Thread Eric Cashon via gtk-app-devel-list
Hi Franco, I see "margin-left" is deprecated since version 3.12. This might work. If you set the container margin of the grid and then individually place your widgets in the locations that you want them,,, hopefully no warnings. I don't get any warnings on GTK3.18. Will something like this

Re: How would I change the text style in a gedit plugin?

2017-11-26 Thread Eric Cashon via gtk-app-devel-list
This is similar but just using GTK. You get the iters for the start and end of the range that you want to tag and apply the tag to it. Eric import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk class TextBox(Gtk.TextView): def __init__(self):

Re: GTK PageSetupUnixdialog

2017-10-17 Thread Eric Cashon via gtk-app-devel-list
Hi Thomas, What language are you using? I think that the best tutorial for GTK+ right now is the gtkmm tutorial. They have a section on printing. https://developer.gnome.org/gtkmm-tutorial/stable/chapter-printing.html.en If you aren't programming in C++ the tutorial still is a good

Re: GtkSource.PrintCompositor: How to possible printing plain text documents without lost blank lines and indentations?

2017-10-16 Thread Eric Cashon via gtk-app-devel-list
Hi Attila, The text buffer does return the correct number of chars with spaces. If I get a char count on the lines with or without numbers it returns the correct number. When I export to PDF the layout is the same as the print preview. When I test with pdftotext then, as you say, it doesn't

Re: GtkSource.PrintCompositor: How to possible printing plain text documents without lost blank lines and indentations?

2017-10-15 Thread Eric Cashon via gtk-app-devel-list
OK, you got me on the PDF. I don't know about that. I think a monospace font will help though because they are easier to keep track of rows and columns since all the characters are in the same sized rectangle. The Marburg font is also in a constant sized rectangle. I don't know how to put

Re: GtkSource.PrintCompositor: How to possible printing plain text documents without lost blank lines and indentations?

2017-10-14 Thread Eric Cashon via gtk-app-devel-list
Here is something else that might help. Try a monospace font to test with. If you use a monospace font then your spacing should be kept correct. If I draw a grid around the characters, monospace will hold the spacing to the 28x32 grid. Eric ... new_font = Pango.FontDescription("Monospace

Re: GtkSource.PrintCompositor: How to possible printing plain text documents without lost blank lines and indentations?

2017-10-14 Thread Eric Cashon via gtk-app-devel-list
Hi Attila, I don't know the internals of how Pango deals with the different fonts for putting them on a layout. I have bumped into utf8_casefold() and utf8_normalize() before so I know fonts can get complicated. Maybe someone with more knowledge than I have about this can help. The first

Re: GtkSource.PrintCompositor: How to possible printing plain text documents without lost blank lines and indentations?

2017-10-13 Thread Eric Cashon via gtk-app-devel-list
Hi Attila, You have a print dialog and click on "Print to File" to save the contents to a PDF file and that file is not being formatted correctly and isn't the same as what is in the print preview? I tried a small test program. It prints well to PDF with the extra lines. Does this program

Re: How to set the size of a combo box?

2017-10-08 Thread Eric Cashon via gtk-app-devel-list
Hi Lars, There are a few things that you can try to see if you can get the combo box to format how you want it. The first is to create the combo with gtk_combo_box_new_with_model(). That way you can setup your cell renderer and be able to set properties of how the combo box is going to be

Re: Mouse leave on a row of GtkTreeView

2017-09-19 Thread Eric Cashon via gtk-app-devel-list
With a treeview you can try measuring your rows and figure out where your cursor is in your treeview. Try the following out and see if it is of any help. Eric /* With Ubuntu16.04 and GTK3.18. gcc -Wall tree_row1.c -o tree_row1 `pkg-config --cflags --libs gtk+-3.0` */ #include

Re: Mouse leave on a row of GtkTreeView

2017-09-19 Thread Eric Cashon via gtk-app-devel-list
Could you use a GtkListBox? With a list box you can add a widget to the row and connect the "enter-notify-event" and "leave-notify-event" signals. There is example code for a list box at https://blog.gtk.org/2017/06/01/drag-and-drop-in-lists-revisited/ It is drag and drop but you could

Re: Show dialog after hide another

2017-09-09 Thread Eric Cashon via gtk-app-devel-list
Hi Ruben, You can give the following a try and see if it helps. Basically you don't want to bind up the "main" thread with a long running function and freeze your UI. Eric /* gcc -Wall firmware1.c -o firmware1 `pkg-config --cflags --libs gtk+-3.0` Tested on Ubuntu16.04 and GTK3.18 */

Re: Multi page widgets in Gtk

2017-09-03 Thread Eric Cashon via gtk-app-devel-list
Hi Mike, A GtkAssistant or even a GtkNotebook might work for your program. What database are you using? There is an easy example of connecting to and getting data from sqlite at https://github.com/cecashon/OrderedSetVelociRaptor/blob/master/simple_sqlite_viewer.c that might be helpful. You

Re: turn on italics in TextView

2017-08-30 Thread Eric Cashon via gtk-app-devel-list
Hi Doug, I would consider it a usability bug but not necessarily a textview widget bug. If you add text, that doesn't have an indent tag, to the start of the line then it doesn't get indented. I suppose you could check the whole line for an indent tag but that would go against performance.

Re: "click" event on a GtkSpinEntry

2017-08-22 Thread Eric Cashon via gtk-app-devel-list
Hi Nicola, This isn't pretty but it works. There is a good read about the spin button at https://blog.gtk.org/author/ebassi/ with Tim Bader on April 25, 2017. I don't know if you have seen that. My first try was just to get the GdkWindow of the spin button but that gave me the main

Re: turn on italics in TextView

2017-08-15 Thread Eric Cashon via gtk-app-devel-list
Have you tried gtk_text_buffer_insert_with_tags_by_name() to insert text with a tag at an iter? What tag combo do you use to get the cursor to bounce around? If I test having two indent tags on the same line, the first one applied wins out. This is what I tested with. Eric /* gcc -Wall

Re: turn on italics in TextView

2017-08-15 Thread Eric Cashon via gtk-app-devel-list
Hi Doug, I made a bit of a pointer mess there. Not the best of answers or way to go about iterating through a list. Looking at some GTK code, this is better done with a for loop. As usual, you don't want to move the pointer you get from gtk_text_iter_get_tags() and then free it. This will

Re: GdkPixbuf and click events

2017-08-03 Thread Eric Cashon via gtk-app-devel-list
Hi Ferdinand, You can also try putting the pixbuf in an image widget and that into an event box. Eric //gcc -Wall right_click1.c -o right_click1 `pkg-config --cflags --libs gtk+-3.0` #include static GdkPixbuf* draw_a_pixbuf() { cairo_surface_t

Re: Moving/resizing a window in real-time

2017-07-20 Thread Eric Cashon via gtk-app-devel-list
Hi Alex, The OpenCV window_gtk.cpp isn't so simple. A lot of tough concepts there. For example the code is written for compiling with both GTK2 and GTK3, makes use of threads, creates a custom GTK widget, uses GTK OpenGL if it can, etc. The GTK functions can only be called on the "main"

Re: Can I make GtkPlug transparent?

2017-06-26 Thread Eric Cashon via gtk-app-devel-list
It looks like both the plug and socket draw to the same window. That would mean that you would have to draw your window background in both the plug and socket "draw" callback functions. There is a plug2.c and socket2.c in the following folder that sets the transparency on the different

Re: Can I make GtkPlug transparent?

2017-06-26 Thread Eric Cashon via gtk-app-devel-list
Hi Lihao, If you set the socket color you will be OK. You won't have to worry about the transparency of the plug, in that case. For setting the transparency for the different windows you can try setting the window, socket and plug widgets with the following. It worked on GTK3.18. Couldn't

Re: Combobox disable item

2017-06-23 Thread Eric Cashon via gtk-app-devel-list
Add an extra column to your list and use that to set your "sensitive" property for the row. Eric /* gcc -Wall combo_filter2.c -o combo_filter2 `pkg-config --cflags --libs gtk+-3.0` Tested on GTK3.18 and Ubuntu16.04 */ #include static void combo2_changed(GtkComboBox *combo2,

Re: Combobox disable item

2017-06-22 Thread Eric Cashon via gtk-app-devel-list
Hi Mike, What part of the combo box are you trying to disable? If you want to filter rows or columns you can set up a tree model filter to do so. Maybe something like the following? Eric /* gcc -Wall combo_filter1.c -o combo_filter1 `pkg-config --cflags --libs gtk+-3.0` Tested

Re: GtkDrawingArea size request

2017-06-22 Thread Eric Cashon via gtk-app-devel-list
Hi Ruben, You might consider allowing the gauge to expand with the window size. This makes the gauge a lot more flexible. When drawing a gauge it is useful to get a general coordinate drawing on screen that you can check your gauge drawing with. Both cartesian coordinates and radial

Re: turn on italics in TextView

2017-06-20 Thread Eric Cashon via gtk-app-devel-list
!=NULL); } else g_print("No Tag\n"); if(tlist!=NULL) g_slist_free(tlist); ... -----Original Message- From: Eric Cashon via gtk-app-devel-list <gtk-app-devel-list@gnome.org> To: dougm <do...@bravoecho.net> Cc: gtk-app-devel-list <gtk-app-devel-list

Re: turn on italics in TextView

2017-06-20 Thread Eric Cashon via gtk-app-devel-list
Another option is to look at the properties of the tags to get the information that you need. This might work better than saving globals and matching pointers. Eric ... GSList *tlist=NULL; GSList *next=NULL; tlist=gtk_text_iter_get_tags(); if(tlist!=NULL) { do

Re: turn on italics in TextView

2017-06-14 Thread Eric Cashon via gtk-app-devel-list
Here are a few things that might improve the above code a little. Use gtk_button_set_focus_on_click(GTK_BUTTON(toggle1), FALSE); instead of a grab. Also the global gboolean can be eliminated if you pass the toggle button pointer to the "insert-text" callback. Then you can just use

Re: turn on italics in TextView

2017-06-13 Thread Eric Cashon via gtk-app-devel-list
Hi Doug, You can try using the "insert-text" callback to set your italics on the inserted text. This is what I came up with to test. The signal is connected after so that the update occurs first. Careful about not changing the location iter also since there is a warning in the documentation

Re: GtkLabel max-width-chars with ellipsize broken?

2017-06-13 Thread Eric Cashon via gtk-app-devel-list
What version of GTK are you using? It does work on my computer. The label expands and shrinks as the window expands and shrinks and the label stops expanding at 012345678901234567... I take that to be 20 chars if you start at 0 and include the three dots. The tooltip shows the full string.

Re: Integrate IP Camera stream in GTK app

2017-06-13 Thread Eric Cashon via gtk-app-devel-list
Hi Ruben, I am sure you can do that with GTK and GStreamer. That way the code would be portable across platforms. I don't have any examples of using GStreamer to get video from an ip camera. I have some test code that will show the video from the local webcam.

Re: GtkLabel max-width-chars with ellipsize broken?

2017-06-10 Thread Eric Cashon via gtk-app-devel-list
Hi infirit, Give the hexpand a try and see if that works. It works for me on Python3.5 and GTK3.18 Eric ... halign=Gtk.Align.CENTER, hexpand=True) .. ___ gtk-app-devel-list mailing list

Re: Close button in GtkNotebook

2017-05-28 Thread Eric Cashon via gtk-app-devel-list
Hi Augusto, This doesn't use glade but it might help out. You can add a label and button to a box and add it to the notebook tab. In the button "clicked" callback you can us the notebook pointer if you need that variable. If you want to be able to really customize the look and size of the

Re: gtktree: combination filter and using gtk_tree_model_foreach

2017-05-24 Thread Eric Cashon via gtk-app-devel-list
Hi Rob, The trick here is to use gtk_tree_model_filter_convert_iter_to_child_iter(). That will get the iter that you need. It will work the same on both GTK2 and GTK3. You have to be a little careful with gtk_tree_model_foreach(). It is easy to add nodes and then the function will check

Re: Custom GtkHeaderBar

2017-04-17 Thread Eric Cashon via gtk-app-devel-list
If I use gtk_style_context_add_class(context, "header"); The background drawn to the event box window is transparent on my computer. I just used "menu" to test a different color from the theme but there are many that you can test. The style classes are at the bottom of the documentation

Re: Custom GtkHeaderBar

2017-04-15 Thread Eric Cashon via gtk-app-devel-list
I gave it another try and "header" gtk_style_context_add_class() is transparent. I can use "menu" and that returns a darker color that is used on the title bar. It is C again. I did get foo.vala output to foo.c. Too much stuff. Eric /* gcc -Wall box1.c -o box1 `pkg-config --cflags

Re: Custom GtkHeaderBar

2017-04-14 Thread Eric Cashon via gtk-app-devel-list
I suspect set_titlebar(header); is causing the problem. If you remove that, then you will have a box that you place in the main window. If it is a header bar box it will be below the titlebar. The box itself is just doing the layout so it uses the window behind it. You can draw on the

Re: Custom GtkHeaderBar

2017-04-13 Thread Eric Cashon via gtk-app-devel-list
Hi Fujiwara, The GtkBox is going to use the background window for it's color. The box just does the layout. If you create a header bar from a box you will have to draw on the background where your header bar is going to be. This can get a little tricky to get the measurements that you need. A

Re: gtk function with argv

2017-04-11 Thread Eric Cashon via gtk-app-devel-list
Hi Ruben, I think what you are looking for is a C variadic function. Something that works like g_object_set() with a Null terminated list of arguments. Using dynamic glib containers might be a better choice. It is simpler to just pass a single pointer with your user_data to functions which

Re: Combobox focus event

2017-04-08 Thread Eric Cashon via gtk-app-devel-list
Another thing to give a try is just to set a boolean in the "set-focus-child" callback. Not sure if this will always work. I think that it should. I don't know the best workaround for the "focus-in-event" in a combo box. It isn't obvious how to connect that signal for the combobox. Eric

Re: Combobox focus event

2017-04-07 Thread Eric Cashon via gtk-app-devel-list
Hi Nicola, The "set-focus-child" on the container fires for the "focus-in-event" and "focus-out-event". I forgot about those container functions though. You can get the toggle button pointer from the container and set up your "focus-in-event". That way there is no ugly business of using a

Re: Combobox focus event

2017-04-07 Thread Eric Cashon via gtk-app-devel-list
Thomas, Your original question looked easy. Connect the "focus-in-event" to the combo box and everything will work fine. The "focus-in-event" works with other widgets. So I tried it out. Couldn't get it to work. Tried changing some combo box functions around and still couldn't get it to work.

Re: Combobox focus event

2017-04-06 Thread Eric Cashon via gtk-app-devel-list
Hi Thomas, You can try getting the private toggle button in the combo box. This isn't a solution using the given GTK api but if you want to inspect the how to get the "focus-in-event" to work with a combo box, this might be helpful. You are working in C right? Eric /* gcc -Wall

Re: GFileMonitor - g_signal_handler_block "changed" signal doesn't block handler?

2017-04-01 Thread Eric Cashon via gtk-app-devel-list
Hi David, Not sure about this one. I tested some code out to see if I could figure it out. Had the same problem that you had with the "changed" signal not being blocked. If I change the rate of the file monitor and try to spool out the events, I can block the "changed" signal. Not something

Re: drawing GtkDrawingArea surface on motion-notify-event

2017-03-20 Thread Eric Cashon via gtk-app-devel-list
Hi Marcin, One approach is to use a GtkOverlay. Draw the shape on the top and then save the coordinates of the shape if it is what you want. Then you can draw the saved shapes on the lower drawing area.

Re: Seperating Multiple processes

2017-03-17 Thread Eric Cashon via gtk-app-devel-list
Some follow up on this. If you are starting a separate process to run your transcoding you need to use an async version of your run_cmd(). Otherwise the program will wait until the function returns and bind up the main glib thread if the function takes a while. This might be the easiest way

Re: How to set initial size of TextView?

2017-03-14 Thread Eric Cashon via gtk-app-devel-list
Hi Chris, Try getting the font height and base the textview height on that. If you use the font ascent you might have to pad it a little but it should give you a consistent value to size your textviews with based on font size. Eric /* gcc -Wall textview_height1.c -o textview_height1

Re: gtk3 layout background image

2017-03-14 Thread Eric Cashon via gtk-app-devel-list
The layout is similar to a drawing area. Set up your "draw" callback and draw what you like. You can put your pictures in there also and be able to scroll them easily. /* gcc -Wall layout1.c -o layout1 `pkg-config --cflags --libs gtk+-3.0` Tested on Ubuntu16.04 and GTK3.18 */

Re: Seperating Multiple processes

2017-03-10 Thread Eric Cashon via gtk-app-devel-list
Hi Mike, Have you looked at using a thread pool? https://developer.gnome.org/glib/stable/glib-Thread-Pools.html If you have a folder full of files that you want to transcode you can set up your thread pool to cycle through them. Eric ___

Re: Homogeneous table

2017-03-09 Thread Eric Cashon via gtk-app-devel-list
Hi Ruben, Consider using a drawing area and GTK3. There are more drawing and graphical capabilities in GTK3. Going forward to GTK4 I expect even more drawing capabilities since every computer sold these days has a gpu and the software can take advantage of that. With a drawing area you get

Re: Gtk+ progress bar color

2017-03-08 Thread Eric Cashon via gtk-app-devel-list
If the default progress bar in GTK isn't what you are looking for then you can always make your own. You can design it how you want easy enough with a drawing area. With GTK3 you have OpenGL, Cairo, gradients, tensor-product patch meshes, etc. to draw with. You even have a frame clock for

Re: Programatically activate menu like a mouse click

2017-02-23 Thread Eric Cashon via gtk-app-devel-list
Hi John, Give this a try. It might be close to what you are after. Eric #!/usr/bin/python import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk, Gdk class MainWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="Menu Popup")

Re: Does gtk2 provide a case 'in'-sensitive text search via 'gtk_text_iter_..._search'?

2017-02-23 Thread Eric Cashon via gtk-app-devel-list
Hi David, I tried out gtkedit and it compiled and worked fine. Did a few searches and it found the words. When I compiled I got a few warnings like the following. gtk_common_dlg.c: In function ‘err_dialog’: gtk_common_dlg.c:8:9: warning: format not a string literal and no format

Re: Does gtk2 provide a case 'in'-sensitive text search via 'gtk_text_iter_..._search'?

2017-02-17 Thread Eric Cashon via gtk-app-devel-list
David, I asked a question about this on the gtk-devel-list https://mail.gnome.org/archives/gtk-devel-list/2017-January/msg00018.html last month. A lot I didn't know about this. For UTF-8 it is a bit complicated even for English. For GTK's case in-sensitive search they use a casefold

Re: Removing entries from EntryCompletion

2017-02-13 Thread Eric Cashon via gtk-app-devel-list
Hi Jeff, For this you need the private data of the entry completion to get it to work. That means looking around the GTK source and seeing how you might put something together. Of course, it is not recommended to use something that can be changed at anytime by the GTK developers. So... I gave

Re: GtkPrintOperation; request for assistance

2017-02-10 Thread Eric Cashon via gtk-app-devel-list
I didn't get to the paper size setup there. Just tried to make sense out of getting text to print on multiple pages as simply as possible. I don't have a printer that I can test with either so I am no help there. Printing is difficult. You can draw easy enough on a drawing area but then

Re: GtkPrintOperation; request for assistance

2017-02-09 Thread Eric Cashon via gtk-app-devel-list
Hi Norbert, I hit the reply instead of reply all on the first send. Try again. There is some information about printing at https://developer.gnome.org/gtkmm-tutorial/stable/chapter-printing.html.en It is in C++ but the C++ tutorial is very good. Sometimes I go there to figure out how to

Re: Does gtk2 provide a case 'in'-sensitive text search via 'gtk_text_iter_..._search'?

2017-01-26 Thread Eric Cashon via gtk-app-devel-list
I worked on this a little more and tried to make it UTF-8 compliant. Highlighted the text also. It should still be efficient since it is only doing a single pass over each char. I am sure there are things that I haven't considered but it does a little more than the first try at it.

Re: watching a file descriptor in gtk3

2017-01-23 Thread Eric Cashon via gtk-app-devel-list
Hi Roger, I put together a test example of GSubprocess. It starts Gnuplot, sets up the pipes and callbacks, and then when Gnuplot is done it opens the graph in an image widget. The GSubprocess will take care of the file descripters for you. Also, if I run valgrind with multiple plots being

Re: Does gtk2 provide a case 'in'-sensitive text search via 'gtk_text_iter_..._search'?

2017-01-19 Thread Eric Cashon via gtk-app-devel-list
In GTK3 you would have everything that you need. The gtk_text_iter_forward_search() function can use GTK_TEXT_SEARCH_CASE_INSENSITIVE. I don't see that in GTK2. Another thought. The GTK Source View can find words and highlight them for you. You might want to check that out also. It has some

  1   2   >