Re: Changing font of GtkSourceView changes font of GtkSourceMap

2019-03-04 Thread Mitko Haralanov via gtk-app-devel-list
More information at:
https://gitlab.gnome.org/GNOME/gtksourceview/commit/0ae462ebc8eceb810f176a21792a63de4efe597b

On Mon, Mar 4, 2019 at 8:41 AM Mitko Haralanov  wrote:
>
> I haven't played with the FontMap but was thinking of going the route
> of using CSS. That, in itself, is a bit of a hassle as I can't seem to
> find a way to convert a PangoFontDescription to CSS but there are some
> patches that I found online that should help.
>
> On Fri, Mar 1, 2019 at 7:16 PM Reuben Rissler  wrote:
> >
> >
> >
> > > I filed the following bug:
> > > https://gitlab.gnome.org/GNOME/gtksourceview/issues/41, which promptly
> > > got close as "expected behavior". Apparently, you'd either have to use
> > > CSS or install a new font map for the GtkSourceMap.
> > Sure is disappointingly helpful.
> >
> > I can't figure out the connection code between the FontMap and the
> > SourceMap.
> > >
> >
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Changing font of GtkSourceView changes font of GtkSourceMap

2019-03-04 Thread Mitko Haralanov via gtk-app-devel-list
I haven't played with the FontMap but was thinking of going the route
of using CSS. That, in itself, is a bit of a hassle as I can't seem to
find a way to convert a PangoFontDescription to CSS but there are some
patches that I found online that should help.

On Fri, Mar 1, 2019 at 7:16 PM Reuben Rissler  wrote:
>
>
>
> > I filed the following bug:
> > https://gitlab.gnome.org/GNOME/gtksourceview/issues/41, which promptly
> > got close as "expected behavior". Apparently, you'd either have to use
> > CSS or install a new font map for the GtkSourceMap.
> Sure is disappointingly helpful.
>
> I can't figure out the connection code between the FontMap and the
> SourceMap.
> >
>
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Re: Changing font of GtkSourceView changes font of GtkSourceMap

2019-03-01 Thread Mitko Haralanov via gtk-app-devel-list
So, to close the loop...

I filed the following bug:
https://gitlab.gnome.org/GNOME/gtksourceview/issues/41, which promptly
got close as "expected behavior". Apparently, you'd either have to use
CSS or install a new font map for the GtkSourceMap.

On Fri, Mar 1, 2019 at 2:30 PM Reuben Rissler  wrote:
>
>
> I forgot to cc the list.
>
> On 03/01/2019 03:23 PM, Mitko Haralanov wrote:
> > Thanks for the example.
> >
> > I modified it to illustrate the behavior:
> It verily looks like a bug to me. I can't figure out a way to work
> around this either.
> >
> > import gi
> > gi.require_version('GtkSource', '3.0')
> > gi.require_version('Gtk', '3.0')
> > from gi.repository import Gtk, GtkSource, GObject, Pango
> >
> >
> > def set_font(button, view, map, tag):
> >  font_name = button.get_font_name()
> >  font = Pango.font_description_from_string(font_name)
> >  map_font = font.copy()
> >  map_font.set_size(1*Pango.SCALE)
> >  tag.set_property("font-desc", font)
> >  buffer = view.get_buffer()
> >  buffer.apply_tag(tag, buffer.get_start_iter(), buffer.get_end_iter())
> >  map.set_property("font-desc", map_font)
> >
> > class GUI:
> >  def __init__(self):
> >
> >  GObject.type_register(GtkSource.View)
> >  window = Gtk.Window()
> >  window.connect('destroy', self.on_window_destroy)
> >  box = Gtk.VBox()
> >  window.add(box)
> >  fontchooser = Gtk.FontButton()
> >  box.pack_start(fontchooser, False, True, 0)
> >  pane = Gtk.Paned(orientation=Gtk.Orientation.HORIZONTAL)
> >  box.pack_start(pane, True, True, 0)
> >  s_view = GtkSource.View()
> >  buffer = s_view.get_buffer()
> >  with open("/usr/share/doc/glade/README", 'r') as fd:
> >  buffer.set_text(fd.read())
> >  tag = buffer.create_tag("buffer-font")
> >  pane.pack1(s_view, True, False)
> >  s_map = GtkSource.Map()
> >  s_map.set_view(s_view)
> >  pane.pack2(s_map, True, False)
> >  fontchooser.connect("font-set", set_font, s_view, s_map, tag)
> >  window.show_all()
> >
> >  def on_window_destroy(self, window):
> >  Gtk.main_quit()
> >
> > if __name__ == "__main__":
> >  app = GUI()
> >  Gtk.main()
> >
> > Give it try and change the font of the view. You'll see that the font
> > of the map changes to the same font as the view, including *the same
> > size*.
> >
> > Thank you.
> >
> > On Thu, Feb 28, 2019 at 8:47 AM Reuben Rissler  wrote:
> >> I am not sure if this helps any:
> >>
> >>
> >> #!/usr/bin/env python
> >>
> >> import gi
> >> gi.require_version('GtkSource', '3.0')
> >> gi.require_version('Gtk', '3.0')
> >> from gi.repository import Gtk, GtkSource, GObject, Pango
> >>
> >> class GUI:
> >>   def __init__(self):
> >>
> >>   GObject.type_register(GtkSource.View)
> >>   window = Gtk.Window()
> >>   window.connect('destroy', self.on_window_destroy)
> >>   pane = Gtk.Paned(orientation = Gtk.Orientation.HORIZONTAL)
> >>   window.add(pane)
> >>   s_view = GtkSource.View()
> >>   pane.pack1(s_view)
> >>   s_map = GtkSource.Map()
> >>   s_map.set_view(s_view)
> >>   pane.pack2(s_map)
> >>   s_map.set_property('font-desc',
> >> Pango.font_description_from_string("Sans 3"))
> >>   window.show_all()
> >>
> >>   def on_window_destroy(self, window):
> >>   Gtk.main_quit()
> >>
> >>
> >> if __name__ == "__main__":
> >>   app = GUI()
> >>   Gtk.main()
> >>
> >>
> >>
> >> On 02/27/2019 12:36 PM, Mitko Haralanov via gtk-app-devel-list wrote:
> >>> Still looking for some help on this.
> >>>
> >>> Thank you.
> >>>
> >>> On Mon, Feb 11, 2019 at 9:11 AM Mitko Haralanov  
> >>> wrote:
> >>>> Any help would be appreciated.
> >>>>
> >>>> Thank you.
> >>>>
> >>>> On Tue, Feb 5, 2019 at 2:28 PM Mitko Haralanov  
> >>>> wrote:
> >>>>> Forwarding to gtk-app-devel since there appea

Re: Changing font of GtkSourceView changes font of GtkSourceMap

2019-03-01 Thread Mitko Haralanov via gtk-app-devel-list
Thanks for the example.

I modified it to illustrate the behavior:

import gi
gi.require_version('GtkSource', '3.0')
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GtkSource, GObject, Pango


def set_font(button, view, map, tag):
font_name = button.get_font_name()
font = Pango.font_description_from_string(font_name)
map_font = font.copy()
map_font.set_size(1*Pango.SCALE)
tag.set_property("font-desc", font)
buffer = view.get_buffer()
buffer.apply_tag(tag, buffer.get_start_iter(), buffer.get_end_iter())
map.set_property("font-desc", map_font)

class GUI:
def __init__(self):

GObject.type_register(GtkSource.View)
window = Gtk.Window()
window.connect('destroy', self.on_window_destroy)
box = Gtk.VBox()
window.add(box)
fontchooser = Gtk.FontButton()
box.pack_start(fontchooser, False, True, 0)
pane = Gtk.Paned(orientation=Gtk.Orientation.HORIZONTAL)
box.pack_start(pane, True, True, 0)
s_view = GtkSource.View()
buffer = s_view.get_buffer()
with open("/usr/share/doc/glade/README", 'r') as fd:
buffer.set_text(fd.read())
tag = buffer.create_tag("buffer-font")
pane.pack1(s_view, True, False)
s_map = GtkSource.Map()
s_map.set_view(s_view)
pane.pack2(s_map, True, False)
fontchooser.connect("font-set", set_font, s_view, s_map, tag)
window.show_all()

def on_window_destroy(self, window):
Gtk.main_quit()

if __name__ == "__main__":
app = GUI()
Gtk.main()

Give it try and change the font of the view. You'll see that the font
of the map changes to the same font as the view, including *the same
size*.

Thank you.

On Thu, Feb 28, 2019 at 8:47 AM Reuben Rissler  wrote:
>
> I am not sure if this helps any:
>
>
> #!/usr/bin/env python
>
> import gi
> gi.require_version('GtkSource', '3.0')
> gi.require_version('Gtk', '3.0')
> from gi.repository import Gtk, GtkSource, GObject, Pango
>
> class GUI:
>  def __init__(self):
>
>  GObject.type_register(GtkSource.View)
>  window = Gtk.Window()
>  window.connect('destroy', self.on_window_destroy)
>  pane = Gtk.Paned(orientation = Gtk.Orientation.HORIZONTAL)
>  window.add(pane)
>  s_view = GtkSource.View()
>  pane.pack1(s_view)
>  s_map = GtkSource.Map()
>  s_map.set_view(s_view)
>  pane.pack2(s_map)
>  s_map.set_property('font-desc',
> Pango.font_description_from_string("Sans 3"))
>  window.show_all()
>
>  def on_window_destroy(self, window):
>  Gtk.main_quit()
>
>
> if __name__ == "__main__":
>  app = GUI()
>  Gtk.main()
>
>
>
> On 02/27/2019 12:36 PM, Mitko Haralanov via gtk-app-devel-list wrote:
> > Still looking for some help on this.
> >
> > Thank you.
> >
> > On Mon, Feb 11, 2019 at 9:11 AM Mitko Haralanov  
> > wrote:
> >> Any help would be appreciated.
> >>
> >> Thank you.
> >>
> >> On Tue, Feb 5, 2019 at 2:28 PM Mitko Haralanov  
> >> wrote:
> >>> Forwarding to gtk-app-devel since there appears to be much more activity 
> >>> related to GtkSourceView.
> >>>
> >>> -- Forwarded message -
> >>> From: Mitko Haralanov 
> >>> Date: Tue, Feb 5, 2019, 13:42
> >>> Subject: Changing font of GtkSourceView changes font of GtkSourceMap
> >>> To: 
> >>>
> >>>
> >>> I can't figure out how to change the font of GtkSourceView and
> >>> GtkSourceMap in a reasonable way.
> >>>
> >>> According to the documentation, the View and the Map should be using
> >>> the same font but with the Map using a font size of 1pt. To me this
> >>> implies that when I change the font of the TextBuffer of the View
> >>> using tags, I can copy the PangoFontDescription to a new object,
> >>> change the font size to 1pt and set the new PangoFontDescription as
> >>> the "font-desc" property of the Map.
> >>>
> >>> In practice, however, the Map always has the exact same font size as
> >>> the View. No matter what I do, I can't seem to change the font size of
> >>> the Map to 1pt, unless I change the font size of the View to 1pt, as
> >>> well.
> >>>
> >>> What is the correct processes for changing the font size of both the
> >>> View and the Map?
> >>>
> >>> Thank you,
> >>> - Mitko
> > ___
> > 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: Changing font of GtkSourceView changes font of GtkSourceMap

2019-02-27 Thread Mitko Haralanov via gtk-app-devel-list
Still looking for some help on this.

Thank you.

On Mon, Feb 11, 2019 at 9:11 AM Mitko Haralanov  wrote:
>
> Any help would be appreciated.
>
> Thank you.
>
> On Tue, Feb 5, 2019 at 2:28 PM Mitko Haralanov  wrote:
> >
> > Forwarding to gtk-app-devel since there appears to be much more activity 
> > related to GtkSourceView.
> >
> > -- Forwarded message -
> > From: Mitko Haralanov 
> > Date: Tue, Feb 5, 2019, 13:42
> > Subject: Changing font of GtkSourceView changes font of GtkSourceMap
> > To: 
> >
> >
> > I can't figure out how to change the font of GtkSourceView and
> > GtkSourceMap in a reasonable way.
> >
> > According to the documentation, the View and the Map should be using
> > the same font but with the Map using a font size of 1pt. To me this
> > implies that when I change the font of the TextBuffer of the View
> > using tags, I can copy the PangoFontDescription to a new object,
> > change the font size to 1pt and set the new PangoFontDescription as
> > the "font-desc" property of the Map.
> >
> > In practice, however, the Map always has the exact same font size as
> > the View. No matter what I do, I can't seem to change the font size of
> > the Map to 1pt, unless I change the font size of the View to 1pt, as
> > well.
> >
> > What is the correct processes for changing the font size of both the
> > View and the Map?
> >
> > Thank you,
> > - Mitko
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Scrolling to a line in GtkTextView

2019-02-12 Thread Mitko Haralanov via gtk-app-devel-list
Hi,

In my application, I would like to have a GtkTextView be scrolled to a
particular line after the GtkTextBuffer is loaded.

According to the documentation, I can use gtk_text_view_scroll_to_mark() in
order to reliably scroll to the desired line after the line height
computation has been completed. In practice that doesn't work reliably.
Below is the code snippet that I am using:


while (delay++ < 100)
g_main_context_iteration(NULL, FALSE);
debug("Scrolling to line: %lu", lineno);
gtk_text_buffer_get_iter_at_line(GTK_TEXT_BUFFER(priv->sourceBuf),
, (gint)(lineno - 1));
debug("Line: %d, offset: %d", gtk_text_iter_get_line(),
  gtk_text_iter_get_offset());
gtk_text_buffer_place_cursor(GTK_TEXT_BUFFER(priv->sourceBuf), );
mark = gtk_text_buffer_get_mark(GTK_TEXT_BUFFER(priv->sourceBuf),
"result-view-search");
gtk_text_buffer_move_mark(GTK_TEXT_BUFFER(priv->sourceBuf), mark,
  );
gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(priv->sourceView), mark, 0.0,
 TRUE, 0.0, 0.5);

What I am noticing is that the reliability of this highly depends on the
line number to which I want to scroll and the length of the busy loop in
the beginning - the higher the line number, the longer the busy loop needs
to be in order to reliably scroll to that line.

If the busy loop is not long enough, the text view does scroll but not the
correct line.

What is the proper way to correctly and reliably scroll a GtkTextView to a
certain line?

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


Re: Force liststore to update when leaving treeview

2019-02-12 Thread Mitko Haralanov via gtk-app-devel-list
One idea is to hook the widget to the "leave-notify-event", which will
be triggered when the mouse leaves the widget.

On Tue, Feb 12, 2019 at 8:32 AM Mike Martin via gtk-app-devel-list
 wrote:
>
> Is this possible?
>
> I have a (for example) a grid which contains
> Various action widgets
> And a Treeview based on a liststore
>
> Is there any way to make sure that the changes made to a cell in the
> liststore are "committed" if I click on one of the other widgets
>
> I cant find anything to do this and if I leave the cell without pressing
> enter or clicking on another cell, all changes are lost
>
> thanks
>
> Mike
> ___
> 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: Changing font of GtkSourceView changes font of GtkSourceMap

2019-02-11 Thread Mitko Haralanov via gtk-app-devel-list
Any help would be appreciated.

Thank you.

On Tue, Feb 5, 2019 at 2:28 PM Mitko Haralanov  wrote:
>
> Forwarding to gtk-app-devel since there appears to be much more activity 
> related to GtkSourceView.
>
> -- Forwarded message -
> From: Mitko Haralanov 
> Date: Tue, Feb 5, 2019, 13:42
> Subject: Changing font of GtkSourceView changes font of GtkSourceMap
> To: 
>
>
> I can't figure out how to change the font of GtkSourceView and
> GtkSourceMap in a reasonable way.
>
> According to the documentation, the View and the Map should be using
> the same font but with the Map using a font size of 1pt. To me this
> implies that when I change the font of the TextBuffer of the View
> using tags, I can copy the PangoFontDescription to a new object,
> change the font size to 1pt and set the new PangoFontDescription as
> the "font-desc" property of the Map.
>
> In practice, however, the Map always has the exact same font size as
> the View. No matter what I do, I can't seem to change the font size of
> the Map to 1pt, unless I change the font size of the View to 1pt, as
> well.
>
> What is the correct processes for changing the font size of both the
> View and the Map?
>
> Thank you,
> - Mitko
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Fwd: Changing font of GtkSourceView changes font of GtkSourceMap

2019-02-05 Thread Mitko Haralanov via gtk-app-devel-list
Forwarding to gtk-app-devel since there appears to be much more activity
related to GtkSourceView.

-- Forwarded message -
From: Mitko Haralanov 
Date: Tue, Feb 5, 2019, 13:42
Subject: Changing font of GtkSourceView changes font of GtkSourceMap
To: 


I can't figure out how to change the font of GtkSourceView and
GtkSourceMap in a reasonable way.

According to the documentation, the View and the Map should be using
the same font but with the Map using a font size of 1pt. To me this
implies that when I change the font of the TextBuffer of the View
using tags, I can copy the PangoFontDescription to a new object,
change the font size to 1pt and set the new PangoFontDescription as
the "font-desc" property of the Map.

In practice, however, the Map always has the exact same font size as
the View. No matter what I do, I can't seem to change the font size of
the Map to 1pt, unless I change the font size of the View to 1pt, as
well.

What is the correct processes for changing the font size of both the
View and the Map?

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


Re: GtkTreeRowReference and Drag-and-Drop

2018-11-01 Thread Mitko Haralanov via gtk-app-devel-list
It seems to me that this is something that a Gtk developer would have to
answer. However, it doesn't seem like this list is visited by any. The
participation on this list seems to be pretty low.

On Wed, Oct 24, 2018 at 9:49 AM Mitko Haralanov 
wrote:

> I've implemented a treeview in my application, which has drag-and-drop
> enabled to allow re-ordering of the rows. To support tree model updates
> while the user is performing dnd operations, I also have
> GtkTreeRowReferences for each row in the model (the model will not have too
> many rows).
>
> However, when I move a row during model update, the tree row reference for
> that row become invalid after the row-deleted signal handler is processed.
> What is strange is that, according to the documentation, it seem that this
> is exactly what GtkTreeRowReference is supposed to handle. Shouldn't the
> reference be updated to point to the new row? Why would the reference
> become invalid if I've *moved* the model row instead of deleted it? The row
> still exists just at a different place.
>
> Can someone please clarify this?
> Thank you
>
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


GtkTreeRowReference and Drag-and-Drop

2018-10-24 Thread Mitko Haralanov via gtk-app-devel-list
I've implemented a treeview in my application, which has drag-and-drop
enabled to allow re-ordering of the rows. To support tree model updates
while the user is performing dnd operations, I also have
GtkTreeRowReferences for each row in the model (the model will not have too
many rows).

However, when I move a row during model update, the tree row reference for
that row become invalid after the row-deleted signal handler is processed.
What is strange is that, according to the documentation, it seem that this
is exactly what GtkTreeRowReference is supposed to handle. Shouldn't the
reference be updated to point to the new row? Why would the reference
become invalid if I've *moved* the model row instead of deleted it? The row
still exists just at a different place.

Can someone please clarify this?
Thank you
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: State actions and Glade

2018-10-04 Thread Mitko Haralanov via gtk-app-devel-list
Hi,

Thank you for your reply. I am not sure what you mean by "GtkToolbar
doesn't implement the GAction interface". In Glade, I can define the
specify the "Action Name" for each individual widget in the Toolbar. Those
action names get automatically linked to the actions that I've defined in
the my GActionEntry array. The only thing that does not work are the Radio
button actions.

Thank you,
Mitko

On Tue, Oct 2, 2018 at 4:19 PM  wrote:

>
> 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`
>
> #include
>
> static void get_active_radio(GtkWidget *button, GtkToolItem **radios)
>   {
> gint i=0;
>
> for(i=0;i<3;i++)
>  {
>
> if(gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(radios[i])))
>   {
> g_print("radio%i\n", i+1);
>   }
>  }
>   }
> int main(int argc, char **argv)
>   {
> gtk_init(, );
>
> GtkWidget *window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
> gtk_window_set_title(GTK_WINDOW(window), "Toolbar");
> gtk_window_set_default_size(GTK_WINDOW(window), 300, 100);
> gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
> g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
>
> GtkToolItem *radio1=gtk_radio_tool_button_new(NULL);
> gtk_tool_item_set_expand(radio1, TRUE);
> gtk_tool_button_set_label(GTK_TOOL_BUTTON(radio1), "radio1");
> GtkToolItem
> *radio2=gtk_radio_tool_button_new_from_widget(GTK_RADIO_TOOL_BUTTON(radio1));
> gtk_tool_item_set_expand(radio2, TRUE);
> gtk_tool_button_set_label(GTK_TOOL_BUTTON(radio2), "radio2");
> GtkToolItem
> *radio3=gtk_radio_tool_button_new_from_widget(GTK_RADIO_TOOL_BUTTON(radio1));
> gtk_tool_item_set_expand(radio3, TRUE);
> gtk_tool_button_set_label(GTK_TOOL_BUTTON(radio3), "radio3");
>
> GtkWidget *toolbar=gtk_toolbar_new();
> gtk_widget_set_hexpand(toolbar, TRUE);
> gtk_toolbar_insert(GTK_TOOLBAR(toolbar), radio1, 0);
> gtk_toolbar_insert(GTK_TOOLBAR(toolbar), radio2, 1);
> gtk_toolbar_insert(GTK_TOOLBAR(toolbar), radio3, 2);
>
> GtkWidget *button=gtk_button_new_with_label("Get Active Radio");
> gtk_widget_set_hexpand(button, TRUE);
> gtk_widget_set_vexpand(button, TRUE);
> GtkToolItem *radios[]={radio1, radio2, radio3};
> g_signal_connect(button, "clicked", G_CALLBACK(get_active_radio),
> radios);
>
> GtkWidget *grid1=gtk_grid_new();
> gtk_container_set_border_width(GTK_CONTAINER(grid1), 15);
> gtk_grid_set_row_spacing(GTK_GRID(grid1), 8);
> gtk_grid_attach(GTK_GRID(grid1), toolbar, 0, 0, 1, 1);
> gtk_grid_attach(GTK_GRID(grid1), button, 0, 1, 1, 1);
>
> gtk_container_add(GTK_CONTAINER(window), grid1);
>
> gtk_widget_show_all(window);
>
> gtk_widget_grab_focus(button);
>
> 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


Re: State actions and Glade

2018-10-02 Thread Mitko Haralanov via gtk-app-devel-list
Can someone please help me with some pointer?

Thank you.

On Tue, Sep 18, 2018 at 9:35 AM Mitko Haralanov 
wrote:

> I am trying to write an application using Glade where the tool bar
> contains a set of radio tool buttons. Those radio tool buttons should not
> perform an action when activated but rather just change the associated
> action's state.
>
> For that I've set the 'Action Name' property for the tool buttons in Glade
> as 'win.radio-state(0)' and 'win.radio-state(1)'.
>
> Since the only thing that I am after is the action's state, I don't even
> need a 'chage_state' handler in the action definition. Therefore, the
> GActionEntry for the radio buttons is defined as:
> {"radio-state", NULL, "i", "0", NULL}
>
> However, no matter what I do, the tool radio buttons are never 'sensitive'
> and I can never click on them.
>
> How should I be using state actions with Glade? It seems that I am doing
> things as described by https://wiki.gnome.org/HowDoI/GAction but it still
> does not work.
>
> Thank you for your help.
>
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


State actions and Glade

2018-09-18 Thread Mitko Haralanov via gtk-app-devel-list
I am trying to write an application using Glade where the tool bar contains
a set of radio tool buttons. Those radio tool buttons should not perform an
action when activated but rather just change the associated action's state.

For that I've set the 'Action Name' property for the tool buttons in Glade
as 'win.radio-state(0)' and 'win.radio-state(1)'.

Since the only thing that I am after is the action's state, I don't even
need a 'chage_state' handler in the action definition. Therefore, the
GActionEntry for the radio buttons is defined as:
{"radio-state", NULL, "i", "0", NULL}

However, no matter what I do, the tool radio buttons are never 'sensitive'
and I can never click on them.

How should I be using state actions with Glade? It seems that I am doing
things as described by https://wiki.gnome.org/HowDoI/GAction but it still
does not work.

Thank you for your help.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list