SARG wrote:Work done
Thanks, I'll check soon. Aren't the missing menu items double-tees, we removed before? I'm unsure, ATM.
SARG wrote:- "<property name="stock_id">dbg-runto</property>" what is the use ?
The name of the icon used for buttons. GTK+ provides a number of standard icons (stock). I extended this set by a GtkIconFactory and added the fbdbg buttons (identifiers starting with dbg-...). So 'dbg-runto' means a widget of type GtkIcon, based on your runto.bmp image.
SARG wrote:- swapped="no" ?
A property, that I'll explain later when I come to signals.
SARG wrote:- diff between short-label (found only 1 time) and label ?
An action can proxxy different widgets. In a menu item the label is used. This text may be too long for a button, especially for a button in the toolbar. Therefor the short-label is used, when present (button Shortcuts in Settings dialog in our case).
SARG wrote:- in the extract below there is a tooltip for a menu entry (no corresponding button). I found this case only 2 times.
Why ?
I've overseen to delete the tooltips.
SARG wrote:What are the first question marks ?
I try to balance the load on my keyboard keys. I recently wrote some C code with a lot of semicolons and I had some questionmarks left ;-)
It's to show that on menu items both, icons and tooltips, should get considered. IMHO tooltips on menus are overkill. But icons may be nice-to-have (ie. as in Geany).
SARG wrote:To get an idea, how many functions in GTK ?
Gir/Gtk-3.0.bi
But when scanning inclusive dependency headers, I get
SARG wrote:So ok I follow your way to do.
In your role, I'd say 'I'll give it a try and decide after testing". (= That's how I interpret your statement.)
SARG wrote:Thanks that's a bit clearer.
Some more clarification:
All above snippets-[123] create a new widget. Once created, the widget can only get manipulated in the snippet-[12] style.
Ie. to make the window invisible again, one would use in snippet-1
or in snippet-2
Code: Select all
g_object_set(win _
, "visible", FALSE _
, NULL)
But there's no way to access an existing widget with a GtkBuilder. The GtkBuilder is only designed to build a new widget. So in this case you have no choise, you have to do classic coding. Therefor you'll need a reference to the widgets build by the GtkBuilder (the variable called 'win' in the above snippets).
When GtkBuilder creates the widgets, it requires an unique identifier (id="...") specified for each class member. This ID is used to get the GObject PTRs out of the built widgets (or objects)
Code: Select all
VAR win = gtk_builder_get_object(build, "MyWindow")
g_object_set(win _
, "visible", FALSE _
, NULL)
That GObject PTR has to get CASTed to the correct class level for snippet-1 syntax. (Be careful: don't get confused by deprecated libglade examples. libglade provides a GtkWidget PTR here. So never use libglade, it's confusing. And transform example code.)
Code: Select all
VAR win = gtk_builder_get_object(build, "MyWindow")
gtk_widget_hide(GTK_WIDGET(win))
SARG wrote:- Some windows/dialogs could be modal (settings) and other ones non-modal (memory parameters). Possible ?
- I didn't give you all the simple dialog boxes (messages or questions yes/no). Could they be created on fly without be defined before ? Even if they contains several lines of text.
That's an other case where GtkBuilder is limited. It doesn't really make sense to create each little message window with the designer. (You'll have to handle variable text sections for each, which is a lot of code.) Instead there's a convenience function family gtk_message_... to generate such small dialogs in a single call (and a more complex family named gtk_dialog_...).
Ie. the dialog from accessviol.jpg may look like (ignore the German button texts)
which will get generated by the function call
Code: Select all
VAR dia = gtk_message_dialog_new_with_markup(GTK_WINDOW(GUI.window1) _
, GTK_DIALOG_MODAL OR GTK_DIALOG_DESTROY_WITH_PARENT _
, GTK_MESSAGE_WARNING _
, GTK_BUTTONS_YES_NO _
, __(!"TRYING TO WRITE AT ADR: <b>%d</b>\n") _
& __(!"Possible error on this line but not SURE\n\n") _
& __(!"<i>File</i>: <b>%s</b>\n") _
& __(!"<i>Proc</i>: <b>%s</b>\n") _
& __(!"<i>Line</i>: <b>%d</b> (selected and put in red)\n") _
& __(!"<b>%s</b>\n\n") _
& __(!"Try to continue ? (if yes change value and/or use [M]odify execution)\n") _
, 222 _
, "D:\a\b\c\d\debuggee.bas" _
, "TEST" _
, 279 _
, "Print ""Line with crash"": Poke testa, 10 'for access violation" _
, NULL)
Here, the pango markup language is used to highlight the core informations in bold characters. The window is specified as modal dialog. And the final output text gets generated using a C format string. (You can also use FB formating by passing an empty C format string and adding the FB formated markup string later.)
Note the macros
__("..."). This is an abreviation for a call to function gettext from libintl. When you want a string literal (from source code) to be translated, you've to enclose it by this function call:
Code: Select all
?"A normal string literal, no translation."
?*__("A translated string, gets extracted from source code for the translators.")
At this point the FB formating of the message text is disadvantageous. It will cut the text in to a bunch of fragments and the translators (all) have to figure out how the final message has to get build from the segments. In contrast, the C format string contains the complete message at one place.
SARG wrote:i.e. Some actions like "step" can be done also by pressing a key.
In my code the user can specify a shortcut for any action. If you want to limit to a certain set of actions, it needs an additional filter.
SARG wrote:- How are handled the keypresses (out of menu) ?
Here's an issue to discuss. When the notes text view is located in the main window (as in notes.jpg), the keyboard shortcuts may interfere with the 'normal' keys, used to edit the notes.
I could de-activate the shortcuts when the keyboard focus is in the notes text view. IMHO that's a second class solution, since the user may wonder why shortcuts sometimes wont work. I'd prefer to open a separate (non-modal) window to edit the notes (in its own accellerators group).
BR